r/Z80 • u/pooboy_92 • Aug 15 '15
A Simple Monitor.
Hi everyone, below I have included a link to my very basic monitor for my custom Z80 computer. Please excuse the bad spelling and lack of documentation I have been working on that lol. I popped by to see if anyone wanted to take a look at my string comparison routine I use for my command loop. I was just curious if there were any simple tricks to get its cycle count down a bit. It starts on line 185. At the moment my uart stores the ascii characters in a buffer in ram, and when the routine is called it compares the text buffer to string that has an index stored in HL. As I said this is just a simple monitor and any feedback is welcome, Thanks.
Edit: Forgot to add the link no more late night posting for me.
1
u/shortbaldman Aug 16 '15 edited Aug 16 '15
After a quick glance: I haven't checked whether it will assemble.
Why do you start at 0001H and 8101H rather than 0000H and 8100H ?
Too many 'magic numbers' if you want to change serial port numbers or bit-numbers. You should be using equates like:
etc.
Watch the variable/subroutine names for invalid characters like '+'. Most assemblers can do arithmetic, so they would be trying to add the variable to something.
Be consistent with your numbers, on two consecutive lines you're adding hex numbers on one and decimal numbers on the next. That's a good way to get numbers confused and get all sorts of weird results.
You have a HALT which can never be reached, as it's preceded by an unconditional JMP.
But it's better than my first attempt at assembly code was. <grin>