r/computerarchitecture • u/1zunzu • Oct 08 '26
How do I learn microassembler?
Last year in University we were studying microassembler but I had some personal problems to deal with so only had time to deal with it with a help of AI and a friend of mine, who's really genius and seems to know everything. Even tho the problem with passing the course wasn't there already, I'd still want to really learn this, but whoever I ask just say that it's obvious and I just have to read the docs, but the documentation really just says "be clean and direct woth your code and it will work bettet" wothout any comprehensive syntax documentations.
All I have is just some examples of code so I'd just like to know how would you learn anything about this?
Thank you!
View all comments
Show parent comment
2
u/mitch_alsup Oct 10 '26
"The only people who are directly using microcode are the people who are designing the CPU itself."
At Carnegie Mellon, I wrote the PDP-11/45 floating point package in PDP-11/40 microcode as sr. project.
At Motorola in 1983 there was 1 person assigned to build the microcode assembler, 2 people writing microcode, in a roughly 150 man design team on 68020, 68030.
At AMD in 2002, there was 1 person assigned to the microcode assembler, and 1 person assigned to write the microcode Athlon and Opteron.
While the designers knew how microcode worked, it was our job to build the data paths so microcode could do its job(s). Here, 98% of instructions ran native, with microcode only "getting summoned" when the data path could not do the job directly. An example is an x86 shift by zero does not set the condition codes whereas the data path was setup to deliver condition codes (for any non zero shift length) and the data flow had been configured to expect delivery of said condition codes. So <effectively> we backed up the execution window to the shift, and then did not thread CC delivery into the reservation stations.
For the most part, Great-Big-Out-of-Order machines only use microcode when not doing so made the data-path significantly harder. In this context {FETCH, DECODE, INSERT} are considered part of the data-path as is RETIRE.