Live data from Hacker News

Undocumented 8086 instructions, explained by the microcode

righto.com

51–60 of 104 posts

Re: Undocumented 8086 instructions, explained by the microcode

#51
post #37
post #15

> The undocumented C9 opcode is identical to the documented CB, far return instruction. I remember this. Once ... gosh, it's hard to believe how long ago that was now, but once I knew the entire Z80 opcode table off head. I could read the Z80 machine code and disassemble it. High school crowded that stuff out of my head, I went to a special math school, it was very very hard. Except... C9 was RET (and the Z80 is an e…

As a total aside, domain expertise is kind of amazing. Like, you can look at a string of opcodes from a processor that you haven’t touched for a decade-plus, and still recognize what’s going on. It’s important to remember that applies in all fields. That bumpkin that grew up on a farm? Sure, he might not be able to write an award-winning essay, but he could probably tell you everything you need to know about your loc…

[flagged]

Re: Undocumented 8086 instructions, explained by the microcode

#53
post #49
post #12

Earlier quoted context omitted.

When I'm done with the 8086, I might look at the 68000 but I don't have any specific plans.

Ken, before you do, you have a typo in the 5th paragraph of this post: The 80_68_'s microcode ROM

Thanks! It's fixed now.

Re: Undocumented 8086 instructions, explained by the microcode

#54
post #12
post #10

Offtopic: this is an excellent series on the 8086! Do you have plans to give a similar treatment to the Motorola 68000?

When I'm done with the 8086, I might look at the 68000 but I don't have any specific plans.

I really hope you take a look at the 68000.

I'm curious how Motorola's circuit design and approach differs from Intel's.

Re: Undocumented 8086 instructions, explained by the microcode

#55
post #15

> The undocumented C9 opcode is identical to the documented CB, far return instruction. I remember this. Once ... gosh, it's hard to believe how long ago that was now, but once I knew the entire Z80 opcode table off head. I could read the Z80 machine code and disassemble it. High school crowded that stuff out of my head, I went to a special math school, it was very very hard. Except... C9 was RET (and the Z80 is an e…

I have most of the single-byte x86 opcodes still memorised - as many others have independently discovered, it's much easier in octal. 95 ba 07 01 cd 21 c3 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 0d 0a 24

I still remember 0x90 because I still use it all the time!

Re: Undocumented 8086 instructions, explained by the microcode

#56

Although these registers are normally not accessible by the programmer, some undocumented instructions provide access to these registers, as will be described later. Reminds me of the MEMPTR on Z80: https://gist.github.com/drhelius/8497817 Also, I'm not sure if you've explored 8f/1-7 yet, since it's not mentioned in the article, but I suspect it's just the same as pop r/m16 (8f/0) as it ignores the subopcode bits com…

> It's very weird that the push and pop are in completely different places in the opcode map.

Are they? There's a lot of different opcodes for push and pop, but if I'm reading right, for a given address mode, the op code for push and pop always differs by one bit (which bit changes though)

https://www.felixcloutier.com/x86/push https://www.felixcloutier.com/x86/pop

Re: Undocumented 8086 instructions, explained by the microcode

#57
post #3

Earlier quoted context omitted.

There's a reason why every 8086 opcode matches something. If an instruction didn't match anything, I think the microcode engine would spin idle and the instruction would never terminate. (You need a RNI micro-instruction to end microcode processing.) Having your processor lock up due to a bad opcode is something that the designers presumably explicitly avoided. The 6502 on the other hand, didn't take such precautions…

Also the 6800, with its famous HCF (Halt and Catch Fire) instruction: > With the advent of the MC6800 (introduced in 1974), a design flaw was discovered by programmers. Due to incomplete opcode decoding, two illegal opcodes, 0x9D and 0xDD, will cause the program counter on the processor to increment endlessly, which locks the processor until reset. Those codes have been unofficially named HCF. During the design proce…

Also a fantastic TV series about the personal computing era of the 80's. https://www.imdb.com/title/tt2543312/

Re: Undocumented 8086 instructions, explained by the microcode

#58
post #43

Earlier quoted context omitted.

What ads? Didn't seen any ads when visiting the page. Are you browsing the web without uBlock Origin by any chance?

I see this kind of “ads? I didn’t see any ads in my ad-blocking browser!” response practically every time someone mentions ads on here. Can I ask what you’re trying to achieve? Do you think the HN audience is unaware of ad blockers?

> Do you think the HN audience is unaware of ad blockers?

Clearly some portion of the HN audience might be unaware, as they are in this thread complaining about ads.

Re: Undocumented 8086 instructions, explained by the microcode

#59
post #37

Earlier quoted context omitted.

As a total aside, domain expertise is kind of amazing. Like, you can look at a string of opcodes from a processor that you haven’t touched for a decade-plus, and still recognize what’s going on. It’s important to remember that applies in all fields. That bumpkin that grew up on a farm? Sure, he might not be able to write an award-winning essay, but he could probably tell you everything you need to know about your loc…

[flagged]

While I highly doubt the anecdote about knowing soil chemistry from smell, farmers have more knowledge and skill than you give them credit for.

Re: Undocumented 8086 instructions, explained by the microcode

#60
post #56

Although these registers are normally not accessible by the programmer, some undocumented instructions provide access to these registers, as will be described later. Reminds me of the MEMPTR on Z80: https://gist.github.com/drhelius/8497817 Also, I'm not sure if you've explored 8f/1-7 yet, since it's not mentioned in the article, but I suspect it's just the same as pop r/m16 (8f/0) as it ignores the subopcode bits com…

> It's very weird that the push and pop are in completely different places in the opcode map. Are they? There's a lot of different opcodes for push and pop, but if I'm reading right, for a given address mode, the op code for push and pop always differs by one bit (which bit changes though) https://www.felixcloutier.com/x86/push https://www.felixcloutier.com/x86/pop

He's talking about 8F/0 (pop) and FF/6 (push).
Post reply on HN