From 9344d87b0502daaad4ba588f0ee22428dd39eca5 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 21 Jun 2025 00:56:34 +0200 Subject: [PATCH] part of #1792 - 48GS02 assembler support --- asminc/cpu.mac | 2 + doc/ca65.sgml | 58 +++-- doc/da65.sgml | 7 +- src/ca65/condasm.c | 11 + src/ca65/ea65.c | 33 ++- src/ca65/instr.c | 317 ++++++++++++++++++++--- src/ca65/instr.h | 40 +-- src/ca65/pseudo.c | 10 + src/ca65/scanner.c | 15 +- src/ca65/token.h | 3 + src/common/cpu.c | 2 + src/common/cpu.h | 2 + test/asm/opcodes/45GS02-opcodes.ref | Bin 0 -> 878 bytes test/asm/opcodes/45GS02-opcodes.s | 377 ++++++++++++++++++++++++++++ 14 files changed, 803 insertions(+), 74 deletions(-) create mode 100644 test/asm/opcodes/45GS02-opcodes.ref create mode 100644 test/asm/opcodes/45GS02-opcodes.s diff --git a/asminc/cpu.mac b/asminc/cpu.mac index 818d70df1..e3ab49014 100644 --- a/asminc/cpu.mac +++ b/asminc/cpu.mac @@ -10,6 +10,7 @@ CPU_ISET_SWEET16 = $0080 CPU_ISET_HUC6280 = $0100 CPU_ISET_M740 = $0200 CPU_ISET_4510 = $0400 +CPU_ISET_45GS02 = $0800 ; CPU capabilities CPU_NONE = CPU_ISET_NONE @@ -24,4 +25,5 @@ CPU_SWEET16 = CPU_ISET_SWEET16 CPU_HUC6280 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_HUC6280 ; NOTE: 45100 replaces "wai" ($cb) and "stp" ($db) of the 65C02 instruction set CPU_4510 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_4510 +CPU_45GS02 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_4510|CPU_ISET_45GS02 CPU_M740 = CPU_ISET_6502|CPU_ISET_M740 diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 8991db900..8c0c4fa61 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -152,7 +152,7 @@ Here is a description of all the command line options: Set the default for the CPU type. The option takes a parameter, which may be one of - 6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510, M740 + 6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510, 45GS02, M740