首页 > 代码库 > 王爽汇编实验九

王爽汇编实验九

 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,data10                 mov ds,ax;定义数据段11 12                 mov ax,0B800h13                 mov es,ax;定义显示段14 15                 mov cx,1616                 mov si,017                 mov di,10*160+80 ;将输出显示放在第10行中间18 19 s:20                 mov al,[si]21                 mov ah,2  ;绿色22                 mov es:[di],ax23 24                 inc si25                 add di,226 27 loop s28 29                 mov cx,1630                 mov si,031                 mov di,11*160+80 ;将输出显示放在第11行中间32 33 s1:34                 mov al,[si]35                 mov ah,00100100B ;绿底红色36                 mov es:[di],ax37 38                 inc si39                 add di,240 41 loop s142 43                 mov cx,1644                 mov si,045                 mov di,12*160+80 ;将输出显示放在第12行中间46 47 s2:48                 mov al,[si]49                 50                 mov ah,01110001B ;白底蓝色51                 mov es:[di],ax52 53                 inc si54                 add di,255 56 loop s257 58 MOV AX,4C00H59 INT 21H60 61 CODE ENDS62 END start ;第n行是n*160,一行有80个字符,160个字节