Check_BG_Task

Purpose: Determine if a background memory display task is active. If it is, then printing should specifically be avoided, since it would intermingle the output with the memory dump.
Assumes: Nothing.
Passed: Nothing.
Returns:   R31:R30   WORD * wPtrMDStart pointer to wMemDumpStart, the WORD which saves the next address to be printed
R25:R24 WORD wMemDumpEnd the value in the WORD which saves the last address to be printed
FLAGS ZERO flagset (TRUE) when memory dump is NOT in progress
clear (FALSE) when a memory dump is in progress (and R25:R24 valid)
Alters: R24, R25, R30, R31, and the FLAGS
Example: 
CheckIfReady:
   CALL    ACheck_BG_Task            ; See if a BACKGROUND memory dump is being
   BRNE    APolite_Exit              ;  processed; if so, wait to try again
   LDS     R25, bParseBufferCount    ; It's also polite to see if a command is
   CPSE    R25, R1                   ;  being input and again, wait if so
Polite_Exit:
   RET                               ; Since the system is busy, exit now

   CALL    ADumpRegs_Begin           ; Display the MCU Register values
   LDI     R25, ACSZ_Process >> 8    ; Point to the string below to be printed
   LDI     R24, ACSZ_Process & 0xFF
   JMP     APrintFLASHASCIIz         ; We can call and return or just jump out
; Something more interesting than just printing ...

CSZ_Process: .STRING "Processing ...\r\n"
Notes: It is possible to terminate a background memory dump by zeroing both the wMemDumpStart and wMemDumpEnd system WORD variables, which are the 4 bytes to which R31:R30 is pointing upon return. Those same 2 variables could also be used to generate a progress display in LEDs, for example.
Also see:  SystemSRAM.Def, which contains the system variable bParseBufferCount address.