?? huibianyili.txt
字號:
從鍵盤輸入一個字符,要求調用bios中斷,并用八進制的形式顯示其掃描碼和ascii碼
;*************************☆ Keyboard I/O test ☆**********************
; -(2003 414 901)
;print out scan code and ASCII of any key
;QUFU Normal university
;Institute of Computer Science and Technology
;----------------------------------------------------------------------
data segment
msg1 db 0dh,0ah,' CHAR Scancode ASCII',0dh,0ah,'$'
msg2 db ' $'
data ends
;----------------------------------------------------------------------
stack segment para stack 'stack'
db 64 DUP(?)
stack ends
;----------------------------------------------------------------------
pro_nam segment
;----------------------------------------------------------------------
main proc far
assume cs:pro_nam,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov dx, offset msg1
mov ah,09h
int 21h
again:
mov ah,0
int 16h
cmp ah, 01h ;is ESC?
je exit ;yes,exit to DOS
mov bx,ax
mov dx,offset msg2
mov ah,9h
int 21h
mov dl,bl ; print character
mov ah,2h
int 21h
call display ; print scancode
mov bh,bl
call display ; print ASCII
mov dl,0ah ; print CR
mov ah,2h
int 21h
mov dl,0dh ; and LF
mov ah,2h
int 21h
jmp again
exit: ret
main endp
;----------------------------------------------------------------------
display proc near
push bx
mov ch,3
mov cl,3
shr bx,1
mov dx,offset msg2
mov ah,9h
int 21h
rotate:
rol bx,cl
mov al,bl
and al,07h
add al,30h
print:
mov dl,al
mov ah,2
int 21h
dec ch
jnz rotate
pop bx
ret
display endp
;----------------------------------------------------------------------
pro_nam ends
;**********************************************************************
end start
;--------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -