簡體   English   中英

為什么這個為NASM編寫的“hello world”x86引導加載程序代碼在沒有[BITS 16]和[ORG 0x7C00]指令的情況下工作?

[英]Why does this 'hello world' x86 bootloader code written for NASM work without the [BITS 16] and [ORG 0x7C00] directives?

push word 0b800h
pop es
xor di, di
mov [es:di], word 441h
jmp $
times 510 - ($-$$) db 0
db 55h
db 0AAh

因為您正在編寫沒有標簽的平面二進制文件。 NASM應默認為16位。 與此相關的是您沒有尋址或標簽 - 因此無需提供[ORG ...]指令。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM