A question on port methods

That's an impressive project Nick. You are also right about the memory overhead from use of the libraries. I compiled the sketch several times to make sure I don't generate too many errors. Even after adding extra lines of code, the memory usage stayed the same at 550 bytes of flash and 9 bytes of SRAM. I'm converting 8051 assembly language into Arduino C language. I'm sure I will be adding some delays because my 8051 is much slower than the ATmega328 in my Arduino Uno. I'm not expecting too much extra code for the delays. When I complete it I hope it works without too much debugging.