; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<; filename: keycode.asm; function: display the code of key That: DISPLAY THE CODE OF KEY THAT You Pressed; Author: purple endure ;; date log; ------------------------------------; 02- 05-2003 created!; <<<<<<<<<<<<<<<<<<<<<<<<<<<
Codeseg segment; ============================================ assumecs: CODESEG, DS: CODESEGORG100H; ----- ------------------------------ @ Main Proc Nearmov DX, Offset Strheadermov AH, 09HINT 21H
MOV AH, 0INT 16HPUSH AXMOV DL, Almov CX, 4SHR DL, CLCALL SHOWHEX
POP DXPUSH DXAND DL, 0FHCALL SHOWHEX
Mov DX, Offset Strspacemov AH, 09HINT 21H
POP DXMOV DL, DHPUSH DXMOV CL, 4SHR DL, CLCALL SHOWHEX
POP DXAND DL, 0FHCALL SHOWHEX
MOV AX, 4C00HINT 21HMain Endp; --------------------
Showhex Proc Nearcmp DL, 9jg @gaadd DL, '0'jmp @ Show @ GA: Add DL,' A'- 0ah @ show: MOV AH, 2InT 21hretshowHex Endp
; ---------------------- strHeader DB "Ascii Scancode", 0DH, 0AH, '$' Strspace DB 8 DUP ('),' $ ' ============================= Codeseg endsend @main