【发布时间】:2013-11-05 05:14:17
【问题描述】:
下面是我想了解的汇编代码。这段代码用 nasm 组装后如何填充 512 字节?
因为我还不清楚510-($-$$)在这里做的意思?根据下面的代码,$ 和 $$ 的值是多少?
http://www.brokenthorn.com/Resources/OSDev3.html
;***************************
org 0x7c00 ; We are loaded by BIOS at 0x7C00
bits 16 ; We are still in 16 bit Real Mode
Start:
cli ; Clear all Interrupts
hlt ; halt the system
times 510 - ($-$$) db 0 ; We have to be 512 bytes. Clear the rest of the bytes with 0
dw 0xAA55 ; Boot Signature
;*********************
【问题讨论】:
标签: assembly x86 nasm bootloader