任务:将beg_copy到end_copy的代码复制到0:200H处
assume cs:codeseg
codeseg segment
start:
...
beg_copy:
mov ax, 0
add ax, ax
wait
end_copy: nop
codeseg ends
end start
参考解答:
assume cs:codeseg
codeseg segment
start:
mov ax, cs
mov ds, ax
mov si, offset beg_copy
mov ax, 0
mov es, ax
mov di, 200H
mov bx, offset end_copy
copy: cmp si, bx
jnb stop_copy
mov al, [si]
mov es:[di], al
inc si
inc di
jmp copy
stop_copy:
mov ax, 4c00h
int 21h
beg_copy:
mov ax, 0
add ax, ax
wait
end_copy: nop
codeseg ends
end start