Jerfov2
Jerfov2

Reputation: 5504

Why do the bytes "0xea 0000 ffff" in a bootloader cause the computer to reboot?

I was researching boot loaders and I found this interesting piece of assembly:

;Sends us to the end of the memory
;causing reboot
db 0x0ea
dw 0x0000
dw 0xffff

By the comment I know what it does; sends the computer to the end of memory, but what I can't figure out is how those numbers reboot the computer (x86_64 processor on 16-bit mode).

Upvotes: 3

Views: 2146

Answers (2)

Michael
Michael

Reputation: 58447

Those bytes correspond to jmp word 0xffff:0000 (you can see this by assembling with NASM and then disassembling the resulting binary), which happens to be a jump to the x86 reset vector in real mode.

Upvotes: 3

Ross Ridge
Ross Ridge

Reputation: 39581

It's a far jump instruction to the old 8086 reset address. When the 8086 was reset it would start executing instructions at FFFF:0000. For compatibility reasons modern BIOS implementation have a jump to their reset code here, though reset address of modern CPUs is different.

Upvotes: 3

Related Questions