I am working on the command parser for my monitor. A few here have suggested single letter commands, which would definitely be much easier, but I'd rather have the learning experience of using actual words.
Ok, the way I'm leaning is to have all the commands stored in ROM, all NULL terminated. I will have the user type in a command (let's ignore the possibility of command arguments for now), and the program will compare each command to the typed command until there is a match. I thought about having it be smart enough to use alphabetical order in order to not compare more commands then necessary, instead of brute force, but I don't think I'll have enough commands to make that kinda thing needed. Maybe later just for the exercise of it.
I want to have an array of addresses that I can index through, that contains the address of each of the commands. That is how I figure I can navigate a list of strings of varying length.
There lies my question. I can put such a list in ROM, but my understanding is there is no way to use indirection if the pointers are anywhere other than 0 page. Does this suggest that part of my reset routine should be to load an array in 0 page from ROM? It seems inefficient to have the same data in two places at once (the original in ROM, and the copy in 0 page), but I can't see another way.
Is this the way?