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: 11386
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: 1932
And isn't $01 always $7x on a c128?
2012-02-24 18:33
Ninja

Registered: Jan 2002
Posts: 411
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: 3194
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: 463
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
Matt
Nordischsound/Hokuto..
Guests online: 92
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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