Re:Don Lancaster's Guru's Lair Home Page
by ddingus on Wednesday March 03, 2021 @06:27PM
(#26336328)
I generally agree with all of that.
The Lancaster way mentioned here is great for writing assembly code, and learning.
If one is maintaining assembly code, or authoring it, the derivative ideas remain solid today, particularly on smaller or simpler CPUs.
I was on a compiler team at Sycor writing a compiler that took a language like PL/M and produced 8085 code. It produced relocatable object files and a listing that was annotated with comments generated by the compiler. Additionally, the listing would include the number of CPU cycles each basic block. This was useful to the developers, who were all assembly language programmers getting used to writing in a higher-level language.
As they started to use the compiler they would often come to my desk pointing out incorrectly generated code. We would sit down and go through the code. Usually, about 3/4 of the way through the suspicious section, they would say "wait--this is correct. But the code is so wacky". We would point out that it is faster than a more standard way. Our boss would tell us "A compiler should generate code that an assembly language programmer should be fired for writing."