This is my first "real" x86 program developed from scratch. Please critique:
format PE console
entry start
include 'win32a.inc'
section '.text' code executable
start: pushf
push hello
call [printf]
pop ecx
pop eax
check_carry_flag:
mov dx, ax ; ax has flags reg
test ax, 1h
jnz carry_flag_set
mov esi, edx
check_parity_flag:
mov eax, esi
test ax, 4h
jnz parity_flag_set
mov esi, edx
check_aux_flag:
mov eax, esi
test ax, 10h
jnz aux_flag_set
mov esi, edx
check_zero_flag:
mov eax, esi
test ax, 40h
jnz zero_flag_set
mov esi, edx
check_sign_flag:
mov eax, esi
test ax, 80h
jnz sign_flag_set
mov esi, edx
check_dir_flag:
mov eax, esi
test ax, 400h
jnz dir_flag_set
mov esi, edx
check_OF_flag:
mov eax, esi
test ax, 800h
jnz OF_flag_set
jmp endme
carry_flag_set:
mov esi, edx
push carry_flag
call [printf]
pop ecx
mov edx, esi
jmp check_parity_flag
parity_flag_set:
mov esi, edx
push parity_flag
call [printf]
pop ecx
mov edx, esi
jmp check_aux_flag
aux_flag_set:
mov esi, edx
push aux_flag
call [printf]
pop ecx
mov edx, esi
jmp check_zero_flag
zero_flag_set:
mov esi, edx
push zero_flag
call [printf]
pop ecx
mov edx, esi
jmp check_sign_flag
sign_flag_set:
mov esi, edx
push sign_flag
call [printf]
pop ecx
mov edx, esi
jmp check_dir_flag
dir_flag_set:
mov esi, edx
push dir_flag_set
call [printf]
pop ecx
mov edx, esi
jmp check_OF_flag
OF_flag_set:
mov esi, edx
push OF_flag
call [printf]
pop ecx
endme:
push p
call [system]
pop ecx
push 0
call [ExitProcess]
section '.rdata' data readable
hello db 'The flags are: %X', 10, 0
p db 'pause>nul'
carry_flag db 'Carry flag set', 0
parity_flag db 'Parity flag set', 0
zero_flag db 'Zero flag set', 0
sign_flag db 'Sign flag set', 0
dir_flag db 'Direction flag set', 0
OF_flag db 'Overflow flag set', 0
aux_flag db 'Aux flag set', 0
section '.idata' data readable import
library kernel32, 'kernel32.dll', \
msvcrt, 'msvcrt.dll'
import kernel32, ExitProcess, 'ExitProcess'
import msvcrt, printf, 'printf', \
system, 'system'