I'm writing a bootsector, let's say for "educational" purposes. The following works (GAS syntax warning):
Code: Select all
.set PARTITION_TABLE_OFFSET, 0x1be
...some code here...
. = PARTITION_TABLE_OFFSET
_P1_Boot_Indicator: .byte 0
_P1_Start_Head: .byte 0
...
So far, so good.
However, for aesthetic reasons (think hexdump), I would like my data not to be directly after the code, but rather directly in front of the partition table. So, after the last code line, I'd like to skip:
Code: Select all
.set PARTITION_TABLE_OFFSET, 0x1be
...some code here...
. = PARTITION_TABLE_OFFSET - ( PARTITION_TABLE_OFFSET - DATA_START )
DATA_START:
MESSAGE: .asciz "Ready\n\r"
PANIC_MSG: .asciz "PANIC\n\r"
LBA_OVERRIDE: .byte 0
BOOTDEVICE: .byte 0xff
. = PARTITION_TABLE_OFFSET
_P1_Boot_Indicator: .byte 0
_P1_Start_Head: .byte 0
...
I know how I could make a workaround, but I'd like to know (since the purpose is educational anyhow): Is there a way to do such "backwards" positioning at all? Can I make my assembler to place some data in such a way that it ends at a known address?
Help appreciated.