DumpRegisters  and  DumpRegs_Begin

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:
CommandExtensions:              ; Full code in System Command Extensions
   CALL    ADumpRegisters       ; Only output if BIT_DDT_REGS is set
   CPI     R21, '?'             ; If the command began with the key '?',
   BREQ    ACmdExt_Question     ;  jump to that subroutine
   CPI     R21, '4'             ; If it was a '4', suppress whatever that
   BREQ    ACmdExt_Handled      ;  key did
   CPI     R21, '5'             ; If it was a '5', check a little further
   BREQ    ACmdExt_5            ;  before deciding what to do
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.
Case_Q:                   ; Bytes Clocks
   RCALL   ACase_Q_Start     ;  2  3   Since PopAll() requires a JUMP, this way
   RJMP    ADumpRegs_Begin   ;  2  2    allows the return to come back here

Case_Q_Start:
   RCALL   ADumpRegs_Begin   ;  2  3   This is just a demonstration of PushAll
   RCALL   APushAll          ;  2  3    and PopAll, using DumpRegs() to show
   RCALL   ADumpRegs_Begin   ;  2  3    all registers before, during and after
   RJMP    APopAll           ;  2  3    PushAll and PopAll
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.