Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > ca65 and zero page initialised data
2019-12-31 09:57
ChristopherJam

Registered: Aug 2004
Posts: 1084
ca65 and zero page initialised data

Has anyone managed to convince ca65 to assemble code to zero page, with it actually treating zero page addresses appropriately?

If I mark a segment as being of type "zp" it then assumes it's uninitialized.

My current hack is to assemble it with a destination of $0900 (which is where I'll be copying it from anyway), and just use

blah=<*

anywhere I want to define a label, but of course I'll have to not do that for any branch destinations. It's not ideal..
2019-12-31 10:56
Krill

Registered: Apr 2002
Posts: 1538
Have you tried .org $xy? =)

That said, assuming you're working on a small project (4K ICC intro) that doesn't really need all that segment/linking stuff, i recommend using 64tass instead of ca65.
2019-12-31 11:27
Oswald

Registered: Apr 2002
Posts: 4611
64tass:

.logical <expression>
.here
Changes the program counter only, the compile offset is not changed. When finished all continues where it was left off before.
2019-12-31 12:01
ChristopherJam

Registered: Aug 2004
Posts: 1084
Ooh, I've not tried setting .org directly yet - it doesn't always work that well with this assembler, but might be worth a try in this instance.

Probably a little late in the day to try switching assemblers (yes, it's for an ICC entry), and besides, I'm fairly reliant on interleaving source for different .prgs at the moment, and being able to casually refer to lables from different areas.
2020-01-11 16:53
JackAsser

Registered: Jun 2002
Posts: 1725
Did you try mark the segment with ZP-adressing? I.e. not type=ZP but in the code you write:

.segment "ZP": zeropage
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Shocker/ONS/sidDivers
MWR/Visdom
Honcho
Karmic/HVSC/ONS
TheRyk/MYD
Devil/Clique
Guests online: 107
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.6)
3 Coma Light 13  (9.6)
4 Memento Mori  (9.6)
5 Comaland 100%  (9.6)
6 Unboxed  (9.6)
7 The Shores of Reflec..  (9.6)
8 Lunatico  (9.5)
9 Remains  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Crystal Gazer  (9.5)
2 Dawnfall V1.1  (9.5)
3 Smile to the Sky  (9.5)
4 Daah, Those Acid Pil..  (9.5)
5 Rewind  (9.5)
6 Postcard from Earth 2  (9.5)
7 Instinct  (9.4)
8 The Night It Snowed  (9.4)
9 Tribute to Ben - Las..  (9.4)
10 In Memoriam BHF  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 PriorArt  (9.4)
4 Oxyron  (9.3)
5 Triad  (9.2)
Top Hardware-Gurus
1 Jope  (10)
2 Soci  (9.9)
3 Grue  (9.8)
4 Zer0-X  (9.8)
5 Lemming  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.116 sec.