millfork/include/pet_kernal.mfk

32 lines
621 B
Plaintext

// Routines from Commodore PET KERNAL ROM
#if not(CBM_PET)
#warn pet_kernal module should be only used on PET targets
#endif
// CHROUT. Write byte to default output. (If not screen, must call OPEN and CHKOUT beforehands.)
// Input: A = Byte to write.
asm void putchar(byte register(a) char) @$FFD2 !preserves_a !preserves_x !preserves_y extern
inline void new_line() {
putchar(13)
}
inline asm set_zero is_pet2000() {
? LDA #$CA
CMP $FFFB
? RTS
}
inline asm set_zero is_pet3000() {
? LDA #$FC
CMP $FFFB
? RTS
}
inline asm set_zero is_pet4000() {
? LDA #$FD
CMP $FFFB
? RTS
}