gpt4 book ai didi

masm - 错误 A2105 : Expected : instruction or directive Assembly

转载 作者:行者123 更新时间:2023-12-05 07:59:38 25 4
gpt4 key购买 nike

我正在使用 MASM 制作一个简单的消息程序。目前我在 Windows 8 64 位上运行 DOSBOX。我有一个文件夹 8086,其中包含 DEBUG、BIN2HEX、EDIT、EXE2BIN、LINK、MASM、TASM 和 TD 可执行文件。 MASM 不同于 ML 命令。

回到我的问题,当我尝试使用 masm Hello.asm 时。我收到了 Error A2105 : Expected : instruction or directive。我在我的代码中使用了一些指令。

你好.asm

.386
.model flat, stdcall
option casemap: none

extrn MessageBoxA@16 : PROC
extrn ExitProcess@4 : PROC

.data
HelloWorld db "Welcome to Assembly Language!", 0
MsgTitle db "Our First MessageBox", 0
.code
start:

mov eax,0
push eax
lea ebx , MsgTitle
push ebx
lea ebx, HelloWorld
push ebx
push eax
call MessageBoxA@16
push eax
call ExitProcess@4

end start

我不知道如何从这个 asm 中创建 OBJ、LST、CRF。所以我只是跳过它们。

Object filenam [hello.OBJ] :
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
hello.asm(3): error 2105 : Expected : instruction or directive

最佳答案

我不知道 MASM 但从错误消息中可以清楚地看出汇编器没有考虑这一行

option casemap: none

作为有效的指令或指令。所以你应该检查你是否使用了正确的格式。也许您需要删除分号后的空格。在任何情况下,您都可以简单地将其从程序中删除以编译代码。

关于masm - 错误 A2105 : Expected : instruction or directive Assembly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21059119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com