首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > 汇编语言 > 显示按下的键的编码的汇编源代码
【标  题】:显示按下的键的编码的汇编源代码
【关键字】:
【来  源】:http://blog.csdn.net/Purpleendurer/archive/2005/04/30/369605.aspx

显示按下的键的编码的汇编源代码

;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;Filename: KeyCode.asm
;Function: Display the code of key that you pessed
;Author  : Purple Endurer
;
;Date        Log
;-----------------------------------
;02-05-2003  Created!
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

codeseg segment
;===================================
 assume cs: codeseg, ds:codeseg
 org 100h
;-----------------------------------
 @main  proc    near
        mov     dx, offset strHeader
        mov     ah, 09h
        int     21h

        mov     ah, 0
        int     16h
        push    ax
        mov     dl, al
        mov     cx, 4
        shr     dl, cl
        call    showhex

        pop     dx
        push    dx
        and     dl, 0fh
        call    showhex

        mov     dx, offset strSpace
        mov     ah, 09h
        int     21h

        pop     dx
        mov     dl, dh
        push    dx
        mov     cl, 4
        shr     dl, cl
        call    showhex

        pop     dx
        and     dl, 0fh
        call    showhex

        mov     ax,4c00h
        int     21h
 main  endp
;--------------------

 showhex proc   near
        cmp     dl, 9
        jg      @ga
        add     dl, '0'
        jmp     @show
 @ga:
        add     dl, 'A'- 0ah
 @show:
         mov     ah, 2
         int     21h
         ret
 showhex endp

;----------------------
 strHeader      db      "ASCII     ScanCode", 0dh, 0ah, '$'
 strSpace       db      8 dup (' '), '$'
;======================
codeseg ends
     end @main

OBSIDIUM V1.25 Code Injection:【上一篇】
[原创]用MASM32获取windows类型:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • Snake.Net中的ORM(二)
  • 10.10 Execution order
  • 刻录音乐CD碟片
  • 应用Decorator模式的一个很好的实例
  • (一)如何将一列多行(1列12行)转换成多列多行(3列4行)?(asp.net)
  • API之位图、图标和光栅运算函数
  • [技术]数据容灾备份的等级和技术
  • iptables经典设置
  • 自己写的日期相加函数(C语言)_根据ORACLE数据库的方式改进版
  • Linux 指令篇:档案目录管理--touch
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.