PrintNewLine

Purpose: Emit two ASCII characters to advance to the next text line.
The two characters are Carriage Return (13 = 0x0D) and Line Feed (10 = 0x0A).
Assumes:  Since this system call can "block", interrupts will be enabled if they are disabled when called.
Passed: Nothing.  
Returns:   Nothing.
Alters: Only the FLAGs (SREG) and the COM1 Transmit buffer
Example:  
.ORG  0x1000

PrintMultipleNewLines:
   ADIW     R26, 0                ; If no command line tail, skip parsing and
   BREQ     ANewLine_Ret          ;  don't print any new lines at all
   MOVW     R24, R26              ; Parse the value, if any; no need to check
   CALL     AParseValue           ;  R21, check the BYTE in R22 instead
   ANDI     R22, B00001111        ; Limit the count to 15, but if the modulo
   BREQ     ANewLine_Ret          ;  16 of the value passed is 0, print none

Loop:
   CALL     APrintNewLine         ; Print the Carriage Return & Line Feed
   DEC      R22                   ; Decrement the loop counter and loop back
   BRNE     ALoop                 ;  unless it reached zero

NewLine_Ret:
   RET
Test it:
m> 4096
m>@ 4096 1

m>@ 4096 2


m>@ 4096 3



m>@ 4096 0
m>@ 4096 33

m>                                                                              
Dropin: 
(setup
code)
;   Setup for the PrintNewLine() call:
; Passed:  Nothing.
; Returns: Nothing.
; Alters:  Only the FLAGs and the COM1 Transmit Buffer
Also see:  The Print BYTE family, the Print WORD family, the Print Space family, and other the related printing System Functions.