| Purpose: | Execute a text string as a MIRTOS system command. The string may be an internal system command or a command extension. Any leading space(s) in the command string are discarded. |
|||
| Assumes: | The very first BYTE at the address specified is the string
length. No command is executed if that first BYTE is zero. The command string is NULL-terminated. There are additional BYTEs available in the temporary buffer for command modification. |
|||
| Passed: | R25:R24 | WORD * | wAddress | the SRAM address of the buffer containing one (1) string length BYTE followed by the text string for MIRTOS to interpret and execute. |
| Returns: | Nothing. | |||
| Alters: | Any of R0, R18 to R28 may change, depending on the command
passed to it. Possibly the contents of the command buffer passed to it. |
|||
########################################################
## ##
## This webpage is incomplete ("Test it" section) ##
## ##
########################################################
| Example: : | In this example, a command is predefined in FLASH as an ASCIIZ string
("V+ 32",NULL) and stored after the code at address "Command". The 'Y'
register pair (R29:R28) should always point to the first BYTE of the
User variable array. If the Real-Time Clock minutes BYTE read is the
same as the last time it was stored, then the second block of code,
which begins with "STD" (STore with Displacement) is not executed. When the minute value has changed, its new value is stored to check the next time, then the command string length and string (7 BYTEs total, including the first string length BYTE and the string-ending NULL) is copied from FLASH to SRAM. This command is executed without changing the contents of the system command buffer, into which someone might be typing a new command. |
||||
|
|||||
| Test it: |
| ||||
| Notes: | Notice that the command was changed from "V+ 32" to "DS+ Depending on the command issued, this command might block. | ||||
| Dropin: (setup code) |
; Setup for the ProcessCommand() call: ; Passed: R25:R24 BYTE bValue to print in binary format ; Returns: Nothing. ; Alters: Varies; assume R0, R18 through R27, and the FLAGs, depending on the command ; Possibly the contents of the command buffer passed to it | ||||
| Also see: | - | ||||