ORG $C000 JMP START ; Go to the start of the program OUTPUT EQU $FFAF ; outputs a single character -> SCI OUTCRLF EQU $FFC4 ; prints a LF and a CR YELLOW FCB $1B ; Make the cursor yellow FCB $5B FCB $33 FCB $33 FCB $3B FCB $31 FCB $6D FCB $04 CURCNTR FCB $1B ; Center the TEXT line on the screen FCB $5B ; { 12, 25 } position FCB $31 FCB $31 FCB $3B FCB $32 FCB $35 FCB $48 FCB $04 CLRSCRN FCB $1B ; Clear the screen FCB $5B FCB $32 FCB $4A FCB $04 TEXT FCC `This is a sample line of text.` FCB $04 START LDX #CLRSCRN JSR OUTTEXT ; Clear the screen LDX #YELLOW JSR OUTTEXT ; Make the cursor yellow LDX #CURCNTR JSR OUTTEXT ; Center the cursor LDX #TEXT JSR OUTTEXT ; Print the text JSR OUTCRLF ; Skip a line JSR OUTCRLF SWI ; End the program OUTTEXT PSHA ; Save our registers (non-destructive) PSHX OUTTXT1 LDAA 0,X ; Read a character into A CMPA #$04 ; Is it the EOT character? (End-of-text) BEQ OUTTXT2 ; If it is, end JSR OUTPUT ; Output character INX BRA OUTTXT1 ; loop OUTTXT2 PULX ; Restore our original registers PULA RTS ; Return to the calling address