The following code prints the value : -83396
The calculation I am doing here is Z2 = (var3 – var2 - 1000) + (var1 – 500)
So Z2 = (FFFF0000h - 4000h- 1000) + (24 - 500)
I am not sure how it turned out to be -83396
? I am simply storing the values
in the registers for var2, var3 for calculation
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
INCLUDE Irvine32.inc
.data
var1 byte 24
var2 word 4000h
var3 dword 0FFFF0000h
Z1 dword ?
Z2 dword ?
Z3 dword ?
Z4 dword ?
.code
main proc
xor eax,eax
xor ebx,ebx
mov eax, var3
movzx ebx, var2
sub eax, ebx
xor ebx,ebx
sub eax, 1000
xor ebx, ebx
movzx ebx, var1
sub ebx, 500
add eax, ebx
mov Z2, eax
call writeint
clc
invoke ExitProcess,0
main endp
end main