clhjswe 发表于 2017-2-9 19:29:50

int指令跳错地方了

int指令跳错地方了
int 7c
怎么跳到了0:0?

clhjswe 发表于 2017-2-9 19:33:27

给代码:
1.asm
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset example
mov ax,0
mov es,ax
mov di,200h
mov cx,offset s-offset example
cld
rep movsb
mov ax,0
mov ds,ax
mov ds:,200h
mov ds:,ax
mov ax,4c00h
int 21h

example:
;jmp short s2
;s1:
;db 'welcome to http://ljw.pe.hu!',0
;s2:
;mov ax,cs
;mov ds,ax
;mov si,offset s1-offset example

;mov ax,0b800h
;mov es,ax
;mov di,0
;
;mov ax,10
;dec ax
;mov bx,160
;mul bx
;mov bx,20
;dec bx
;add bx,ax
;mov cx,2
;s3:
;mov ah,2
;mov al,ds:
;mov cx,ax
;mov ch,0
;jcxz s4
;mov es:,ax
;inc si
;add di,2
;mov cx,2
;loop s3
;s4:

mov ax,1234h
add ax,ax
iret
s:
nop
code ends
end start

2.asm
assume cs:code
code segment
start:
int 7ch
mov ax,4c00h
int 21h
code ends
end start

人造人 发表于 2017-2-9 20:33:12

assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset example
mov ax,0
mov es,ax
mov di,200h
mov cx,offset s-offset example
cld
rep movsb
mov ax,0
mov ds,ax

cli
mov word ptr ds:, 200h
mov ds:, ax
sti

mov ax,4c00h
int 21h

example:
;jmp short s2
;s1:
;db 'welcome to http://ljw.pe.hu!',0
;s2:
;mov ax,cs
;mov ds,ax
;mov si,offset s1-offset example

;mov ax,0b800h
;mov es,ax
;mov di,0
;
;mov ax,10
;dec ax
;mov bx,160
;mul bx
;mov bx,20
;dec bx
;add bx,ax
;mov cx,2
;s3:
;mov ah,2
;mov al,ds:
;mov cx,ax
;mov ch,0
;jcxz s4
;mov es:,ax
;inc si
;add di,2
;mov cx,2
;loop s3
;s4:

mov ax,1234h
add ax,ax
iret
s:
nop
code ends
end start

clhjswe 发表于 2017-2-11 21:16:36

人造人 发表于 2017-2-9 20:33


知道了,是中断地址那里没有乘4,不过还是谢谢了
页: [1]
查看完整版本: int指令跳错地方了