【发布时间】:2015-01-03 18:28:20
【问题描述】:
;------------------------------------------------------------
.286 ; CPU type
;------------------------------------------------------------
.model TINY ; memory of model
;---------------------- EXTERNS -----------------------------
extrn _BootMain:near ; prototype of C
func
;------------------------------------------------------------
;------------------------------------------------------------
.code
org 07x00h ; 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 main ; End of program
说实话,我复制了这段代码from here。
我自己尝试过,但 MASM 不同意。我得到的唯一错误是:
StartPoint.asm(10) : error A2206: missing operator in expression
或者:
LINK : warning L4055: start address not equal to 0x100 for /TINY
对不起,如果我在问这个问题时犯了任何错误,我是新人。
编辑:MASM 版本是 6.15,我在 cmd 中使用了 ml StartBoot.asm。语法是 ml [filename.asm]。
编辑:我打算将其编译成 .exe 文件。
【问题讨论】:
-
您应该提供准确的 MASM 版本和您使用的准确命令行参数。
-
org 07x00h中有错字 -
我修正了错字,但仍然无法编译。