鱼C论坛

 找回密码
 立即注册
查看: 2732|回复: 2

编译显示寄存器使用非法,怎么搞?头都大了

[复制链接]
发表于 2012-4-19 16:17:47 | 显示全部楼层 |阅读模式

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

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

x
assume cs:codesg ds:data es:stack
data segment
  db 'My name is huangchendong!'
  db 'WELLCOME TO MASM!        '
data ends
stack segment
  db 16 dup (0)
stack ends
codesg segment
start:
  mov ax,data
  mov ds:ax
  mov ax,stack
  mov ss,ax
  mov ax,0bf80h
  mov es,ax

  mov cx,2
  mov si,0
  mov di,0
  mov ax,0
s:push cx
  mov cx,25
b:mov al,ds:[si]
  mov es:[di],al
  mov byte ptr es:[di+1],1ah
  inc si
  add di,2
  loop b
   
  add si,6fh
  add di,6fh
  pop cx
  loop s
  mov ax,4c00h
  int 21h
codesg ends
end start
  能告诉我错在哪里ma ?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
 楼主| 发表于 2012-4-19 16:35:35 | 显示全部楼层
++没人看额,不过我明白了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
 楼主| 发表于 2012-4-19 16:48:35 | 显示全部楼层
纠正后的答案:assume cs:codesg ds:data es:stack
data segment
  db 'My name is huangchendong!'
  db 'WELLCOME TO MASM!        '
data ends
stack segment
  db 16 dup (0)
stack ends
codesg segment
start:
  mov ax,data
  mov ds,ax
  mov ax,stack
  mov ss,ax
  mov ax,0b8b4h
  mov es,ax

  mov cx,2
  mov si,0
  mov di,0
  mov ax,0
s:push cx
  mov cx,25
b:mov al,ds:[si]
  mov es:[di],al
  mov byte ptr es:[di+1],1ah
  inc si
  add di,2
  loop b
   
  add di,6eh
  pop cx
  loop s
x:mov ax,0
  jmp short x

codesg ends
end start
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-10-8 10:58

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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