I can't get the following code to run. It compiles but just gives a blank output. Im trying to take the value of HEX_OUT, remove the trailing zero and then and it with the value of register dx so that the value of HEX_OUT is now the value of dx. Any help would be much appreciated.
Thanks,
Ash
; prints the value of DX as hex.
print_hex:
pusha
mov ax, HEX_OUT ; ax = 0x00000
shr ax, 1 ; remove trailing 0
and ax, dx ; and registers and store in ax
; TODO :manipulate chars at HEX_OUT to reflect DX
mov bx, ax ; print the string pointed to
call print_string ; by BX
popa
ret
; global variables
HEX_OUT : db '0x0000',0