PrintEEPROMASCIIz,  PrintFLASHASCIIz,  and  PrintSRAMASCIIz

Purpose: Transmit an ASCIIz string out the COM1 console serial port.
Assumes:  Since these system calls can "block", interrupts will be enabled if they are disabled when called.
Strings lengths can be from 0 to 255 BYTEs.
Passed: R25:R24  CHAR *   szPtrBuffer address of the EEPROM or SRAM or 328P FLASH buffer to output OR
R26:R25:R24  CHAR *   szPtrBuffer address of the 1284P or 2560 FLASH buffer to output
Returns:   R25:R24 CHAR * szPtrBuffer the same EEPROM, SRAM, or 328P FLASH address passed, unchanged OR
R26:R25:R24 CHAR * szPtrBuffer the same 1284P or 2560 address passed, unchanged
R22 BYTE bPrintCount   the number of BYTEs that were enbuffered to be output
Alters: R20 and the FLAGs, in addition to R22, R24, and R25 returned
Example:  
.ORG  0x1000

   LDI     R25, 0               ; Point to the beginning of the customary Boot
   LDI     R24, 0xB0            ;   Initialiation strings in EEPROM (@ 0x00B0)
   RCALL   ALocalDumpRegs
   CALL    APrintEEPROMASCIIz   ; Enbuffer the string from EEPROM
   CALL    APrintNewLine        ; Since it has no Carriage Return or Line Feed
   RCALL   ALocalDumpRegs

;  LDI     R25, 0               ; Specify a string in the system FLASH memory
   LDI     R24, 0x5C            ;  (@ 0x005C) but note that R25 is already 0
   RCALL   ALocalDumpRegs
   CALL    APrintFLASHASCIIz    ; Enbuffer the string from PROGRAM memory
   RCALL   ALocalDumpRegs

   LDI     R25, 0x02            ; Point to the Command Buffer, which starts
   LDI     R24, 0x31            ;  with a BYTE count at 0x0230 in SRAM; skip
   RCALL   ALocalDumpRegs       ;  that first BYTE
   CALL    APrintSRAMASCIIz
   CALL    APrintNewLine        ; Since it has no Carriage Return or Line Feed

LocalDumpRegs:
   JMP     ADumpRegs_Begin      ; A single FAR jump which all above use
Test it:
m>@  0x1000  ; Includes the comment

 10   32   54   76   98  1110 1312 1514 1716 1918 2120 2322 2524 2726 2928 3130  SP  RetAdd   SREG
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ --------
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0D10 0800-00B0 023A 0280 0800 08F5  1006  IthsvnZc
; Bootup Init:
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0DFE 080F-00B0 023A 0280 0800 08F5  1010  ItHSvNzC
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0DFE 080F-005C 023A 0280 0800 08F5  1014  ItHSvNzC
MIRTOS for Dual Relay Controller
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0DFF 0822-005C 023A 0280 0800 08F5  101A  IthsvnZc
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0DFF 0822-0231 023A 0280 0800 08F5  1020  IthsvnZc
@  0x1000  ; Includes the comment
0000 0439 0933 FF28-0004 0000 0000 4000-0021 2000 0D00 0821-0231 023A 0280 0800 08F7  626E  IthSvNzC
m> ; The third string is shorter than the second, which includes CR & LF
m>                                                                                                   
Notes: These routines are actually just placing characters into the COM1 (or terminal) transmit buffer, a FIFO queue. They will only block if there is not room in the queue to enbuffer all of the characters. Any delay is due to waiting until enough characters are transmitted (i.e., removed from the queue) to make room for all of the new ones. These routines return as soon as all characters are enbuffered.
The term ASCIIz means a series of characters terminated with a NULL (or zero) BYTE. Each function calls the appropriate strlen function to determine the BYTE count, which is returned in R22.
If the first BYTE of a string is a NULL, nothing is printed.
The term "block" means that the subroutine does not return until its function is complete.
These routines internally call the COM1_Write System Function after determining the string length with the appropriate strlen function and specifying the string source.
The function name PrintPGMASCIIz is the same as PrintFLASHASCIIz.
The function name PrintRAMASCIIz is the same as PrintSRAMASCIIz.
Dropin: 
(setup
code)
;   Setup for the Print####ASCIIz() call:
; Passed:  R25:R24 CHAR * szPtrBuffer pointer to the string to print
; Returns: R25:R24 CHAR * szPtrBuffer pointer to the string, unmodified
;              R22 BYTE   bPrintCount number of BYTEs placed in the print queue
; Alters:  R20 and the FLAGs, in addition to R22, R24 and R25 returned
Here is the version for the 1284P or 2560 FLASH:
;   Setup for the 1284P or 2560 PrintFLASHASCIIz() call:
; Passed:  R26:R25:R24 CHAR * szPtrBuffer pointer to the string to print
; Returns: R26:R25:R24 CHAR * szPtrBuffer pointer to the string, unmodified
;                  R22 BYTE   bPrintCount number of BYTEs placed in the print queue
; Alters:  R20 and the FLAGs, in addition to R22, R24 and R25 returned
Also see:  The strlen, strlenEEPROM, and strlenPGM family, as well as the Print####String family and the COM1 receive status, transmit status, read, write, and wait family of System Functions.