王爽汇编语言实验9 自己独立完成

来源:互联网 发布:做淘宝被监督管理局查 编辑:程序博客网 时间:2024/05/17 03:17
 
assume cs:codesg,ds:datasg
datasg segment
db 'welcome to masm!'
datasg ends
codesg segment
 start:
 mov ax,datasg
 mov ds,ax    ;设置ds数据区
 
 mov ax,0b800h
 mov es,ax    ;设置缓冲区段地址
 
 mov cx,16    ;循环次数
 
 mov bx,0    ;控制数据区的数据
 
 ;mov si,0780h  ;  设置显示缓冲区的偏移地址的起始地址
 mov di,0
 
 s:
 mov al,ds:[bx]  ;低地址存放数据
 mov ah,2h ;高地址存放属性 3h=0000 0010b 绿色字
 mov es:7a8h[di],ax    ;存入第12行  160*12=1920=780h
 mov al,ds:[bx]  ;低地址存放数据
 mov ah,34h ;高地址存放属性 34h=0010 0100b 碌底红色字
 mov es:7a8h[0a0h+di],ax  ;存入第十三行 每行160字节160=0a0h
 mov al,ds:[bx]  ;低地址存放数据
 mov ah,71h  ;高地址存放属性 71h=0111 0001b  白底蓝字
 mov es:7a8h[140h+di],ax
 add di,2
 inc bx
 loop s
 mov ax,4c00h
 int 21h
codesg ends
end start
0 0
原创粉丝点击