首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 汇编语言 >

小弟我用masm9.0编译helloworld 出错 error A2004:symbol type conflict怎么处理

2012-02-11 
我用masm9.0编译helloworld出错 error A2004:symbol type conflict怎么办helloworld代码如下Assembly code

我用masm9.0编译helloworld 出错 error A2004:symbol type conflict怎么办
helloworld代码如下

Assembly code
data segmentmsg db 'hello world$'data endscode segmentassume ds:data, cs:code_start:mov ax,datamov ds, axlea dx, msgmov ah, 09hint 21hmov ah, 4chint 21hcode endsend _start


C:\Users\z\desktop>ml hello.asm
Microsoft (R) Macro Assembler Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

 Assembling: h.asm
h.asm(8) : error A2004:symbol type conflict

C:\Users\z\desktop>

[解决办法]
出现问题的是: mov ax,data
masm9.0是32位的,你的代码是16位的
你去下个masm5.0 就没问题啦!
[解决办法]
下个masm5.0
masm hello.asm
link hello.obj
[解决办法]
用MASM5.0试试看,程序本身没有问题。
[解决办法]
MASM9是编Windows程序的,你写的是DOS程序,要用MASM6及以下版本。
[解决办法]
最前面加个
.8086
.model compact
对这些有需要,先把masm的帮助文档略一遍吧。

热点排行