I have an assignment due for my Assembly class and I have a quick couple of questions regarding it.
The requirement is initialize 3 variables as 16bit words with values (10, -60, 30) add those values as the following equation y = var1 + var2 + var3, use no more than 3 lines of code to produce results. Show results in EAX register.
Question #1: The professor gave us nothing to go off of to ensure we have our code done correctly, so can someone give me the display of the EAX register as it should display if I accomplish the above correctly? (no code, just a screen shot of the output).
Here is the code I have so far:
.data arrayD WORD 10, -60, 30 .code mov esi, OFFSET arrayD add eax, [esi] add eax, [esi] add eax, [esi] call DumpRegs call WaitMsg exit
As you can see I have 4 lines of code to produce the results (at least I'm assuming the output is correct). What am I missing that would allow me to drop 1 line of code?
Oh and I realize there is lines missing from the above code, I left them out intentionally since they weren't relevant to my questions.