diff --git a/src/main/kc/include/6502.h b/src/main/kc/include/6502.h new file mode 100644 index 000000000..4230e2125 --- /dev/null +++ b/src/main/kc/include/6502.h @@ -0,0 +1,14 @@ +// Simple functions wrapping 6502 instructions + +// Set the processor interrupt flag - disabling IRQ's. +// Uses the SEI instruction +inline void SEI(); + +// Clear the processor interrupt flag - enabling IRQ's. +// Uses the CLI instruction +inline void CLI(); + +// Add a KickAssembler breakpoint. +// The breakpoint is compiled be KickAssembler to the output files. +// If you use VICE or C64Debugger they can automatically load the breakpoints when starting. +inline void BREAK(); \ No newline at end of file diff --git a/src/main/kc/lib/6502.c b/src/main/kc/lib/6502.c new file mode 100644 index 000000000..af885653a --- /dev/null +++ b/src/main/kc/lib/6502.c @@ -0,0 +1,21 @@ +// Simple functions wrapping 6502 instructions + + +// Set the processor interrupt flag - disabling IRQ's. +// Uses the SEI instruction +inline void SEI() { + asm { sei }; +} + +// Clear the processor interrupt flag - enabling IRQ's. +// Uses the CLI instruction +inline void CLI() { + asm { cli }; +} + +// Add a KickAssembler breakpoint. +// The breakpoint is compiled be KickAssembler to the output files. +// If you use VICE or C64Debugger they can automatically load the breakpoints when starting. +inline void BREAK() { + kickasm {{ .break }}; +} \ No newline at end of file