Question

I'm just touching the surface of the x86 instruction set after a long period of high level programming. It's been about 20 years I had my first read on x86 assembly programming and from my googlings I get just lost with the myriad of instruction set references; from ones that mix new generations of processors (286, 386, 486...) to others that add newer x86 instructions. Not to mention the AMD variations.

Since I'm planning on building a boot loader, my first thought was to be fully compliant with 'standard x86' but I can't figure out where in time it is or even if it exists anywhere.

Even Intel documentation seems follow the same path and like another one said, 'we need a x86 instruction set standardisation, the evolution of opcodes is chaotic'.

It's not my idea to hold the standardization banner. I just want to see the road and understand where is the safe place to walk. If anyone could help I'd appreciate a lot!

Was it helpful?

Solution

Historically, x86 has been very backward compatible. x86-64 has thrown away some very old instructions (like BCD instructions) but it's unlikely that these kind of changes are going to happen again (at least not until something huge as 64 bit address space transition happens).

If you want to ensure your code works on virtually all x86 processors out there, stick to the 386 instruction set (if your code is 32-bit) or early x86-64 instruction set (if it's 64-bit).

OTHER TIPS

Boot loader executes in 16-bit real mode (although you do have access to 32-bit registers via the operand size prefix). Get a 386 instruction reference, and you'll be safe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top