|Re: WP34S Program Labels|
Message #9 Posted by Paul Dale on 28 July 2011, 7:10 p.m.,
in response to message #8 by M. Joury
You will want to look in xeq.c for the instruction decode and execute xeq() is the function that handles all command execution. Both user commands from the keyboard and programs go through here -- keyboard commands are converted to op-codes (in keys.c). If we're in program mode, they are stored and if not, they are executed. This is another thing I'd do differently, I'd have the command tables have a flag to decide if something is stored or executed in program mode -- there are specially coded exceptions for CLP, CLALL and DELp.
As for increment and decrement of the PC, inc() and dec() again in xeq.c Be very very careful with these, they are fragile beyond belief but don't appear to be.
I don't know the compiler, Marcus handles that aspect now.
Strings and numbers could benefit from longer op-codes. I've a disabled command that appends three characters to alpha but no keyboard interface for it. I have a good idea how to do the same for numbers but again no real idea how to present this to the user.
Better than packing keystrokes would be to store the compiled number and strings directly -- this is greatly complicated by integer and real modes however.
The next iteration (with a different model number) will likely address all this and more. Don't hold your breath waiting :-)