| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
 本帖最后由 ISHEEPI 于 2020-10-21 15:23 编辑  
 
assume cs:code 
stack segment 
        db 128 dup(0) 
stack ends 
code segment 
start: 
        mov ax,stack 
        mov ss,ax;写个int9程序 放入int9位置 
        mov sp,128 
        mov si,offset int9 
        mov ax,cs 
        mov ds,ax 
        mov ax,0 
        mov es,ax 
        mov di,204h 
        mov cx,offset int9end - offset int9 
        cld 
        rep movsb 
         
        push word ptr es:[9*4] 
        pop word ptr es:[200h] 
        push word ptr 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 ax,4c00h 
        int 21h 
int9: 
        push ax;int9 功能 接受输入 判断是否为 a   判断松开按键 
        push bx 
        push cx 
        push es 
         
        mov ax,0 
        mov es,ax 
         
        pushf 
        call dword ptr es:[200h] 
         
        in al,60h;判断是否为 A 
        cmp al,1eh 
        jne int9iret 
        mov ax,0b800h 
        mov es,ax 
        mov bx,0 
        mov cx,1 
s1:        in al,60h;判断是否松开 
        cmp al,1eh+80h 
        jne s1;未松开跳回继续判断 
        mov cx,1500;松开后开始写入a 
s: 
        mov byte ptr es:[bx],65 
        mov byte ptr es:[bx+1],1 
        add bx,2 
        call sleep;写一个延迟一下 
loop s 
call int9iret;写完调转结束 
sleep: 
        push ax 
        mov ax,08888h;控制延迟时间 
s2: 
        sub ax,1 
        cmp ax,0 
        jne s2 
        pop ax 
        ret 
int9iret: 
        pop es 
        pop cx 
        pop bx 
        pop ax 
        iret 
int9end: 
                nop 
         
code ends 
end start 
第一次顺利的一遍过 发帖发帖   
 
出问题了 运行完打完a 后 他卡住了。。。。。  
;这里为什么要用CALL?  我觉得应该是  JMP  int9iret 
call int9iret        ;写完调转结束 
 
 
 |   
 
 
 
 |