From d4e57278c6f9ce681dc8c263616157226c76cd2f Mon Sep 17 00:00:00 2001 From: Kugel Fuhr <98353208+kugelfuhr@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:37:43 +0200 Subject: [PATCH] Add a new .cap pseudo function to the assembler that allows to check for certain capabilities of the CPU or target system. --- doc/ca65.sgml | 54 +++++++++++ src/ca65/expr.c | 76 ++++++++++++++-- src/ca65/pseudo.c | 4 +- src/ca65/scanner.c | 2 + src/ca65/token.h | 1 + src/common/capability.c | 90 +++++++++++++++++++ src/common/capability.h | 78 ++++++++++++++++ src/common/cpu.c | 82 +++++++++++++++++ src/common/cpu.h | 8 ++ test/asm/listing/110-capabilities.s | 39 ++++++++ test/asm/listing/control/110-capabilities.err | 0 .../asm/listing/ref/110-capabilities.err2-ref | 6 ++ 12 files changed, 434 insertions(+), 6 deletions(-) create mode 100644 src/common/capability.c create mode 100644 src/common/capability.h create mode 100644 test/asm/listing/110-capabilities.s create mode 100644 test/asm/listing/control/110-capabilities.err create mode 100644 test/asm/listing/ref/110-capabilities.err2-ref diff --git a/doc/ca65.sgml b/doc/ca65.sgml index b7e8539af..552309ff9 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -1423,6 +1423,10 @@ writable. + See also: + + + .ISIZE