[Coco] Pop PC with empty stack?

William Astle lost at l-w.ca
Tue Apr 6 23:56:18 EDT 2010


Arthur Flexser wrote:
> In fairness to the author, the source code may be extremely well commented,
> for all we know, and readily understandable by the author and others.  It's
> hardly fair to expect assembler to be written in such a way as to be easy to
> follow when someone without access to the source disassembles it.

Allow me to second that sentiment. Any assembly code that is written 
with anything resembling efficiency in mind is going to be nearly 
incomprehensible without a lot of brain work when looking at a 
disassembly. This is especially the case when some of the more obscure 
optimizations are used. (Using "leax ,y" instead of "tfr y,x", for 
instance, and then relying on leax setting the zero flag. Or "leax ,x" 
as a quick and dirty "test X for zero".)

Speaking as a somewhat experienced assembly programmer, much of the code 
I've written is exceedingly unclear when looking at the disassembly. 
However, the original source code for that same thing is very clear. I 
usually have a running commentary down the right hand side of the 
source, describing the purpose of each line along with headers in front 
of more complex blocks. It's amazing what that can do for comprehensibility.

Additionally, in assembly, one does not have any tools to make code the 
object code "clear". It is quite reasonable to see the "rts" only after 
half a dozen or more branches when non-trivial things are happening.

-- 
William Astle
lost at l-w.ca



More information about the Coco mailing list