Re:Writing a Tiny x86 Bootloader
by mkup on Wednesday December 28, 2016 @05:22AM
(#13269652)
> A 32-bit assembler (like gas) will turn `mov %esp,%ebp` into `89 e5` while `mov %sp,%bp` becomes `66 89 e5` -- the former being correct when actually in 16-bit.
He is using nasm with "bits 16" directive, so 66 prefix will be emitted for "mov ebp,esp". gas with 32-bit target is totally unrelated to this discussion.
He is using nasm with "bits 16" directive, so 66 prefix will be emitted for "mov ebp,esp". gas with 32-bit target is totally unrelated to this discussion.
> http://wiki.osdev.org/Unreal_Mode
So what? MBR runs in 16-bit real mode.