. : : Assembly Language : : .  |  首页  |  我提出的问题  |  我参与的问题  |  我的收藏  |  消息中心   |  游客  登录  | 
刷新 | 提问 | 未解决 | 已解决 | 精华区 | 搜索 |
  《汇编语言》论坛 ->寄存器(CPU工作原理)
  管理员: assembly   [回复本贴] [收藏本贴] [管理本贴] [关闭窗口]
主题 : :  王爽汇编15章实验  [待解决] 回复[ 0次 ]   点击[ 287次 ]  
heilong
[帖 主]   [ 发表时间:2013-08-27 23:41 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2013-08-26 19:02
;大家别看到程序长就退缩啊,我的问题只有一点很简单,就是指令处:in al,60h
                                                                                                               
                                                                                                  就是这个in al,60h它读取的到底是断码还是通码啊,为什么之前,我在书上看到读取通码也用 in al,60h。现在读取断码也用   in  al,60h.我顿时就晕了。可调试时,又没有出错,所以我想问各位高手,这个in  al,60h到底是个神马情况啊。
assume cs:code,ss:stack

stack segment

        db 128 dup(0)

stack ends

 

code segment

start:

        mov ax,stack

        mov ss,ax

        mov sp,128

        mov ax,cs

        mov ds,ax

        mov ax,0

        mov es,ax

        mov si,offset int9

        mov di,204h

        mov cx,offset int9end-offset int9

        cld

        rep movsb               ;安装自定义的int9中断例程

        

        

        push es:[9*4]

        pop es:[200h]

        push es:[9*4+2]

        pop es:[202h]            ;保存原中断向量

        cli

        mov word ptr es:[9*4],204h

        mov word ptr es:[9*4+2],0     ;设置自定义的中断向量

        sti

      mov cx,120

lp:     mov ah,0    ;进行120次读取BIOS键盘缓冲区的操作,

        int 16h     ;以辅助读者在程序运行时方便进行相关的按键操作。

        loop lp 



   
        

        mov ax,4c00h

        int 21h

 

int9:   ;自定义的int9中断例程

        push ax

        push bx

        push cx

        push es

        

        

        

        pushf

        call dword ptr cs:[200h]

 
        in al,60h
        cmp al,9eh                  ;A键的断码为9eh

        jne int9ret

 

        mov ax,0b800h

        mov es,ax

        mov bx,0

        mov cx,2000

s:      mov byte ptr es:[bx],'A'

        add bx,2

        loop s

int9ret:        pop es

                pop cx

                pop bx

                pop ax

        iret

int9end:        nop

 

code ends

end start
需要登录后才能回帖 -->> 请单击此处登录
    Copyright © 2006-2024   ASMEDU.NET  All Rights Reserved