别人给出的代码都是没用转移指令的 ,但本章主要讲的都是转移指令,所以我硬是把转移指令用上写了一段代码
assume cs:cd,ds:da
da segment
db 'welcome to masm!'
da ends
cd segment
start:
mov ax,0b800h
mov es,ax
mov ax,da
mov ds,ax
mov bp,0
mov dx,offset two
mov ah,00000010b
jmp short s0
two:
mov dx,offset three
mov ah,11101110b
jmp short s0
three:
mov dx,offset ok
mov ah,10101010b
s0:
mov bx,0
mov cx,16
mov si,0
s:
mov al,ds:[bx]
mov es:[bp+si+40h],ax
inc bx
add si,2
loop s
add bp,0a0h
jmp dx
ok:
mov ax,4c00h
int 21h
cd ends
end start