'
'-----------------------------------
'TRACING EXECUTION OF ASSEMBLY CODE
'INSPECT REGISTERS AFTER INSTRUCTION
'===================================
includepath "$\inc\"
include "console.inc"
'----------------
'DIAGNOSTIC MACROS
'================
def SHOW
pushad : mov a,%1 : printl "%1: " hex a : popad
end def
'
def MSG
pushad : printl %1 : popad
end def
'
def FLAGS
pushad : pushf : pushf : pop eax : mov a,eax : printl "Flag Register: " hex a : popf : popad
end def
'
def x
: pushad : pushf : call showregs : popf : popad :
end def
dim a
sub showregs()
dim as long v(9) at [ebp+8]
dim as string tab=chr 9
printl "
Registers:
EAX: " tab hex (v(9),8) "
ECX: " tab hex (v(8),8) "
EDX: " tab hex (v(7),8) "
EBX: " tab hex (v(6),8) "
ESP: " tab hex (v(5),8) "
EBP: " tab hex (v(4),8) "
ESI: " tab hex (v(3),8) "
EDI: " tab hex (v(2),8) "
EFLAGS:" tab hex (v(1),4) "
"
end sub
'--------
'ASM TEST
'========
'PLACE "x" AT ANY INSTRUCTION TO SEE THE REGISTER CONTENTS
mov ecx,0
X mov eax,1 X
cmp eax,0 X
'FLAGS
jz nif
'MSG "condition Not met"
mov ecx,1
nif:
'SHOW ecx
waitkey