X86 instruction encoding and the hacks we do in the kernel [pdf]
events.linuxfoundation.org
events.linuxfoundation.org
http://reocities.com/SiliconValley/heights/7052/opcode.txt
If you're at all interested in the x86 architecture, it's highly recommended reading.
(This used to be one of the first search results for "x86 octal instructions". Now it's nowhere in the first 10 pages of results and searching for its link directly doesn't even cause it to appear. What happened, Google...?)
Also not helping: Reocities is a website hosting the Geocities dump Jason Scott and his merry band of guerrilla archivists made back before Yahoo killed Geocities. The point of Reocities (and Oocities, and possibly others) is to allow people to fix their old Geocities links by changing one letter in the domain name.
So it's not only obscure, it's an ancient document which has been rehosted, so none of the original links to it still work.
I think it's even more unfortunate that such gems of information are being lost not because the sites hosting them are gone, but because search engines are rendering them inaccessible despite the sites still existing. In fact with things like the Internet Archive, coming across a dead link is not so bad; not being able to know (from a simple search) that a page with such information actually exists, but just wasn't present in the results, is far worse.
This isn't the first time I've seen Google "disappear" pages still around and containing useful information, but it makes for a good example.
Edit: I didn't know Jason Scott was behind Reocities - I think he deserves another donation.
Slides:
https://www.acsac.org/2014/workshops/mmf/ThomasKittel-Code%2...
Paper:
https://www.acsac.org/2014/workshops/mmf/Thomas%20Kittel-%20...
I guess that 32bit mode could use most of the same microarchitecture and thus guarantee that during the transition period people would still buy those new chips.
Itanium was a good example of such a strategy that failed. However there might have been other reasons as well.
1: .byte 0xff, 0xca /* decl %edx */
jnz 1b
mov %%ss, %%eax /* grab SS to display */
/* Did we enter CPL0? */
mov %%cs, %%dx
testw $3, %%dx
jnz 2f
/* this part knows it's 64-bit */
2:
/* this part knows it's 32-bit */
The .byte thing is because 32-bit x86 allows two encodings for decl %edx, but the one-byte encoding got recycled for REX on 64-bit.On the other hand, I think the 16 to 32-bit extension (with the 386) was done quite well. 16 and 32-bit code can coexist, and it's even possible to use the 32-bit registers in 16-bit mode; not so with AMD64. It's not too difficult to figure out how to add 64-bit support in a more non-disruptive way, without having to do silly things like removing instructions and features that they had to reintroduce later [1][2].
[1] http://www.pagetable.com/?p=25 [2] https://en.wikipedia.org/wiki/X86-64#Differences_between_AMD...
Also, another thing begging for runtime modification is the `int` instruction (used to create an interrupt). There is literally no way to choose a random number of an interrupt to call. You're only option for that is to either do runtime modification to construct the 2 byte opcode on the fly (with the second byte being which interrupt to call), or to make a big table like `int 1; ret; int 2; ret; int 3; ret` and call into that manually. It is quite infuriating