Purpose: | Display the contents of the 328P Registers. The only difference between the two routines is that DumpRegisters can be toggled on and off using the '}' key, as the first character on a command line; display is suppressed. When the DumpRegs_Begin version is used, it always generates the output. |
Assumes: | The BIT_DDT_REGS bit in system variable
bFlags_Debug is the toggle bit for
DumpRegisters. The bDumpRegFlags BYTE has configurable option bits for both of these routines. Its bits can be changed from the command, with the "R = ##" command. |
Passed: | Nothing. |
Returns: | Nothing. |
Alters: | Only the serial port output buffer; not even the FLAGs byte is changed |
Example 1: |
|
Example 2: |
This example comes directly from the Operating System source code, which has "Bytes" and "Clocks" tracking. It takes all of twelve (12) bytes to implement. It is the "Q" command logic. The output is much more interesting when the BIT_DR_DUMP_STACK bit is enabled in bDumpRegFlags, which can be done using "ES 0x1DF |= 64" in the 328P and 1284P, or "ES 0x2DF |= 64" in the 2560. |
| |
Notes: | The bDumpRegsFlags variable bit definitions: |
Position | Bit name | Function | ||
---|---|---|---|---|
0 | BIT_DR_CR_ALWAYS | Print a Carriage Return before each line | ||
1 | BIT_DR_HDR_1PERSEC | Only print the header once each second | ||
2 | BIT_DR_HDR_ALWAYS | Always print the header (overrides the bit above) | ||
3 | BIT_DR_INCL_SP | Include the "SP" (Stack Pointer) column | ||
4 | BIT_DR_INCL_RETADD | Include the "RetAdd" (Return Address) column | ||
5 | BIT_DR_INCL_SREG | Include "SREG" (Status Register) column | ||
6 | BIT_DR_DUMP_STACK | Dump the stack after the Register dump | ||
7 | BIT_DR__spare7__ | (spare; unused) |
Also see: | The DumpStack and "R" system commands. |