(1)最大转移的范围为FFFFH,可以转移的范围是 -32768~32767
(2)jmp near ptr s是近转移(-32768-32767)
near:
push bp
mov bp,sp
add [bp+2],bx
pop bp
iret
(3)
(应用列举)
assume cs:code
data segment
db 'conversation',0
data ends
code segment
start:
mov ax,data
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 byte ptr al,[si]
mov byte ptr es:[di],al
mov byte ptr es:[di+1],02H
inc si
add di,2
mov bx,offset s-offset ok
int 7ch
ok:
mov ax,4c00h
int 21h
code ends
end start
data segment
db 'conversation',0
data ends
code segment
start:
mov ax,data
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 byte ptr al,[si]
mov byte ptr es:[di],al
mov byte ptr es:[di+1],02H
inc si
add di,2
mov bx,offset s-offset ok
int 7ch
ok:
mov ax,4c00h
int 21h
code ends
end start
(7c中断例程)
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 ds,ax
mov word ptr ds:[7ch*4],200H
mov word ptr ds:[7ch*4+2],0H
mov ax,4c00h
int 21h
do0:
push bp
mov bp,sp
add [bp+2],bx
pop bp
iret
do0end:
nop
code ends
end start
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 ds,ax
mov word ptr ds:[7ch*4],200H
mov word ptr ds:[7ch*4+2],0H
mov ax,4c00h
int 21h
do0:
push bp
mov bp,sp
add [bp+2],bx
pop bp
iret
do0end:
nop
code ends
end start
与您一同分享精彩的网络世界
-486174组织成员