From 67cd0c219726b8d6ef5fc5e980cc197fbfb257d7 Mon Sep 17 00:00:00 2001 From: Marcus Rowe Date: Tue, 20 Oct 2015 09:30:25 +1000 Subject: [PATCH 1/2] Added .asize and .isize pseudo variables These pseudo variables will return the size of the accumulator/index in bits. For the 65816 instruction set .ASIZE/.ISIZE will return either 8 or 16, depending on the current size of the operand in immediate addressing mode. For all other CPU instruction sets, .ASIZE/.ISIZE will always return 8. For example: ; Reverse Subtract with Accumulator ; A = memory - A .macro rsb param .if .asize = 8 eor #$ff .else eor #$ffff .endif sec adc param .endmacro --- doc/ca65.sgml | 42 ++++++++++++++++++++++++++++++++++++++++++ src/ca65/expr.c | 18 ++++++++++++++++++ src/ca65/pseudo.c | 2 ++ src/ca65/scanner.c | 2 ++ src/ca65/token.h | 2 ++ 5 files changed, 66 insertions(+) diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 19c09b85d..278a81d1b 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -1191,6 +1191,35 @@ writable. assignments to / instead. +.ASIZE