Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user gut10 ! (Registered 2020-01-28) 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: 1004
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: 1343
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: 4508
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: 1004
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: 1564
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
sailor/Triad
Impetigo/Crescent
Sentinel/Excess
Street Tuff/TRSi
B.A./CAE
Jasmin68k
A3/AFL
Guests online: 46
Top Demos
1 Uncensored  (9.7)
2 Coma Light 13  (9.7)
3 Edge of Disgrace  (9.7)
4 Unboxed  (9.7)
5 Comaland 100%  (9.6)
6 Lunatico  (9.6)
7 The Shores of Reflec..  (9.5)
8 Rivalry  (9.5)
9 X Marks the Spot  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Tribute to Ben - Las..  (9.8)
2 Gumbo Revised  (9.6)
3 Crystal Gazer  (9.6)
4 Smile to the Sky  (9.5)
5 Dawnfall V1.1  (9.5)
6 Daah, Those Acid Pil..  (9.5)
7 Instinct  (9.5)
8 Innervasion  (9.5)
9 Merry Krampus  (9.5)
10 Pandemoniac Part 5 o..  (9.5)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Fossil  (9.4)
4 PriorArt  (9.4)
5 Censor Design  (9.4)
Top Crackers
1 Mr. Z  (10)
2 S!R  (9.8)
3 Mr Zero Page  (9.7)
4 Janitor  (9.7)
5 Mitch  (9.6)

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