问题

字节数组X中存放着 0~F共16个十六进制数,请将这些数以十六进制形式显示在屏幕上。

代码

data segment
  x db  0,1,2,3,4,5,6,7,8,9,0ah,0bh,0eh,0dh,0eh,0fh
data ends


code segment
assume cs:code,ds:data
main proc far
start:
  mov ax,data
  mov ds,ax
  mov ch,0
  mov si,0
  mov cx,16
L1:
  mov dl,x[si]
  add dl,30h
  cmp dl,39h
  jbe  L2
  add dl,07h
L2:
  mov ah,02h
  int 21h
  inc si
  loop L1
  mov ax,4c00h
  int 21h
  
main endp  
code ends
end start

运行结果