Exact match. Not showing close matches.
'[PIC] good examples of command lineinterpreter sou'
The token or hash can be calculated in the buffer filling receive
interrupt routine so that when the CR is received, the command
interpereter doesn't have to compare every character with possible
commands, but only a token. For longish commands and many commands this
would speed up interpretation.
A K" wrote:
Olin would know best, but I don't think this is what he's talking about. The
way I understand it, he stores a list of ASCII commands in a table, and then
the parsing routine compares the message that was received to each string
within the table, generating a unique ID.
I would be tempted to use a table with the following fields:
1) the command itself
2) the minimum number of characters of the command the user must enter
3) a bitmask (or other data) that describes the expected argument(s) for the
4) the address of the code to handle the command (a function for "C" or just
a code pointer for ASM).
Then my logic looks like this:
Scan table for match to command (taking into account minimum length for
Use bitmask to control parsing arguments.
Branch to code to handle command.
--- Bob Ammerman
More... (looser matching)
- Last day of these posts
- In 2009
, 2010 only
- New search...