         keep  LoopCOUT     gequ  $FDED                    ;Char print routinePRBYTE   gequ  $FDDA                    ;Print a hex byteeROUT    gequ  $FD8E                    ;Print a CR         org   $2000main     start         ldx   #>title                  ;High byte of the address         ldy   #title                   ;Low byte of the address         jsr   print                    ;Print the title         rts                            ;End of programtitle    dc    c'A loop example!',h'0D 00'         end** print** Prints the null-terminated string* pointed to by the X and Y registers.*print    startstring   equ   $00                      ;String pointer address         sty   string                   ;Save the string         stx   string+1         ldy   #$00                     ;Start at the beginningloop     lda   (string),y               ;Get a character         beq   done                     ;->If it's zero, done         jsr   COUT                     ;Print it         iny                            ;Next character         jmp   loop                     ;And keep goingdone     rts                            ;Return to caller         end
