Captain_Jack 发表于 2013-4-8 16:59:08

求助汇编第十五章实验,请问我的代码哪里错了?

assume cs:code,ss:stack
stack segment para stack 'stack'
        db 128 dup (0)
stack ends
code segment
start:
        mov ax,stack
        mov ss,ax
        mov sp,128
        mov ax,0
        mov es,ax       
        push cs
        pop ds
        mov si,offset int9
        mov di,204h
        mov cx,offset int9_end - offset int9
        cld
        rep movsb
        push es:
        pop es:
        push es:
        pop es:
        cli
        mov word ptr es:,204h
        mov word ptr es:,0
        sti
;        mov cx,120
;lp:        mov ah,0
;        int 16h
;        loop lp
        mov ax,4c00h
        int 21h
int9:
        push ds
        push si
        push ax
        push cx
        in al,60h
        pushf
        call dword ptr cs:
        cmp al,9eh
        jne int9_ok
        mov ax,08b00h
        mov ds,ax
        mov si,0
        mov cx,2000
        mov al,'A'
        int9_s:
                mov ds:,al
                add si,2
                loop int9_s
        int9_ok:
                pop cx
                pop ax
                pop si
                pop ds
                iret
int9_end: nop
code ends
end start

Captain_Jack 发表于 2013-4-9 18:02:37

我去了,知道了,0b800h写成08b00h了。哭了……这都可以,干看也没看出来,因为是中断也没法debug查看~这么弱智的问题……

henrywsnew 发表于 2013-6-5 16:40:28

你好,我也在学汇编,有个问题想请教,为什么要写cmp al,9eh,书上说9eh是a 的断码,我不明白的是为什么前一句in,al,60h,端口读出的就是9eh,而不是1eh?该章中例子里按esc键改变颜色,同样用了这两句,但后一句用的是cmp al, 1 不是通码?而是断码。能否互相交流,我的QQ是1450819026
页: [1]
查看完整版本: 求助汇编第十五章实验,请问我的代码哪里错了?