How to disassemble 16-bit x86 boot sector code in GDB with “x/i $pc”? It gets treated as 32-bit
问题 For example, with a boot sector that BIOS prints a to the screen main.asm : org 0x7c00 bits 16 cli mov ax, 0x0E61 int 0x10 hlt times 510 - ($-$$) db 0 dw 0xaa55 Then: nasm -o main.img main.asm qemu-system-i386 -hda main.img -S -s & gdb -ex \'target remote localhost:1234\' \\ -ex \'break *0x7c00\' \\ -ex \'continue\' \\ -ex \'x/3i $pc\' I get: 0x7c00: cli 0x7c01: mov $0x10cd0e61,%eax 0x7c06: hlt So it looks like the mov ax, 0x0E61 was interpreted as a 32-bit mov %eax and ate up the next