I have a dump from a hard-disk which has aa55 at offset 510. But the places where I have read about it says it is 55aa in dump.
000001fe: aa55
So, I'm wondering if the data is stored in big-endian or little-endian on my disk?
Thanks
I have a dump from a hard-disk which has aa55 at offset 510. But the places where I have read about it says it is 55aa in dump.
000001fe: aa55
So, I'm wondering if the data is stored in big-endian or little-endian on my disk?
Thanks
It's 0xaa55
as a little-endian 16-bit word, so it's 55
then aa
if you look at the bytes separately. i.e. db 0x55, 0xaa
This indicates that the first sector (512 bytes) of the disk is a bootable MBR boot sector that can be loaded at linear address 0x7c00
and executed in real mode.
Wikipedia confirms this layout: https://en.wikipedia.org/wiki/Master_boot_record#Sector_layout
From 2 recent SO questions that have sources for boot sectors in ASM:
AT&T syntax: How to handle keyboard in real mode through BIOS interrupts?
.org 510
.word 0xaa55
NASM: Assembly 32-bit print to display code runs on qemu, fails to work on real hardware
TIMES 510-($-$$) db 0
dw 0xaa55
These are x86 assemblers, so they of course assemble 16-bit integers to x86's little-endian.