鱼C论坛

 找回密码
 立即注册
查看: 1955|回复: 1

实验九,能正确显示,就是系统会弹出一个错误窗口

[复制链接]
发表于 2012-3-9 22:56:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
;显屏幕中间分别显示绿色、绿底红字、白底蓝字的字符串'welcome to masm'
assume cs:codesg,ds:datasg,ss:stacksg
datasg segment
db 'welcome to masm!'
db 02h,24h,71h
datasg ends
stacksg segment
dw 8 dup(0)
stacksg ends
codesg segment
start:mov ax,datasg
       mov ds,ax   
    mov ax,stacksg
    mov ss,ax
    mov sp,10h
    mov bx,0          ;颜色偏移地址
   
    mov ax,0b872h     ;第一行字符串起始段地址
    mov cx,3          ;3行循环3次
s0:push cx
    push ax
    mov si,0           ;源偏移地址
    mov di,0           ;目标偏移地址
   
    mov es,ax
    mov cx,16           ;16个字符
s: mov al,ds:[si]
    mov es:[di],al      ;字符写到目标
    mov al,ds:10h[bx]
    mov es:[di+1],al    ;这里我直接把颜色跟在字符后面了,所以直接di+1
    inc si
    add di,2
    loop s
   
    inc bx
    pop ax
    add ax,0ah
    pop cx
    loop s0  
   
   
codesg ends
end start
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
 楼主| 发表于 2012-3-9 23:08:22 | 显示全部楼层
自己debug 发现了,
漏了结束的那句话
mov ax,4c00h
int 21h
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-10-8 13:30

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表