实验9
本帖最后由 13005674659 于 2019-12-27 21:40 编辑1 ; 1行显示三种模式
assume cs:a1,ds:b2
b2 segment
dw 0277h,0265h,026ch,0262h,026fh,026dh,0265h,0220h
dw 0274h,026fh,0220h,026dh,0261h,0273h,026dh,0221h ;绿色字符
dw 2477h,2465h,246ch,2462h,246fh,246dh,2465h,2420h
dw 2474h,246fh,2420h,246dh,2461h,2473h,246dh,2421h ;绿底红字
dw 7177h,7165h,716ch,7162h,716fh,716dh,7165h,7120h
dw 7174h,716fh,7120h,716dh,7161h,7173h,716dh,7121h ;白底蓝字
b2 ends
a1 segment
kaisi:mov ax,b2
mov ds,ax
mov ax,47104
mov es,ax
mov bx,0 ;绿色字符传入显示缓冲区
mov si,0
mov cx,16
s:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s
mov bx,20h ;l绿底红字传入显示缓冲区
mov si,22h
mov cx,16
s2:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s2
mov bx,40h ;白底蓝字传入显示缓冲区
mov si,44h
mov cx,16
s3:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s3
mov ax,4c00h
int 21h
a1 ends
end kaisi
2 ;3行显示三种模式
assume cs:a1,ds:b2
b2 segment
dw 0277h,0265h,026ch,0262h,026fh,026dh,0265h,0220h
dw 0274h,026fh,0220h,026dh,0261h,0273h,026dh,0221h ;绿色字符
dw 2477h,2465h,246ch,2462h,246fh,246dh,2465h,2420h
dw 2474h,246fh,2420h,246dh,2461h,2473h,246dh,2421h ;绿底红字
dw 7177h,7165h,716ch,7162h,716fh,716dh,7165h,7120h
dw 7174h,716fh,7120h,716dh,7161h,7173h,716dh,7121h ;白底蓝字
b2 ends
a1 segment
kaisi:mov ax,b2
mov ds,ax
mov ax,0b800h
mov es,ax
mov bx,0 ;绿色字符传入显示缓冲区
mov si,0a0h
mov cx,16
s:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s
mov bx,20h ;绿底红字传入显示缓冲区
mov si,140h
mov cx,16
s2:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s2
mov bx,40h ;白底蓝字传入显示缓冲区
mov si,1e0h
mov cx,16
s3:mov ax,ds:
mov es:,ax
add bx,2
add si,2
loop s3
mov ax,4c00h
int 21h
a1 ends
end kaisi
优化了一下(在屏幕中间显示)
本帖最后由 13005674659 于 2019-12-28 21:08 编辑assume cs:a1,ds:a2
a2 segment
db 'welcome to masm!'
a2 ends
a1 segment
kaisi:mov ax,a2
mov ds,ax
mov ax,0b800h
mov es,ax
mov bx,0
mov si,0
mov cx,16
mov ax,0
s:mov al,ds:
mov ah,02h
mov es:,ax
mov al,ds:
mov ah,24h
mov es:,ax
mov al,ds:
mov ah,71h
mov es:,ax
add si,2
inc bx
loop s
mov ax,4c00h
int 21h
a1 ends
end kaisi
页:
[1]