Live data from Hacker News

Undocumented 8086 instructions, explained by the microcode

righto.com

11–20 of 104 posts

Re: Undocumented 8086 instructions, explained by the microcode

#13

Where can one learn more about microcode, how it's implemented in silicon? As I understand it most machine code is actually "VM bytecode", and the "real" cpu is the microcode processor?

A computer architecture book such as Hennessy and Patterson will describe microcode in detail.

It's a bit confusing because microcode has changed meaning a bit over time. "Classical" microcode, such as the 8086, replaces hard-wired control logic with micro-instructions. The processor steps through the appropriate micro-instructions, which are decoded to generate control signals.

The Pentium Pro introduced a new model, where machine instructions are broken down into independent micro-ops, which are handed off to the core processor engine and processed independently, in parallel. At the end, the micro-ops are "retired" in a sequential order, so your program appears sequential.

Most micro-ops are generated by decoders that convert a machine instruction into a small number of micro-ops. However, complicated machine instructions are converted into micro-ops by microcode. This is similar to classical microcode, except it's not executing micro-instructions but generating micro-ops that then get run by the underlying processor.

Re: Undocumented 8086 instructions, explained by the microcode

#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 extension of the Intel 8080). That has burned into me so deep I still remember, across more than 35 years. I will be 30 ;) years old in two weeks.

Re: Undocumented 8086 instructions, explained by the microcode

#16

Where can one learn more about microcode, how it's implemented in silicon? As I understand it most machine code is actually "VM bytecode", and the "real" cpu is the microcode processor?

Ben Eater on YouTube has recreated an 8-bit computer on breadboards.

https://www.youtube.com/watch?v=dXdoim96v5A

That is the start of the videos where the control logic gets microcoded. Its pretty basic but over the next few videos he comes up with about 10 different OPCODES and programs their microcode (a series of control logic activations). Its pretty amazing to see it all come together and work in the end.

Re: Undocumented 8086 instructions, explained by the microcode

#17

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 am always amazed how many tech orientated people don't use any kind of ad blocking

Having AdBlock extension, but like all my extensions also have "This can read and change site data > when you click the extension" while turn on to any domain that "misbehave" with sticky ads, videos or whatever annoying flashing things. Otherwise I'm just hurting content creators for no good reason. I would not enable an extension on any domain i input my email, password, or otherwise have sensitive private information.

Re: Undocumented 8086 instructions, explained by the microcode

#18
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'm the same with LDA immediate = A9 in 6502 machine code, from my C64 days. It's disturbing how strongly burned-in those neurons are ...

Re: Undocumented 8086 instructions, explained by the microcode

#19

Aside: If you are writing stuff this good (and this niche) I would say ditch the ads. They really will turn off the audience you want to attract. Or at least use one of the developer-focused ad networks that just inline ads not pop them up.

I’m on iOS and the ad was unobtrusive. I’m very happy to support Ken. Unless the ads are more disruptive on other platforms I’d say leave ‘em in.

Re: Undocumented 8086 instructions, explained by the microcode

#20
Based on AAM using CORD for the division operation will D4 00 generate the same division by zero error as a DIV with a zero divisor? (I can’t think of any reason this would be useful but I do like thinking about edge cases and how things break.)
Post reply on HN