assume cs:code
code segment
start:
;int 0
;mov ax, 4c00h
;int 21h
mov ax, cs
mov ds, ax
mov si, offset p1
mov ax, 0
mov es, ax
mov di, 200h
mov cx, offset p1end - offset p1
cld
rep movsb
mov ax, 0
mov es, ax
mov word ptr es:[0 * 4], 200h
mov word ptr es:[0 * 4 + 2], 0
mov ax, 4c00h
int 21h
p1:
jmp short p2
db 'ERROR!'
p2:
mov ax, cs
mov ds, ax
mov si, 202h
mov ax, 0b800h
mov es, ax
mov di, 2 * 160 + 0 * 2
mov cx, 6
show:
push cx
mov cl, 1010b
mov al, [si]
mov es:[di], al
mov es:[di + 1], cl
inc si
inc di ;这两个inc改成add di,2就没有事了。可以正常运行!
inc di ;
pop cx
loop show
iret ; 中断返回
p1end:
nop
code ends
end start
|