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


Forums > C64 Coding > using $00 and $01 as memory tables
2012-02-23 08:48
ready.

Registered: Feb 2003
Posts: 441
using $00 and $01 as memory tables

hello all,
in order to optimize my code I'd like to use $00 and $01 as memory tables, containing the pointers for other stuff.

So instead of:

lda $0a00,x
sta ZP
lda (ZP),y

I would like to use this optimized version:

lda $00,x
sta ZP
lda (ZP),y

So far I succesfully tested the otpimized version on both a C64c (short board) and a C64 (long board), having $00=$2f and $01=$34.

What worries me are the most significant bits of these addresses, which, if I remeber right, can change pseudo-randomly. Wasn't there a program measuring the 6510 temperature based on the MSB of $01?

So, is it safe to use $00 and $01 as in my case?
thanx in advance.
2012-02-23 09:57
Cruzer

Registered: Dec 2001
Posts: 1048
lda $00,x isn't faster than lda $0a00,x - so the only optimization is that it uses a byte less.
2012-02-23 14:06
ready.

Registered: Feb 2003
Posts: 441
true, sorry, I meant this:
So instead of:

lda $0a00
sta ZP
lda (ZP),y

I would like to use this optimized version:

lda $00
sta ZP
lda (ZP),y

gaining 2 cycles.
2012-02-23 14:12
chatGPZ

Registered: Dec 2001
Posts: 11136
the state of the unused bits is undefined... its similar to open i/o space (well infact, thats exactly what it is =P)
2012-02-23 16:07
Cruzer

Registered: Dec 2001
Posts: 1048
Ready: Ok, I see, except you would only gain 1 cycle :)
Yeah, it's too bad about $00-01, I could really have used them a lot of times myself.
2012-02-23 17:32
ready.

Registered: Feb 2003
Posts: 441
yes, true again, 1 cycle :) Being sick at home and having to look after the kids is not the best coding environment for concentrating :)
2012-02-24 17:00
Count Zero

Registered: Jan 2003
Posts: 1825
And isn't $01 always $7x on a c128?
2012-02-24 18:33
Ninja

Registered: Jan 2002
Posts: 406
http://unusedino.de/ec64/technical/aay/c64/zp01.htm

Think about all those poor Flash8-users, too ;)
2012-02-24 21:33
iAN CooG

Registered: May 2002
Posts: 3136
Quote: And isn't $01 always $7x on a c128?


press "ascii-din" and bit 6 will be set to 0 also in 64mode.
2012-03-10 07:13
Flavioweb

Registered: Nov 2011
Posts: 447
Quote:

P0-P5 This is the built-in 6 bit I/O port. Each line can be individually
programmed as input or output. A data direction register and a data
register are internally mapped to addresses 0 and 1, respectively.
You may therefore expect that the processor cannot access the RAM
addresses 0 and 1 (as they are overlayed by the I/O port)...
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
DeeKay/Crest
Asphodel
csabanw
Elder0010/G★P
Mr SQL
celticdesign/G★P/M..
saimo/RETREAM
Guests online: 113
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.045 sec.