| 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: |
|
|||
| Test it: |
| |||
| 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. | |||