From 07f08fc547b7e0f5b37aef23dd482a3d5f483352 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Sat, 19 Aug 2023 14:36:30 -0400 Subject: [PATCH] tests verifying jmp (indirect) page crossing error on 6502, and the lack of error for other CPU types --- test/asm/err/jmp-indirect-6502-error.s | 4 ++++ test/asm/val/jmp-indirect-success.s | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/asm/err/jmp-indirect-6502-error.s create mode 100644 test/asm/val/jmp-indirect-success.s diff --git a/test/asm/err/jmp-indirect-6502-error.s b/test/asm/err/jmp-indirect-6502-error.s new file mode 100644 index 000000000..aadc37b30 --- /dev/null +++ b/test/asm/err/jmp-indirect-6502-error.s @@ -0,0 +1,4 @@ +; test that jmp (indirect) on a page boundary will give an error for 6502 CPU + +.p02 +jmp ($10FF) diff --git a/test/asm/val/jmp-indirect-success.s b/test/asm/val/jmp-indirect-success.s new file mode 100644 index 000000000..0cdc8c32c --- /dev/null +++ b/test/asm/val/jmp-indirect-success.s @@ -0,0 +1,18 @@ +; test that jmp (indirect) on a page boundary will not give an error for non-6502 CPUs + +.pc02 +jmp ($10FF) + +.psc02 +jmp ($10FF) + +.p816 +jmp ($10FF) + +; main always returns success (the tested issue is only whether the assembly errors) +.import _exit +.export _main +_main: + lda #0 + tax + jmp _exit