【问题标题】:explain why this code can't be assembled解释为什么这段代码不能汇编
【发布时间】:2013-08-30 15:39:18
【问题描述】:

最近,我开始学习关于汇编和计算机物理的东西,当我开始编写汇编代码时,我试图链接我正在使用的书给我的第一个程序,但每当我尝试这样做时,我都会得到以下信息错误信息:

E:\masm32\code.asm(1) : error A2008: syntax error : floating point constant
E:\masm32\code.asm(2) : error A2085: instruction or register not accepted in cur
rent CPU mode

\masm32\include\windows.inc(78) : error A2119: language type must be specified
                                 ...
\masm32\include\masm32.inc(153) : error A2119: language type must be specified
\masm32\include\masm32.inc(154) : fatal error A1012: error count exceeds 100; st
opping assembly

我在 windows xp 上使用 MASM32 以及我试图组装和链接的代码:

386.
model flat, stdcall.
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
data.
HelloWorld db "Hello World!", 0
code.
start:
invoke StdOut, addr HelloWorld
invoke ExitProcess, 0
end start

& 提前谢谢。

【问题讨论】:

    标签: assembly linker masm32


    【解决方案1】:

    您将点放置在错误的位置。他们应该给指令加前缀,而不是后缀:

    .386
    .model flat, stdcall
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-06
      • 2013-10-22
      • 2010-10-24
      • 2022-12-04
      • 1970-01-01
      • 1970-01-01
      • 2014-09-30
      相关资源
      最近更新 更多