PrintSpace

Purpose: Place the single ASCII character ' ' (32 = 0x20) into the COM1 Transmit Buffer.
Assumes:  Nothing.
Passed: Nothing.
Returns: Nothing.
Alters: R24, the FLAGs (SREG), and the COM1 Transmit buffer
 

PrintSpaces

Purpose: Place multiple ASCII space characters into the COM1 Transmit Buffer.
Assumes:  Nothing.
Passed: R24   BYTE   bCount   number of spaces to output; zero to 255 are all valid
Returns: Nothing.
Alters: R24, the FLAGs (SREG), and the COM1 Transmit buffer

Example:  
.ORG  0x1000

PrintSpacesDemo:
   RCALL    APrintDelimiter       ; Print initial double quote; preserves 'X'
   ADIW     R26, 0                ; If no command line tail, skip parsing
   BRNE     AUseCount
   CALL     APrintSpace           ; Print a single space character
   RJMP     APrintDelimiter       ; Skip to the shared exit

UseCount:
   MOVW     R24, R26              ; Parse the value, if any; no need to check
   CALL     AParseValue           ;  R21, just use the BYTE in R22 instead and
   ANDI     R22, B00111111        ;  limit the number of spaces to 63
   MOV      R24, R22              ; Transfer the only parameter it needs
   CALL     APrintSpaces          ; Print the number of spaces specified

PrintDelimiter:
   LDI      R24, '"'              ; Either beginning or ending delimiter
   JMP      APrintCHAR 
Test it:
m>@ 0x1000
" "m>@ 4096 3      ; Notice when the prompt is output
"   "m>@ 4096 14
"              "m>@ 4096 63
"                                                               "m>@ 4096 2
"  "m>@ 4096 0
""m>@ 4096
" "m>@ 4096 1
" "m>; Just a normal comment
m>                                                                              
Dropin: 
(setup
code)
;   Setup for the PrintSpace() call:
; Passed:  Nothing.
; Returns: Nothing.
; Alters:  R24, the FLAGs and the COM1 Transmit Buffer

;   Setup for the PrintSpaces() call:
; Passed:  R24 BYTE bCount number of spaces to print (0 to 255)
; Returns: Nothing.
; Alters:  R24, the FLAGs, and the COM1 Transmit Buffer
Also see:  The Print BYTE family, the Print WORD family, the PrintPrompt family, PrintNewLine, and other the related printing System Functions.