大家帮助下我 看一下这段代码什么意思
data segment string db 'ASCII SCAN CHAR',0dh,0ah,'$'
ending db 'Press any key to continue',0dh,0ah,'$'
temp db ?
data ends
stack segment
db 512 dup(?)
stack ends
code segment
start:
;---------input a num(Tips)
mov ah,09h
mov dx,offset string
int 21h
;---------input a num(getcode)
getkey:
mov ah,00h
int 16h
mov dl,al
mov dh,ah
;---------Backup
push dx
push dx
push dx
push dx
push dx
;---------Al,ASCII
;------------high4bits
mov cl,04h
shr dl,cl
cmp dl,09h
ja outa1
add dl,30h
mov ah,02h
int 21h
jmp next1
outa1:
add dl,37h
mov ah,02h
int 21h
next1:
;------------low4bits
pop dx
and dl,0fh
cmp dl,09h
ja outa2
add dl,30h
mov ah,02h
int 21h
jmp next2
outa2:
add dl,37h
mov ah,02h
int 21h
next2:
;------------Out space
mov ah,02h
mov dl,20h
int 21h
;------------AH,Scan Code
;------------high4bits
pop dx
mov cl,04h
shr dh,cl
cmp dh,09h
ja outa1
add dh,30h
mov ah,02h
mov dl,dh
int 21h
jmp next3
outa3:
add dh,37h
mov ah,02h
mov dl,dh
int 21h
;------------low4bits
next3:
pop dx
and dh,0fh
cmp dh,09h
ja outa4
add dh,30h
mov ah,02h
mov dl,dh
int 21h
jmp next4
outa4:
add dh,37h
mov ah,02h
mov dl,dh
int 21h
next4:
;------------Out space
mov ah,02h
mov dl,20h
int 21h
;-----------Out char
pop dx
mov ah,02h
int 21h
;------------newline
mov ah,02h
mov dl,0dh
int 21h
mov ah,02h
mov dl,0ah
int 21h
;------------check ends
pop dx
cmp dl,03H
je happyed
jne getkey
happyed:
mov ah,02h
mov dl,0dh
int 21h
mov ah,02h
mov dl,0ah
int 21h
mov ah,09h
mov dx,offset ending
int 21h
code ends