If anyone can help me out on this, please give a program that compiles and runs.
ID: 3890955 • Letter: I
Question
If anyone can help me out on this, please give a program that compiles and runs. A single program , not multiple ones. Please dont answer if u dont intend on fully completing it.
Need help with this contru nom Compdo ong hhute an assembly la arithmetic operations advandbla&alled; let'= 344 rquage progrom dhds perl oms a Colculate Tne Sum ol tuo voriables lelt ard siaid ond storeln total mesage shoP contains uloRD called 'Atray thod is Deine a charader stzung called messoge thar contains the chanadrn Melo World! Deline an anrau d atatype wlo?b called 1ni intialiaed to ho llas values 1, 2,,, 32and cada to determine lerath Asho lrite assembly bagige d Store this vdue in. variahle callod 'Arrayerth Move the contents dhe varioHe lelt into the EAX Cl CX 0) rraul Call the authonis dumpReg haudioe to display contentsExplanation / Answer
;;MASM syntax
TITLE basic assembly language program
INCLUDE Irvine32.inc
.data
Array WORD 1, 2, 4,8,16,32,64 ; Declare a word array
Arraylength = ($ - Array) ;code to calculate array length
.data?
.code
Main PROC
;ADDITION
mov eax,left
mov ebx,right
add eax,ebx
;MOVING RESULT IN TOTAL
mov total,eax
;SUBTRACTION
mov eax,right
mov ebx,right
sub ebx,eax
;MOVING RESULT IN DIFF
mov diff,ebx
;MOVING CONTENTS OF REGISTERS
mov EAX,left ;move left variable to EAX
mov EBX,right ;move right variable to EBX
mov ECX,total ;move total to ECX
mov EDX,diff ;move diff to EDX
mov ESI,Arraylength ;move Arraylength to ESI
call DumpRegs ;display registers
exit ;halt program
main ENDP ;end procedure
END main ;end program