; Dispatch: entry, display and data. The copy routine lives in receive.asm. CHROUT equ $a002 ; ROM's indirect character-output vector section code export start import receive start leax packet,pcr leay received,pcr ldb #expected-packet ; number of bytes before the checksum jsr receive ; LWLINK supplies the other module's address inspect cmpa expected,pcr bne damaged leax received,pcr bra print damaged leax badmsg,pcr print lda ,x+ beq finish bsr emit bra print finish lda #13 bsr emit rts ; hand control back to BASIC emit pshs x ; the print loop needs X after the ROM call jsr [CHROUT] puls x,pc packet fcc "ORB" expected fcb $e3 received fcb 0,0,0,0 ; the fourth byte terminates the printed string badmsg fcc "CHECK" fcb 0 endsection