. : : Assembly Language : : .  |  首页  |  我提出的问题  |  我参与的问题  |  我的收藏  |  消息中心   |  游客  登录  | 
刷新 | 提问 | 未解决 | 已解决 | 精华区 | 搜索 |
  《汇编语言》论坛 ->外中断
  管理员: assembly   [回复本贴] [收藏本贴] [管理本贴] [关闭窗口]
主题 : :  p283 例题15.5运行没有效果??  [待解决] 回复[ 2次 ]   点击[ 350次 ]  
nhcys
[帖 主]   [ 发表时间:2009-07-24 23:16 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-06-07 23:21
我运行后按 键 没有改变屏幕颜色?? 我在debug的时在没有运行 mov ax,4c00h  和 int 21h 这两条语句之
前 ,如果按 F1 键会改变一半屏幕的颜色。但如果执行完最后2条语句后,程序退出后就没有这个效果了 ,并且如果继续按键还会有死机退出DOS的现象!!!  为什么??

程序如下:(抄书上的)

assume cs:code
stack segment
   db 128 dup(0)
stack ends

code segment
                start:          mov ax,stack
                                mov ss,ax
                                mov sp,128

                                push cs
                                pop ds

                                mov ax,0
                                mov es,ax

                                mov si,offset int9
                                mov di,204h
                                mov cx,offset int9end-offset int9
                                cld
                                rep movsb

                                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 ax,4c00h
                                int 21h

                  int9:         push ax
                                push bx
                                push cx
                                push es

                                in al,60h

                                pushf
                                call dword ptr cs:[200h]

                                cmp al,1
                                jne int9ret

                                mov ax,0b800h
                                mov es,ax
                                mov bx,1
                                mov cx,2000
                       s:       inc byte ptr es:[bx]
                                add bx,2
                                loop s

                   int9ret:     pop es
                                pop cx
                                pop bx
                                pop ax
                                iret

                     int9end:   nop

code ends
end start
nhcys
[第1楼]   [ 回复时间:2009-07-24 23:19 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-06-07 23:21
噢,补充说明:我把按键改了 ESC键来试试【cmp al,1】,还是老问题。程序退出后还是没有效果。
nhcys
[第2楼]   [ 回复时间:2009-07-24 23:30 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-06-07 23:21
哦,我明白了。 我看了superasm的贴子。 谢谢你们的讨论。 就是要运行 command.com 才行。 我开始就是用了
cmd命令!!  其实我以前一直都是用 cmd 命令的。   thank you !!!
需要登录后才能回帖 -->> 请单击此处登录
    Copyright © 2006-2024   ASMEDU.NET  All Rights Reserved