diff --git a/c64/aliases/,aliases_cpu.s b/c64/aliases/,aliases_cpu.s index 2050e2af..023e7558 100644 --- a/c64/aliases/,aliases_cpu.s +++ b/c64/aliases/,aliases_cpu.s @@ -47,6 +47,30 @@ } +// +// Some additional 65CE02 instructions +// + + +#if HAS_OPCODES_65CE02 + +.pseudocommand dew addr +{ + .var arg = addr.getValue() + .if (arg > $FF) .error "DEW requires zeropage address" + .byte $C3, arg +} + +.pseudocommand inw addr +{ + .var arg = addr.getValue() + .if (arg > $FF) .error "INW requires zeropage address" + .byte $E3, arg +} + +#endif + + // // Stack manipulation - some CPUs will leave .A unchanged, some will use it as temporary storage, so consider .A trashed // diff --git a/c64/kernal/iec/load_iec.s b/c64/kernal/iec/load_iec.s index 0ab544ff..f609c035 100644 --- a/c64/kernal/iec/load_iec.s +++ b/c64/kernal/iec/load_iec.s @@ -118,8 +118,12 @@ load_iec_loop: // Advance pointer to data; it is OK if it advances past $FFFF, // one autostart technique does exactly this +#if !HAS_OPCODES_65CE02 jsr lvs_advance_EAL - +#else + inw EAL+0 +#endif + // Handle STOP key; it is probably an overkill to do it // with every byte, once per 32 bytes should be enough lda EAL diff --git a/c64/kernal/iostack/load_save_common.s b/c64/kernal/iostack/load_save_common.s index 8f43b96b..fb38606c 100644 --- a/c64/kernal/iostack/load_save_common.s +++ b/c64/kernal/iostack/load_save_common.s @@ -75,7 +75,7 @@ lvs_handle_byte_verify: sec rts -#if CONFIG_IEC +#if CONFIG_IEC && !HAS_OPCODES_65CE02 lvs_advance_EAL: @@ -101,10 +101,14 @@ lvs_setup_MEMUSS: lvs_advance_MEMUSS_check_EAL: // Advance pointer +#if !HAS_OPCODES_65CE02 inc MEMUSS+0 bne !+ inc MEMUSS+1 !: +#else + inw MEMUSS+0 +#endif lda MEMUSS+1 cmp EAL+1 bne !+ diff --git a/c64/kernal/tape/tape_normal_get_marker.s b/c64/kernal/tape/tape_normal_get_marker.s index 59f73d8e..eaa6c219 100644 --- a/c64/kernal/tape/tape_normal_get_marker.s +++ b/c64/kernal/tape/tape_normal_get_marker.s @@ -5,6 +5,10 @@ // Reeturns marker type in Carry flag, set = end of data // + +#if CONFIG_TAPE_NORMAL + + tape_normal_get_marker: // (L,M) - end of byte, (L,S) - end of data @@ -14,3 +18,6 @@ tape_normal_get_marker: bcs tape_normal_get_marker // too short for a long pulse jmp tape_normal_get_pulse + + +#endif diff --git a/c64/kernal/time/udtim.s b/c64/kernal/time/udtim.s index 65dc6aaf..01bb3b91 100644 --- a/c64/kernal/time/udtim.s +++ b/c64/kernal/time/udtim.s @@ -14,9 +14,13 @@ UDTIM: // (24 hours * 60 minutes * 60 seconds * 60 jiffies), // after this time we have to reset the clock. +#if !HAS_OPCODES_65CE02 inc TIME+0 bne udtim_time_done // done with clock inc TIME+1 +#else + inw TIME+0 +#endif bne udtim_clock_rollover inc TIME+2