Hi, in this assembly programming assignment. I am met with the error \" Assembli
ID: 3678382 • Letter: H
Question
Hi, in this assembly programming assignment. I am met with the error
" Assembling: AddSubMovSX.asm
AddSubMovSX.asm(36) : error A2000: memory operand not allowed in context
Press any key to continue . . ."
Can someone please tell me what I am doing wrong?
10 INCLUDE Irvine32.inc 11.data 12 bNum01 SBYTE 127 13 bNum02 SBYTE-80 14 bNum03 SBYTE 32 15 bResult SBYTE? 17owNum01 SWORD 32000 18 wNum02 SWORD -4096 19 wNum03 SWORD 256 20 wResult SWORD? 21 22 dwNum01 23 dwNum02 24 dwNum03 25 dwResult SDWORD 2000000 SDWORD -4096 SDWORD 6000 SDWORD? 27 28 .code 29 main PROC 30 31 32 mov eax, 0 mov ebx, 0 movsx eax, bNum01 movsx ebx, bNum02 add eax,elbx sub eax, ebx movsx bResult, eax 34 37 38 mov esi,offset bResult mov ecx, LENGTHOF bResult mov ebx,TYPE bResult call DumpMem 40 41 42 43 INVOKE ExitProcess, 4 6 47 main ENDP 48Explanation / Answer
There are two problems in the code.
First is that you haven't defined the value of bResult. It should be made zero.
Second the syntax of the instruction is wrong. It should be movsx eax,bResult.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.