4 ms·
you'd expect C to do a lot better in the line-count department You would but it's worth keeping in mind this implementation is constrained by closely following
by pvg 7y ago
you'd expect C to do a lot better in the line-count department
You would but it's worth keeping in mind this implementation is constrained by closely following the structure and logic of the original. It's like writing C but being told exactly what state you have to maintain (and where), down to the bit, in advance. It really is a 'hardware simulator' where the spec and input handed to you is the sequence of memory states (and a few other bits) of the original machine.
- loadzero 7y agoYes, I would say that those constraints are the main factor in not compacting the code further. The C version also loses a few lines here and there for function prototypes and structured control flow. Handwritten 8085 can be quite compact in some places due to sharing code fragments. It's a bit like self ROP.
- deleted 7y ago[deleted]