用7ch中断例程完成jmp near ptr s指令的功能,用bx向中断例程传送转移位移。

应用举例:在屏幕的第12行,显示data段中以0结尾的字符串。

assume cs:code

data segment
db 'conversation',
data ends code segment start:
mov ax, data
mov ds, ax
mov si,
mov ax, 0b800h
mov es, ax
mov di, * s:
cmp byte ptr [si],
je ok
mov al, [si]
mov es:[di], al
inc si
add di,
mov bx, offset s-offset ok
int 7ch ok:
mov ax, 4c00h
int 21h code ends
end start

安装程序

assume cs:code

code segment

start:
mov ax, cs
mov ds,ax
mov si,offset do0
mov ax,
mov es,ax
mov di,200h
mov cx,offset do0end-offsetdo0
cld
rep movsb mov ax,
mov es,ax
mov word ptr es:[7ch*],200h
mov word ptr es:[7ch*+], mov ax,4c00h
int 21h do0:
push bp
mov bp,sp
add [bp+],bx pop bp
iret mov ax,4c00h
int 21h do0end:
nop code ends
end start
上一篇:2016校招内推 -- 腾讯SNG前端 -- 面试经历


下一篇:usr/bin/ld: cannot find 错误解决方法和 /etc/ld.so.conf