Advertisement
Advertisement
| 07.19.2008 at 09:01AM PDT, ID: 23579158 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: |
INCLUDE Irvine32.inc mReadkey MACRO ascii, scan mov ah,10h ; BIOS keyboard input function int 16h mov scan,ah mov ascii,al ENDM .data ascii BYTE ? scan BYTE ? str1 BYTE "ASCII code: ",0 str2 BYTE "Scan code: ",0 .code main PROC mov ax,@data mov ds,ax ; Wait for a key; when the macro returns, the two arguments ; contain the ASCII code and scan code of the key. mReadkey ascii, scan ; Display the values. mov edx,OFFSET str1 call WriteString movzx eax,ascii call WriteHex call Crlf mov edx,OFFSET str2 call WriteString movzx eax,scan call WriteHex call Crlf exit main ENDP END main |