| |
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.
|
|
| |
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. |
| |
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. |
| |
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) |
| |
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. |
| |
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 :) |
| |
Count Zero
Registered: Jan 2003 Posts: 1932 |
And isn't $01 always $7x on a c128?
|
| |
Ninja
Registered: Jan 2002 Posts: 411 |
http://unusedino.de/ec64/technical/aay/c64/zp01.htm
Think about all those poor Flash8-users, too ;) |
| |
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. |
| |
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)...
|