这是怎么回事请问
时间:2011-02-14
来源:互联网
执行int 21h后,为什么会cs:ip跳转到一个不知名的地方?
如图
如图
作者: zeussword 发布时间: 2011-02-14
看中断向量表
作者: Lactoferrin 发布时间: 2011-02-14
这是我的coding,没语法错误,那个debug实在不好使啊。。。我用它debug一个example,结果到int 21h还是跳转到一个不知名的地方。。但那个example运行良好啊。。求解释。。
stk segment stack
db 128 dup(?)
tos label word
stk ends
data segment
arr1 db 25,53,22,89,0
arr2 db 2,3,5,7,11,13,17
msg db 'none$'
data ends
code segment
assume cs:code, ss:stk, ds:data
thr equ 50
start: mov ax,stk
mov ss,ax
mov sp,offset tos
mov ax,data
mov ds,ax
mov bx,0
mov cx,0
count: mov dl,arr1[bx]
mov ah,4 ;print arr1[bx]
cmp dl,0
je next1
int 21h
mov ah,2 ;print space
mov dl,32
int 21h
inc bx
inc cx
jmp count
next1: mov ah,2 ;print enter
mov dl,13
int 21h
mov bx,0
push cx
mov cx,0
compare: mov dl,arr1[bx]
cmp dl,0 ;if end
je next2
inc bx
mov ah,4 ;print if less
cmp dl,thr
jnl compare
int 21h
mov ah,2 ;print space
mov dl,32
int 21h
inc cx
jmp compare
next2: cmp cx,0 ;if none print none
jne next3
mov dx,offset msg
mov ah,9
int 21h
next3: mov ah,2 ;print enter
mov dl,13
int 21h
mov bx,0
mov ax,0
mov cx,0
mov si,0
cnteven: mov bl,arr1[si] ;if end
cmp bl,0
je next4
inc si ;jump next if odd
add bl,0
jpo cnteven
add ax,bx ;else add and jump back
inc cl
jmp cnteven
next4: div cl ;print quotient
mov dl,al
mov ah,4
int 21h
mov dl,32 ;print space
mov ah,2
int 21h
mov dl,cl ;print number of evens
mov ah,4
int 21h
mov dl,13 ;print enter
mov ah,2
int 21h
mov di,0
isprime: mov al,arr1[di]
cmp al,0
je ending
mov cx,7
mov si,0
s: mov bl,al
div byte ptr arr2[si]
cmp ah,0
je next5
mov al,bl
inc si
loop s
mov dl,al
mov ah,4
int 21h
mov dl,32
mov ah,2
int 21h
next5: inc di
jmp isprime
ending: mov ah,4ch
int 21h
code ends
end start
stk segment stack
db 128 dup(?)
tos label word
stk ends
data segment
arr1 db 25,53,22,89,0
arr2 db 2,3,5,7,11,13,17
msg db 'none$'
data ends
code segment
assume cs:code, ss:stk, ds:data
thr equ 50
start: mov ax,stk
mov ss,ax
mov sp,offset tos
mov ax,data
mov ds,ax
mov bx,0
mov cx,0
count: mov dl,arr1[bx]
mov ah,4 ;print arr1[bx]
cmp dl,0
je next1
int 21h
mov ah,2 ;print space
mov dl,32
int 21h
inc bx
inc cx
jmp count
next1: mov ah,2 ;print enter
mov dl,13
int 21h
mov bx,0
push cx
mov cx,0
compare: mov dl,arr1[bx]
cmp dl,0 ;if end
je next2
inc bx
mov ah,4 ;print if less
cmp dl,thr
jnl compare
int 21h
mov ah,2 ;print space
mov dl,32
int 21h
inc cx
jmp compare
next2: cmp cx,0 ;if none print none
jne next3
mov dx,offset msg
mov ah,9
int 21h
next3: mov ah,2 ;print enter
mov dl,13
int 21h
mov bx,0
mov ax,0
mov cx,0
mov si,0
cnteven: mov bl,arr1[si] ;if end
cmp bl,0
je next4
inc si ;jump next if odd
add bl,0
jpo cnteven
add ax,bx ;else add and jump back
inc cl
jmp cnteven
next4: div cl ;print quotient
mov dl,al
mov ah,4
int 21h
mov dl,32 ;print space
mov ah,2
int 21h
mov dl,cl ;print number of evens
mov ah,4
int 21h
mov dl,13 ;print enter
mov ah,2
int 21h
mov di,0
isprime: mov al,arr1[di]
cmp al,0
je ending
mov cx,7
mov si,0
s: mov bl,al
div byte ptr arr2[si]
cmp ah,0
je next5
mov al,bl
inc si
loop s
mov dl,al
mov ah,4
int 21h
mov dl,32
mov ah,2
int 21h
next5: inc di
jmp isprime
ending: mov ah,4ch
int 21h
code ends
end start
引用 1 楼 lactoferrin 的回复:
看中断向量表
看中断向量表
作者: zeussword 发布时间: 2011-02-14
遇到int 21H的时候, 按P,不能按T。
作者: masmaster 发布时间: 2011-02-14
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28