* Simple substitutes for Buffalo's SCI routines, * for standalone operation. Based on hello.asm. #include "ascii.asm" ********** * ONSCI() - Initialize the SCI for 9600 * baud at 8 MHz Extal. ********** ONSCI LDAA #$30 STAA BAUD baud register LDAA #$00 STAA SCCR1 LDAA #$0C STAA SCCR2 enable RTS ********** * OUTSTRG(x) - Output string of ASCII bytes * starting at x until end of text ($04). ********** OUTSTRG JSR OUTCRLF OUTSTRG0 PSHA OUTSTRG1 LDAA 0,X read char into a CMPA #EOT BEQ OUTSTRG3 jump if eot JSR OUTPUT output character INX incriment pointer BRA OUTSTRG1 loop OUTSTRG3 PULA RTS ********** * OUTCRLF() - Output a Carriage return and * a line feed. Returns a = cr. ********** OUTCRLF LDAA #$0D cr JSR OUTPUT output a LDAA #$0A JSR OUTPUT output padding RTS ********** * OUTPUT() - Output A to sci. ********** OUTPUT OUTSCI2 LDAB SCSR read status BITB #$80 BEQ OUTSCI2 loop until tdre=1 ANDA #$7F mask parity STAA SCDR send character OUTSCI3 RTS