答案
实验4 [BX]和loop的使用
(1)编程,向内存0:2000:23F依次传送数据063(3FH)。
assume cs:code
code segment
mov ax,0
mov ds ,ax
mov al,0
mov bx,200h
mov cx,64
s: mov ds:[bx],al
inc bx
inc al
loop s
mov ax,4c00H
int 21h
code ends
end
(2)编程向内存0:2000:23F依次传送数据063(3FH)
assume cs:code
code segment
mov ax,20h
mov ds,ax
mov al,0
mov cx,64
s: mov [al],al
inc al
loop s
mov ax,4c00h
int 21h
code ends
end
(3)下面的程序的功能是将“mov ax,4c00h”之前的指令复制到内存0:200处,补全程序。上机调试,跟踪运行结果。
assume cs:code
code segment
mov ax,cs
mov ds,ax
mov ax,0020h
mov es,ax
mov bx,0
mov cx,17h ;我们可以通过debug模式的u命令查看程序到mov ax,4c00h之前占23个字节。
s:mov al,[bx]
mov es:[bx],al
inc bx
loop s
mov ax,4c00h
int 21h
code ends
end