lda $d0b8 ; check SCPU speed sta scpu_turbo ; store lda #00 sta $d07a ; slow down SCPU to 1MHz sta $de00 ; switch to Z80 nop ; req'd for switch back here: lda #00 ; $00 value stays if CPU switches not sta cpm_present ; CP/M availability 0 = not / 1 = yes ldx scpu_turbo ; get stored SCPU speed cpx #01 bne skip ; if was 1MHz skip rest dex stx $d07b ; restore 20MHz SCPU speed skip: rts cpm_present: .byte $00 scpu_turbo: .byte $00 ORG $0000 ; start address req'd but $0000 see Z80 as $0000 and 6502 as $1000 nop ld a, $01 ld (here+1), a ; stores CP/M availability - substract $1000 from here+1 ld ($CE00), a ; switches back to 6502 nop jp $0000