我希望你们度过了愉快的一天。我有一个关于将程序集编译为.bin. 我正在尝试使用这篇文章来修复它,但即便如此,我还是得到了`relocated truncation to fit: 16 against '.text'。
bootReal.s :
#generate 16-bit code
.code16
#hint the assembler that here is the executable code located
.text
.globl _start;
#boot code entry
_start:
jmp _boot #jump to boot code
welcome: .asciz "Hello, World\n\r" #here we define the string
.macro mWriteString str #macro which calls a function to print a string
leaw \str, %si
call .writeStringIn
.endm
#function to print the string
.writeStringIn:
lodsb
orb %al, %al
jz .writeStringOut …Run Code Online (Sandbox Code Playgroud)