I've been searching both Google and the forum, and I can't find out how one can output the value of a register/variable on the screen. int 21h doesn't work, windows displays an error when it is run.
For example, how do I output the value of register AX?
Here's the code:
include \masm32\include\masm32rt.inc
.code
start:
mov ax, 0
mov cx, 0
a: add cx,1
add ax, cx
cmp cx, 5
jne a
exit
end start
in 32 bit you could
movzx ebx, ax
print str$(ebx)
inkey
I think also this would work but not sure:
movzx eax, ax
print str$(eax)
inkey
movzx zeros the other 2 bytes, inkey pauses the application untl a key is pressed so you can see output before application quits
It works fine. Thanks. :U