I'm toying around with a boot sector / creating a flat binary file, and have come across some behavior I don't quite understand. For example, consider the following:
mov ax, 0x7C0
mov ds, ax
fooA db 'A'
mov ah, 0xE
mov al, [fooA]
int 0x10 ; BIOS interrupt / print "A" to screen
dw 0xFFFF
fooB db 'B'
mov ah, 0xE
mov al, [fooB]
int 0x10 ; BIOS interrupt / print "B" to screen
times 512 - ($ - $$) db 0
This prints only the "A" to the screen (not the "B"). However, if I replace "dw 0xFFFF" with a different value (such as 0x0000, or 0xEEEE), both "A" and "B" are correctly printed.
If I explicitly create a .data section for dw 0xFFFF it corrects the problem, but I thought sections were irrelevant in a flat binary file. Additionally, why do the db 'A' and db 'B' definitions work outside of a .data section? Why do some word values work (e.g. 0x0000, or 0xEEEE), while 0xFFFF doesn't?
Hopefully somebody more knowledgeable than myself understands what I'm getting at. I feel like I have a fundamental misunderstanding of something, but I'm not quite sure what it is. If anybody could clear some of this up, it would be much appreciated.
Thanks