Live data from Hacker News

Undocumented 8086 instructions, explained by the microcode

righto.com

41–50 of 104 posts

Re: Undocumented 8086 instructions, explained by the microcode

#42
post #39

Earlier quoted context omitted.

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 recognize the "hello world" and "int 21h" but, can I ask why that instruction listing seems to start with "xchg (e)ax, (e)bp"?

Saves one byte since BP is 09xx on start for MS-DOS >= 4.0. Old demoscene sizecoding trick.

Re: Undocumented 8086 instructions, explained by the microcode

#43

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.

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?

Re: Undocumented 8086 instructions, explained by the microcode

#44
post #34

Earlier quoted context omitted.

SYS 64738

In a similar vein, C000 == 49152 has been burned into my brain. I recognize it immediately, because that’s where most C64 assembly programs were loaded, followed by “SYS 49152” for loading them. A000 for example I recognize, but can’t tell you as quickly what it is in decimal as I can with C000.

That address is where cartridges would appear in memory when plugged in, which is why it became SOP to use it.

Re: Undocumented 8086 instructions, explained by the microcode

#45
post #33
post #16

Earlier quoted context omitted.

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.

Yes, absolutely. Ben Eater’s series is fantastic. If you want to learn about simple microcode and how a (non-superscalar, which matches the 8086) CPU generally works, this is a brilliant resource, and fun to watch.

His entire channel is brilliant. I also love his homemade GPU. I forget sometimes just how fast CPUs are so watching him 'race the beam' (not literally anymore, but HDMI has timings just the same) is fascinating.

Re: Undocumented 8086 instructions, explained by the microcode

#46
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…

There is a plaque with hex dump at the entrance of Computer History Museum in Mountain View, California.

I immediately recognized the opcodes on it because I knew Z80 and they were in 8080 (I don't remember seeing any ED B0 or similar Z80 extensions). 01, 11, 21, C3 and CD’s all over. I think it was either a boot loader or a BASIC ROM startup code, but not sure.

8080 probably implies Altair BASIC because there was “(C) MICROSOFT” string in the code.

Re: Undocumented 8086 instructions, explained by the microcode

#47

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?

> Where can one learn more about microcode,

Provided you can find a copy, the book "Computer Organization", 2nd ed, by V. Car Hamacher, Zvonko G. Vranesic and Safwat G. Zary, published by McGraw Hill, contains a very understandable chapter of microcode control. Depending on your background, you may want to read some of the prior chapters first before starting on the microcode one, to get some foundational knowledge.

Do note that the 2nd ed was published in 1984, so finding a copy may be difficult. I do not know how (or even if) the microcode control chapter was updated in subsequent editions.

Re: Undocumented 8086 instructions, explained by the microcode

#48

On a side note - it would be also interesting how invalid instructions detection is implemented in later processors. It's hard to imagine giant lookup table because that sounds like waste of resources.

My guess is a giant NOR gate of all the other decoder outputs.

Re: Undocumented 8086 instructions, explained by the microcode

#49
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.

Ken, before you do, you have a typo in the 5th paragraph of this post:

The 80_68_'s microcode ROM

Re: Undocumented 8086 instructions, explained by the microcode

#50
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?

It's just an expression of irritation towards people who contribute nothing of value to the discussion about the content of the article. "oh no I see ads on your site it sucks!" Erm, okay? Who cares? Install an ad blocker if it bothers you so much. It's faster than typing a comment on hn for greater pay off.
Post reply on HN