汇编网首页登录博客注册
thedaydreamwang的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
最新留言
友情链接

[2010-02-18 01:44] 关于内中断的疑问

这两天没睡好,喜欢的人不能挽留。。。。
有点伤感!!。。。
回到代码中来,发现一些问题,我是按王爽老题写的教程写下了如下代码,在debug32过程中出了一些问题,不是很明白,以前有过类似的问题,就是寄存器需要赋初值如在push XX后加上 mov ds,0 mov es,0之后就解决了问题现在的的情况很类似
assume cs:code
code segment
 start: mov ax,cs
                mov ds,ax
                mov si,offset do0
                mov ax,0
                mov es,ax
                mov di,200h
                mov cx,offset do0end-offset do0
                cld
                rep movsb
                mov ax,0
                mov es,ax
                mov word ptr es:[0*4],200h ;设置中断向量表
                mov word ptr es:[0*4+2],0
                            mov ax,1000h
                            mov dh,01h
                            div dh
                mov ax,4c00h
                int 21h
        do0: jmp short do0start
               db "overflow"
      do0start:                           push ax
                                              push si
                                              push di
                                              push es
                                              push cx
                                              mov di,0
                                              mov ax,0
                                              
                                              mov ax,cs
                                        mov ds,ax
                            mov si,202h
                            mov ax,0b800h
                            mov es,ax
                            mov di,12*160+36*2
                            mov cx,9
                        s: mov al,[si]
                            mov es:[di],al
                                              mov ah,02h
                            inc si
                            add di,2
                            loop s
                                              pop cx
                                              pop es
                                              pop di
                                              pop si
                                              pop ax
                            mov ax,4c00h
                            int 21h
           do0end:nop
code ends
end start
                
当这断代码结束的时候再用debug32命令时0号中断又恢复到原来的位置,这一点我不是很明白,有知道的请告诉我再就用T命令去执行的时候到 div bh的时候不能正常返回下面是返回的结果
-t
AX=1000  BX=0000  CX=0000  DX=0100  SP=0000  BP=0000  SI=0072  DI=023E
DS=2196  ES=0000  SS=2196  CS=2196  IP=002D  NV UP DI PL NZ NA PO NC
2196:002D F6F6             DIV     DH
Trace Interrupt
但是退出debug32之后又有了返回不是很明白
如下

C:\>debug32 c:\hh.exe
Debug32 - Version 1.0 - Copyright (C) Larson Computing 1994


C:\>






                                    overflowP

不知道大家有没有和我一样跟踪的
别附上AOGO小站的debug32下载地址,有疑问的朋友可以和我一同探讨
http://www.aogosoft.com/downpage.asp?mode=download&table=soft&id=79
评论次数(1)  |  浏览次数(1141)  |  类型(汇编作业) |  收藏此文  | 

[  thedaydreamwang   发表于  2010-02-18 02:00  ]

昏死了重新修改之后OK了
assume cs:code
code segment
 start: mov ax,cs
                mov ds,ax
                mov si,offset do0
                mov ax,0
                mov es,ax
                mov di,200h
                mov cx,offset do0end-offset do0
                cld
                rep movsb
                mov ax,0
                mov es,ax
                mov word ptr es:[0*4],200h ;设置中断向量表
                mov word ptr es:[0*4+2],0
                            mov ax,1000h
                            mov dh,01h
                            div dh
                mov ax,4c00h
                int 21h
        do0: jmp short do0start
               db "overflow"
      do0start:                           push ax
                                              push si
                                              push di
                                              push es
                                              push cx
                                              mov di,0
                                              mov ax,0
                                              mov si,0
                                              mov cx,0
                                              mov ax,cs
                                        mov ds,ax
                            mov si,202h
                            mov ax,0b800h
                            mov es,ax
                            mov di,12*160+36*2
                            mov cx,9
                        s: mov al,[si]
                            mov es:[di],al
                                              mov ah,02h
                            inc si
                            add di,2
                            loop s
                                              pop cx
                                              pop es
                                              pop di
                                              pop si
                                              pop ax
                            mov ax,4c00h
                            int 21h
           do0end:nop
code ends
end start

 
 请输入验证码  (提示:点击验证码输入框,以获取验证码