实验九.打印三行不同背景颜色的‘hello world!’
我用了两层loop循环来实现,代码如下:
assume cs:code,ss:stack
data segment
db 'hello word!'
db 02h,24h,71h
db '!'
data ends
stack segment
dw 6 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov ax,stack
mov ss,ax
mov sp,12
mov cx,3
mov bx,0
mov si,0;string index
mov di,0;segment address
mov bp,0;display code
s:
push cx
mov dl,ds:
mov cx,11
s1:
mov al,
mov es:,al
mov es:,dl
inc si
add bx,2
loop s1
mov si,0
mov bx,0
add di,0a0h
inc bp
pop cx
loop s
mov ax,4c00h
int 21h
code ends
end start
页:
[1]