(2)编写,编译,并运行myloop.exe
assume cs:code
code segment
start:
mov ax , cs
mov ds , ax
mov si , offset myloop
mov ax , 0
mov es , ax
mov di , 200h
mov cx , offset myloopend - offset myloop
cld
rep movsb
mov ax , 0
mov es , ax
mov word ptr es:[7ch*4] , 200h
mov word ptr es:[7ch*4+2] , 0
mov ax , 4c00h
int 21h
myloop:
push bp
mov bp , sp
dec cx
jcxz lpret
add [bp+2] , bx
lpret:
pop bp
iret
myloopend: nop
code ends
end start
(2)测试程序
assume cs:code
code segment
start :
mov ax , 0b800h
mov es , ax
mov di , 160*12
mov bx , offset s - offset se
mov cx , 80
s:
mov byte ptr es:[di] , '!'
add di , 2
int 7ch //调用myloop
se: nop
mov ax , 4c00h
int 21h
code ends
end start