
Undocumented 8086 Opcodes, Part I - beefhash
http://www.os2museum.com/wp/undocumented-8086-opcodes-part-i/
======
tinus_hn
If you’re interested in this, check out the Visual 6502 project that shows
where these codes come from, but on the 6502.

Unfortunately they don’t have good enough die shots for the 8086 yet.

[http://visual6502.org](http://visual6502.org)

------
jakear
Could anyone explain why POP CS is so "obviously useless"? The author says it
is "as obvious as it is useless", and never explains further.

As far as I can understand, CS is the top byte of the 16-bit instruction
pointer, so sure you wouldn't want to go around changing just that byte. But I
feel like I'm missing something because that doesn't seem too crazy out of
this world useless to get such a special mention.

~~~
cdumler
Execution occurs with two registers, Code Segment and Instruction Pointer.
Normally, you use other operation codes (JMP, CALL, etc) because they will
take into account modifying IP or CS:IP, as appropriate. It would be a really
odd situation where you would change the CS, not update IP, and have the
proper alignment where it can execute the next instruction. Normally, all of
that is computed by the compiler/linker and executed with proper operation
codes.

The 8086 is a weird beast where the memory access is two 16 bit values mapped
to 20 bits (ie. 1 megabyte into overlapping 64k blocks offset by 16 bytes each
time). It was easier to write code staying inside a single segment, so chunks
of code were often written staying inside one. Nothing particularly useful
comes to mind just updating CS; but, my assembly days were a long time ago.

------
Sniffnoy
Hm, seems to just be part 1 so far...

Edit: This seems to be an earlier, less detailed post on the same subject, but
which does mention one or two things this post doesn't:
[http://www.os2museum.com/wp/undocumented-8086-opcodes/](http://www.os2museum.com/wp/undocumented-8086-opcodes/)

------
exikyut
Can someone tell me why almost every time I visit this site I get 403-blocked?

Very occasionally it works, but only very occasionally.

This is the first time I've loaded the site from a HN story (most visits were
from searches); maybe it's overload, it might not be.

~~~
lathiat
Blocked for me too.. I'm coming from Australia on my home static IP. Weird.

~~~
exikyut
I'm in Australia too, incidentally. Interesting.

