Merge pull request #2642 from GorillaSapiens/ca65_charset_translations

C style character translation in ca65
This commit is contained in:
Bob Andrews
2025-05-24 17:23:19 +02:00
committed by GitHub
2 changed files with 104 additions and 44 deletions

View File

@@ -90,22 +90,7 @@ read_loop:
bne :+
inc ptr4+1
; The next code line:
;
; .byte $c9, "\n"
;
; corresponds to a CMP #imm with the target-specific newline value as its operand.
; This works because (with the 'string_escapes' feature enabled), the "\n" string
; assembles to the target-specific value for the newline character.
;
; It would be better if we could just write:
;
; cmp #'\n'
;
; Unfortunately, ca65 doesn't currently handle escape characters in character
; constants. In the longer term, fixing that would be the preferred solution.
: .byte $c9, "\n" ; cmp #'\n'
: cmp #'\n' ; #'\n' should get translated properly
beq done
bne read_loop