error A2008: syntax error :
error A2008: syntax error :
我正在尝试为我正在开发的 OS 编写引导加载程序。
第一行出现语法错误。
这是我的汇编代码:
.286 ; CPU Type
.model TINY ; memory of model
;---------------------- EXTERNS -----------------------------
extrn _BootMain:near ; prototype of C func
;------------------------------------------------------------
;------------------------------------------------------------
.code
org 07c00h ; for BootSector
_main:
jmp short _start ; go to main
nop
;----------------------- CODE SEGMENT -----------------------
_start:
cli
mov ax,cs ; Setup segment registers
mov ds,ax ; Make DS correct
mov es,ax ; Make ES correct
mov ss,ax ; Make SS correct
mov bp,7c00h
mov sp,7c00h ; Setup a stack
sti
; start the program
call _BootMain
ret
END _start
END _main ; End of program
这是我的编译行:
"*location*.10.25017\bin\HostX86\x86\ML.EXE" /c StartPoint.asm
我遇到的错误:
StartPoint.asm(1): error A2008: syntax error : .
据我所知,这条线应该没有问题。
感谢您的帮助:)
正如@Michael Petch 在评论中建议的那样,使用旧版本的 MASM(在我的例子中是 6.15),并且有效。
请注意,如果您在项目中使用 C/CPP 代码并打算将它们与程序集文件链接(就像我所做的那样),您还需要降级 C 编译器。在我的例子中,我将它从 CL (Microsoft C/C++ Optimizing Compiler Version 19.10.25017) 更改为 dmc.
我正在尝试为我正在开发的 OS 编写引导加载程序。
第一行出现语法错误。
这是我的汇编代码:
.286 ; CPU Type
.model TINY ; memory of model
;---------------------- EXTERNS -----------------------------
extrn _BootMain:near ; prototype of C func
;------------------------------------------------------------
;------------------------------------------------------------
.code
org 07c00h ; for BootSector
_main:
jmp short _start ; go to main
nop
;----------------------- CODE SEGMENT -----------------------
_start:
cli
mov ax,cs ; Setup segment registers
mov ds,ax ; Make DS correct
mov es,ax ; Make ES correct
mov ss,ax ; Make SS correct
mov bp,7c00h
mov sp,7c00h ; Setup a stack
sti
; start the program
call _BootMain
ret
END _start
END _main ; End of program
这是我的编译行:
"*location*.10.25017\bin\HostX86\x86\ML.EXE" /c StartPoint.asm
我遇到的错误:
StartPoint.asm(1): error A2008: syntax error : .
据我所知,这条线应该没有问题。
感谢您的帮助:)
正如@Michael Petch 在评论中建议的那样,使用旧版本的 MASM(在我的例子中是 6.15),并且有效。
请注意,如果您在项目中使用 C/CPP 代码并打算将它们与程序集文件链接(就像我所做的那样),您还需要降级 C 编译器。在我的例子中,我将它从 CL (Microsoft C/C++ Optimizing Compiler Version 19.10.25017) 更改为 dmc.