(1)补全程序 t1.asm,完成在屏幕上输出内存单元中的十进制两位数
(2)补全程序 t2.asm,完成在屏幕上输出 data 段定义的 5 个十进制两位数,数据和数据之间以空格间隔。
(3)教材实验 9(P187)
源代码:
assume ds:data, cs:code
data segment
db 'welcome to masm!' ;共16个字符
db 2H,24H,71H ;字符串属性值
data ends
data segment
db 'welcome to masm!' ;共16个字符
db 2H,24H,71H ;字符串属性值
data ends
code segment
start: mov ax,data
mov ds,ax
mov ax,0b800H
mov es,ax
mov bx,0
mov si,0
mov cx,16
start: mov ax,data
mov ds,ax
mov ax,0b800H
mov es,ax
mov bx,0
mov si,0
mov cx,16
s0: mov ax,[bx]
mov es:[bx+720h][si],ax
mov al,2 ;存放颜色属性值绿色
mov es:[bx+721h][si],al
inc bx
inc si
loop s0
mov es:[bx+720h][si],ax
mov al,2 ;存放颜色属性值绿色
mov es:[bx+721h][si],al
inc bx
inc si
loop s0
mov bx,0
mov cx,16
mov si,160
mov cx,16
mov si,160
s1: mov ax,[bx]
mov es:[bx+720h][si],ax
mov al,36 ;绿底红色
mov es:[bx+721h][si],al
inc bx
inc si
loop s1
mov es:[bx+720h][si],ax
mov al,36 ;绿底红色
mov es:[bx+721h][si],al
inc bx
inc si
loop s1
mov bx,0
mov cx,16
mov si,320
mov cx,16
mov si,320
s2: mov ax,[bx]
mov es:[bx+720h][si],ax
mov al,113 ;白底蓝色
mov es:[bx+721h][si],al
inc bx
inc si
loop s2
mov es:[bx+720h][si],ax
mov al,113 ;白底蓝色
mov es:[bx+721h][si],al
inc bx
inc si
loop s2
mov ax,4c00h
int 21h
code ends
end start
int 21h
code ends
end start