int中断实现jmp near ptr功能

来源:互联网 发布:知悉还是悉知 编辑:程序博客网 时间:2024/06/05 03:42

;在屏幕的第13行显示conversation字符串

assume cs:codesg

datasg segment
db 'conversation',0
datasg ends
codesg segment
main:
mov ax, datasg
mov ds, ax
mov si, 0
mov ax, 0b800H
mov es, ax
mov di, 12*160
s:
cmp byte ptr [si], 0
je ok
mov al, [si]
mov es:[di], al
inc si
add di, 2
mov bx, offset s - offset ok

;自写代码实现jmp near ptr s
push es;es入栈保存地址
;int7cH中断向量表的设置
mov ax, 0
mov es, ax
mov ax, cs
mov word ptr es:[7cH * 4 + 2], ax
mov ax, offset s
mov word ptr es:[7cH * 4], ax;
pop es ;还原es位置
int 7cH
ok:
mov ax, 4c00H
int 21H
codesg ends

end main


0 0
原创粉丝点击