汇编实验 9,小甲鱼版本!
assume cs:code,ds:data,ss:stackdata segment
db 'welcome to masm!'
db 02H,24H,71H
data ends
stack segment
dd 4 dup(0)
stack ends
code segment
main:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10H
xor bx,bx
mov ax,0B872H
mov cx,3H
s3:push cx;保存循环次数
push ax;保存彩屏写入的地址
push bx;保存BX的数值
mov es,ax;
mov si,0
mov di,0
mov cx,10H
s1:mov al,ds:;把文字复制到彩屏内存
mov es:,al
inc si
add di,2H
loop s1
mov di,1
pop bx
mov al,ds:;设置文字颜色
inc bx
mov cx,10H
s2:mov es:,al
add di,2H
loop s2
pop ax
add ax,0AH
pop cx
loop s3
mov ax,4C00H
int 21H
code ends
end main
页:
[1]