From a4a24280f26ddb3e319678db7a531320df7125fe Mon Sep 17 00:00:00 2001 From: Kugel Fuhr <98353208+kugelfuhr@users.noreply.github.com> Date: Mon, 30 Jun 2025 20:50:30 +0200 Subject: [PATCH 01/11] Do only check .c and .h files. --- .github/checks/sorted.sh | 4 ++-- .github/checks/sorted_codeopt.sh | 4 ++-- .github/checks/sorted_opcodes.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/checks/sorted.sh b/.github/checks/sorted.sh index b5451a21f..e15c04475 100755 --- a/.github/checks/sorted.sh +++ b/.github/checks/sorted.sh @@ -33,7 +33,7 @@ function checkarray_quoted_name } -for N in `grep -rl "BEGIN SORTED.SH" "$CHECK_DIR"`; do - checkarray_quoted_name $N +find "$CHECK_DIR" -name \*.\[ch\] -print | while read N; do + grep -q "BEGIN SORTED.SH" "$N" && checkarray_quoted_name "$N" done exit 0 diff --git a/.github/checks/sorted_codeopt.sh b/.github/checks/sorted_codeopt.sh index cfca028dd..370bbfc9f 100755 --- a/.github/checks/sorted_codeopt.sh +++ b/.github/checks/sorted_codeopt.sh @@ -64,6 +64,6 @@ function checkarray find "$CHECK_DIR" -name \*.\[ch\] -print | while read N; do - grep -q "BEGIN DECL SORTED_CODEOPT.SH" "$N" && checkarray $N + grep -q "BEGIN DECL SORTED_CODEOPT.SH" "$N" && checkarray "$N" done -exit 0 +exit 0 diff --git a/.github/checks/sorted_opcodes.sh b/.github/checks/sorted_opcodes.sh index 34156bde6..8f8764c6a 100755 --- a/.github/checks/sorted_opcodes.sh +++ b/.github/checks/sorted_opcodes.sh @@ -34,7 +34,7 @@ function checkarray_quoted_name rm -rf .a.tmp } -for N in `grep -rl "BEGIN SORTED_OPCODES.SH" "$CHECK_DIR"`; do - checkarray_quoted_name $N +find "$CHECK_DIR" -name \*.\[ch\] -print | while read N; do + grep -q "BEGIN SORTED_OPCODES.SH" "$N" && checkarray_quoted_name "$N" done exit 0 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 02/11] 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