代码未在汇编语言中显示结果


A DWORD 38h
B DWORD 0010 1001b
C DWORD A5h
D DWORD 85d
;Calculate A = (A - B) + (C - D). Where A = 38d, B = 0010 1001b, C = A5h and D = 85d.  
mov EAX, 0
mov EAX, A
sub EAX, B
mov EBX, C
sub EBX, D
add EAX, EBX
mov A, EAX
call WriteInt
.data
valA DWORD 38d
valB DWORD 101001b
valC DWORD 0A5h
valD DWORD 85d
.code
mov EAX, 0            ; setting the register to 0
mov EAX, valA         ; moving the value in a to eax register
sub EAX, valB         ; value A - Value B
mov EBX, valC         ; moving the value in c to ebx
sub EBX, valD         ; value C - Value D
add EAX, EBX          ; (A - B) + (C - D)
mov valA, EAX         ; set answer to Aand move it to EAX
Call WriteInt
call DumpRegs   ;shows content 

相关内容

  • 没有找到相关文章

最新更新