From a55f7477deb7f6b4fdb9c186581dd8613e80abab Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sun, 18 Oct 2020 20:33:36 +0200 Subject: [PATCH] Added 6502.h with SEI() and CLI(). --- src/main/kc/include/6502.h | 14 ++++++++++++++ src/main/kc/lib/6502.c | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/main/kc/include/6502.h create mode 100644 src/main/kc/lib/6502.c 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