'Printing ascii value with character in byte array in 8086
I am trying to print the 2 digit hex ascii value of a character but WriteHex keeps printing 8 bits. I am unsure how to fix this. The byte_array contains all characters of what I am trying to print but I need to print their hex value for a hexdump procedure. I am using the Irvine16 library for the WriteHex proc and a self generated library for the WriteChar240 proc.
dump_ascii_value PROC
pushf
push dx
push ax
push bx
push cx
mov dh, location_y
mov dl, second_col_x
mov ah, 02h
int 10h
mov cx, 0
mov bx, offset byte_array
top:
cmp [bx], cx
jz done
mov al, 0
mov ax, WORD ptr [bx]
call WriteHex
mov al, 020h
call WriteChar240
inc bx
jmp top
done:
pop cx
pop bx
pop ax
pop dx
popf
ret
dump_ascii_value ENDP
'''
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
