- Assembly code
assume cs:codesg,ds:datasg,ss:stacksgdatasg segment db 'Welcome to MASM!' db 00000010B,00100100B,01110001Bdatasg endsstacksg segment dw 0,0,0,0,0,0,0,0stacksg endscodesg segment start:mov ax,datasg mov ds,ax mov ax,0B85AH mov es,ax mov di,10H ;ds:[di] -> 字体属性 mov cx,3 s0:push cx mov bx,0 ;ds:[bx] -> 待显示的字符 mov si,40H ;es:[si] -> 显示缓冲区 mov cx,16 s:mov al,[bx] mov es:[si],al mov al,[di] mov es:[si+1],al inc bx add si,2 loop s inc di add si,0A0H pop cx loop s0 mov ax,4C00H int 21Hcodesg endsend start
为什么只有第三行(白底蓝字)的显示出来了…第一行和第二行都没有显示出来…
------解决方案--------------------------------------------------------
根据楼主的改了下
- Assembly code
assume cs:codesg,ds:datasg,ss:stacksgdatasg segment db 'Welcome to MASM!' db 00000010B,00100100B,01110001Bdatasg endsstacksg segment dw 0,0,0,0,0,0,0,0stacksg endscodesg segment start:mov ax,datasg mov ds,ax mov ax,0B85AH mov es,ax mov di,10H ;ds:[di] -> 字体属性 mov cx,3 mov si,40H ;es:[si] -> 显示缓冲区s0: push cx push si mov bx,0 ;ds:[bx] -> 待显示的字符 mov cx,16s: mov al,[bx] mov es:[si],al mov al,[di] mov es:[si+1],al inc bx add si,2 loop s inc di pop si add si,0A0H pop cx loop s0 mov ax,4C00H int 21Hcodesg endsend start