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 diff --git a/asminc/cpu.mac b/asminc/cpu.mac index 15b16bad5..092519173 100644 --- a/asminc/cpu.mac +++ b/asminc/cpu.mac @@ -1,38 +1,4 @@ -; CPU bitmask constants (make sure this matches src/common/cpu.h) - -CPU_ISET_NONE = $0001 -CPU_ISET_6502 = $0002 -CPU_ISET_6502X = $0004 -CPU_ISET_6502DTV = $0008 -CPU_ISET_65SC02 = $0010 -CPU_ISET_65C02 = $0020 ; Rockwell extensions -CPU_ISET_65816 = $0040 -CPU_ISET_SWEET16 = $0080 -CPU_ISET_HUC6280 = $0100 -CPU_ISET_M740 = $0200 -CPU_ISET_4510 = $0400 -CPU_ISET_45GS02 = $0800 -CPU_ISET_W65C02 = $1000 ; WDC extensions -CPU_ISET_65CE02 = $2000 ; CSG extensions - -; CPU capabilities -; make sure to only combine the instruction sets that are 100% compatible -CPU_NONE = CPU_ISET_NONE -CPU_6502 = CPU_ISET_6502 -CPU_6502X = CPU_ISET_6502X | CPU_ISET_6502 -CPU_6502DTV = CPU_ISET_6502DTV | CPU_ISET_6502 -CPU_65SC02 = CPU_ISET_65SC02 | CPU_ISET_6502 -CPU_65C02 = CPU_ISET_65C02 | CPU_ISET_6502 | CPU_ISET_65SC02 -CPU_W65C02 = CPU_ISET_W65C02 | CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 - -; FIXME: CPU_ISET_65SC02 does not apply to the following, because the zp-indirect -; addressing was replaced with zp-indirect,z-indexed in 652SCE02 - -CPU_HUC6280 = CPU_ISET_HUC6280 | CPU_ISET_6502 | CPU_ISET_65C02 -CPU_4510 = CPU_ISET_4510 | CPU_ISET_6502 | CPU_ISET_65C02 | CPU_ISET_65CE02 -CPU_45GS02 = CPU_ISET_45GS02 | CPU_ISET_6502 | CPU_ISET_65C02 | CPU_ISET_65CE02 | CPU_ISET_4510 -CPU_M740 = CPU_ISET_M740 | CPU_ISET_6502 -CPU_65CE02 = CPU_ISET_65CE02 | CPU_ISET_6502 | CPU_ISET_65C02 - -CPU_65816 = CPU_ISET_65816 | CPU_ISET_6502 | CPU_ISET_65SC02 -CPU_SWEET16 = CPU_ISET_SWEET16 +; This file is no longer needed as the symbols that were defined here are now +; internal symbols generated by the assembler. It is kept to avoid breaking +; old sources. +.warning "'.macpack cpu' is no longer required" diff --git a/doc/ca65.sgml b/doc/ca65.sgml index b7e8539af..63a1be7e9 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -1401,16 +1401,76 @@ writable. Reading this pseudo variable will give a constant integer value that tells which CPU is currently enabled. It can also tell which instruction set the CPU is able to translate. The value read from the pseudo variable - should be further examined by using one of the constants defined by the - "cpu" macro package (see /). + should be further examined by using one of the following constants: - It may be used to replace the .IFPxx pseudo instructions or to construct - even more complex expressions. + + CPU_6502 + CPU_65SC02 + CPU_65C02 + CPU_65816 + CPU_SWEET16 + CPU_HUC6280 + CPU_4510 + CPU_45GS02 + CPU_6502DTV + CPU_M740 + + +Above constants may be used to determine the exact type of the currently +enabled CPU. In addition to that, for each CPU instruction set, another +constant is defined: + + + CPU_ISET_6502 + CPU_ISET_65SC02 + CPU_ISET_65C02 + CPU_ISET_65816 + CPU_ISET_SWEET16 + CPU_ISET_HUC6280 + CPU_ISET_4510 + CPU_ISET_45GS02 + CPU_ISET_6502DTV + CPU_ISET_M740 + + + + + - .macpack cpu .if (.cpu .bitand CPU_ISET_65816) phx phy @@ -1422,6 +1482,9 @@ writable. .endif + See also: + + .ISIZE