Live data from Hacker News

Undocumented 8086 instructions, explained by the microcode

righto.com

31–40 of 104 posts

Re: Undocumented 8086 instructions, explained by the microcode

#31

Earlier quoted context omitted.

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 informat…

That’s why Safari has content blocker extensions. Those cannot read the content or do network requests, they can only block content.

I use 1Blocker. It’s made of several extensions, only one or two non-essential ones that are not pure content blockers (and so can read the site), and which I have turned off, with still very good results.

Re: Undocumented 8086 instructions, explained by the microcode

#32
post #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…

I wouldn't recommend anything from Hennessy and Patterson for learning about microcode; they are entirely RISC proponents, after all. Instead, books and articles from 50s-70s on computer design are probably far more detailed and relevant.

Re: Undocumented 8086 instructions, explained by the microcode

#33
post #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.

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.

Re: Undocumented 8086 instructions, explained by the microcode

#34
post #18

Earlier quoted context omitted.

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

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.

Re: Undocumented 8086 instructions, explained by the microcode

#35
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 completely. It's very weird that the push and pop are in completely different places in the opcode map.

Re: Undocumented 8086 instructions, explained by the microcode

#36

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.

> They really will turn off the audience you want to attract.

I disagree. The vast majority of the internet doesn’t care, because it’s the internet and this is normal.

The types of readers who will read a blog post and critique the author for things unrelated to the content of the blog (such as the presence of ads) are generally not a great audience to cultivate, and definitely not a great vocal minority to cater to.

There are numerous examples of YouTubers being hesitant to turn on ads in their early days because they think it will drive away potential subscribers and drive down view counts. Then they turn them on eventually, growth continues exactly as before, and their only regret is not turning them on sooner.

Be careful not to mistake the vocal minority’s complaints as a common concern.

Re: Undocumented 8086 instructions, explained by the microcode

#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 local soil chemistry and it’s suitability for various crops just by smelling it.

Re: Undocumented 8086 instructions, explained by the microcode

#38

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.

>2023

>even being able to tell that a website has ads

Wew

Re: Undocumented 8086 instructions, explained by the microcode

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

Re: Undocumented 8086 instructions, explained by the microcode

#40
post #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 ...

[deleted]
Post reply on HN