| Purpose: | Print a string, in decimal format with the numeric value of a WORD. | |||
| Assumes: | Leading zeros should be suppressed. | |||
| Passed: | R25:R24 | WORD | wValue | the WORD value to print; output: "0" to "65535" with comma and/or a space after it |
| R22 | BYTE | bFlags | option BITs BIT_FMT_COMMAS and BIT_FMT_POST_Sp. | |
| Returns: | R23:R22 | WORD | bValue | the same bValue WORD that was passed in R25:R24 |
| Alters: | R18, R20 through R25, the FLAGs (SREG) and the COM1 Transmit buffer | |||
| Notes: | Uses the FormatWORD System Function | |||
PrintHexWORD | ||||
| Purpose: | Print a string, in hexadecimal format with the numeric value of a WORD. | |||
| Assumes: | Do not suppress any leading zeros; print four (4) characters | |||
| Passed: | R25:R24 | WORD | wValue | the WORD value to print; output: "0000" to "FFFF" |
| Returns: | Nothing. | |||
| Alters: | R24, the FLAGs (SREG) and the COM1 Transmit buffer | |||
Print0xHexWORD | ||||
| Purpose: | Print the 2-BYTE string "0x" then the 4-BYTE string created by PrintHexWORD. | |||
| Notes: | Everything else is as documented in PrintHexWORD above, since this routine uses it. | |||
| Example: |
|
||||
| Test it: |
| ||||
| Notes: | The Operating System handles the COM1 Transmit buffer as a circular FIFO (First In, First Out) queue. | ||||
| The BIT_FMT_COMMAS bit causes a comma to delimit the string at the expected three-digit intervals. | |||||
| The BIT_FMT_POST_Sp bit pads a space character after the last numeric digit. | |||||
| Dropin: (setup code) |
; Setup for the PrintWORD() call: ; Passed: R25:R24 WORD wValue to print in decimal format ; R22 BYTE bFlags (only BIT_FMT_COMMAS and BIT_FMT_POST_Sp) ; Returns: R23:R22 WORD wValue, the same as wValue passed in R25:R24 ; Alters: R18, R20 through R25, the FLAGs and the COM1 Transmit Buffer ; Notes: Any leading zeros are suppressed (i.e., not printed) ; Setup for the PrintHexWORD() or Print0xHexWORD() calls: ; Passed: R25:R24 WORD wValue to print in hexadecimal format ; Returns: Nothing. ; Alters: R24, the FLAGs and the COM1 Transmit Buffer ; Notes: If there are any leading zeros, they are printed | ||||
| Also see: | The System Functions PrintBINARY, PrintCHAR, Print0xPrefix, and the PrintBYTE family. | ||||