1 ;实验九 2 assume cs:code,ds:data 3 data segment 4 db 'welcome to masm!' 5 data ends 6 7 code segment 8 start : 9 mov ax,data 10 mov ds,ax;定义数据段 11 12 mov ax,0B800h 13 mov es,ax;定义显示段 14 15 mov cx,16 16 mov si,0 17 mov di,10*160+80 ;将输出显示放在第10行中间 18 19 s: 20 mov al,[si] 21 mov ah,2 ;绿色 22 mov es:[di],ax 23 24 inc si 25 add di,2 26 27 loop s 28 29 mov cx,16 30 mov si,0 31 mov di,11*160+80 ;将输出显示放在第11行中间 32 33 s1: 34 mov al,[si] 35 mov ah,00100100B ;绿底红色 36 mov es:[di],ax 37 38 inc si 39 add di,2 40 41 loop s1 42 43 mov cx,16 44 mov si,0 45 mov di,12*160+80 ;将输出显示放在第12行中间 46 47 s2: 48 mov al,[si] 49 50 mov ah,01110001B ;白底蓝色 51 mov es:[di],ax 52 53 inc si 54 add di,2 55 56 loop s2 57 58 MOV AX,4C00H 59 INT 21H 60 61 CODE ENDS 62 END start ;第n行是n*160,一行有80个字符,160个字节