回 帖 发 新 帖 刷新版面

主题:一个不能运行的汇编语言程序

各位好,初学汇编,遇到问题请教:

1、操作系统:WINDOWS XP HOME EDITION +SP2

2、汇编环境:MASM32 VERSION 8.2

3、源程序来源:
   是百度搜索到的别人的简单屏打程序:
   
   data segment
   string db "hello world$" 
   data ends 

   code segment 

   assume cs:code,ds:data 

   start proc 
   mov ax,seg string 
   mov ds,ax 

   mov dx,offset string 
   mov ah,09h 
   int 21h 

   mov ax,4c00h 
   int 21h 
   start endp 
   code ends 

   end start

4、在MASM32的QEDITOR界面粘贴以上源程序,保存为 hello.asm ,并运行PROJECT下拉菜单中的ASSEMBLE&LINK选项后提示以下内容:
    Assembling: C:\hello.asm
C:\hello.asm(10) : error A2004: symbol type conflict
C:\hello.asm(22) : warning A4023: with /coff switch, leading underscore required for start address : start

5、提示出错的第10行内容为:mov ax,seg string
   提示出错的第22行内容为:end start

6、我的问题:为什么这个程序不能运行,是运行环境有问题还是源程序有问题?

谢谢。

回复列表 (共2个回复)

沙发

这样的代码只能在实模式下运行。

板凳

不要用MASM32,用TASM

我来回复

您尚未登录,请登录后再回复。点此登录或注册