ca65 .charmap range error

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
Posts: 12
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

ca65 .charmap range error

Post by Cyneprepou4uk » Thu Feb 11, 2021 6:05 pm

Hi. I'm disassembling Castlevania 3, and I need to write "My name is Grant." phrase in my assembly file the same way as in original ROM. I'm using .charmap control command to redefine bytes for symbols.

The problem I'm dealing with is I can't neither redefine byte $00 nor define something to byte $00.

Code: Select all

.charmap $00, $DB   ; .
.charmap $20, $00   ; space

; any of these 2 lines will throw "range error" when compiling
So instead of

Code: Select all

.byte "My name is Grant."
I have to write it like this

Code: Select all

.byte "My", $00, "name", $00, "is", $00, "Grant", $DB
Is there a way to get rid of that error? Here is an example archive with relevant stuff only, if you need to test something.
(130.54 KiB) Downloaded 12 times
Last edited by Cyneprepou4uk on Fri Feb 12, 2021 9:30 am, edited 1 time in total.

User avatar
Posts: 8000
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada

Re: ca65 .charmap range error

Post by rainwarrior » Fri Feb 12, 2021 12:51 am

cc65 has:

Code: Select all

#pragma warn (remap-zero, push, off)
I'm not sure if there's something equivalent for assembly... if you can't find something suitable, you might be able to just eliminate range checks with:

Code: Select all

.feature force_range

Post Reply