| |
Nightlord Account closed
Registered: Jan 2003 Posts: 131 |
safe zero page addresses
can anybody verify me about whether it is safe to use zero page adresses $14 to $60 considering that no basic code will be run
or are there any more addresses in zero page that are safe to use during assembly coding (besides the $fb-$fe)
thanx |
|
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
hard to say, depends on what kernal routines you use. if it's just I/O routines you use, it should work. same for floating point routines... |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
a small list of zeropage adresses which are free to use:
$92-$96 (only if no datasette is used)
$A3-$B1 (only if no RS-232 and datasette is used)
$F7-$FA (only if no RS-232 is used)
$FB-$FE (always) |
| |
cadaver
Registered: Feb 2002 Posts: 1160 |
I've lived by the rule that at least $02-$7f is OK with ASM programs, as these are all Basic interpreter variables. |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Why don't people get the Programmers Reference Guide or AAY64 or something and test? Too easy? :) |
| |
cadaver
Registered: Feb 2002 Posts: 1160 |
You mean like, change some ZP locations, see if kernal IO still works? A bit unreliable I'd say. Though I agree 100%about the C64 PRG suggestion :) |
| |
cadaver
Registered: Feb 2002 Posts: 1160 |
Ahm, a little correction.. the PRG zeropage descriptions were better than I remembered :) Anyway, I mean that care must be taken when one starts choosing locations above $90 or so, because it might be just luck that things still work.. |
| |
Nightlord Account closed
Registered: Jan 2003 Posts: 131 |
well i have the programming guide and checked the zero page map before. but mine (which is a turkish translation) only has one line explanations for each address. it does not tell which kernal routines or internal hardware buffers are connected to those addresses. maybe the english original version has more info which i will surely check.
so i apologize from people that think i am wasting forum space by this question but i do not think it is a good idea to develop code that uses a potentially unsafe range of locations for its variables. and trying to test those locations by saving data in there and then doing kernal calls and then checking the data integrity should be rather painstaking.
instead i choose to bring it up here so that whole internet can learn from the answers i get. i think that is the point of a coding forum. and it works like this in every sw engineering forum througout the world no matter how many sw engineering books are around. |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Try the english version - a text version should be available at http://project64.c64.org/ or so. |
| |
Nightlord Account closed
Registered: Jan 2003 Posts: 131 |
oh man thanx a lot... the project 64 site should solve all my problems. i did not know of that site.... thanx everyone... |
| |
TDJ
Registered: Dec 2001 Posts: 1879 |
WIsh I found a site that would solve all my problems :) |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
http://www.ampland.com/ will help solve your troubles TDJ. Just take matters into your own hands. |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
If you don't use any kernal routines and have turned off the kernal irqs, all zeropage addresses except $00 and $01 can be used without problems. But notice that most of the zeropage will be overwritten when you reset the 'puter. |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
With some luck you could use $0 or $1 too. I never go it finely tuned but at times could get a sprite to chang appearance using sprite at $0000 |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
I have never experimented much with using $00/01, so I don't really know what the problems are excactly, other than switching randomly between rom/ram/etc., but I suspect changing $00 can halt the CPU or something. It sure would be kewl with a nice full page of "fast memory". Why the f*** didn't CBM put these control registers in $dxxx like the rest?!?
Btw, another problem that usually occurs is if when the music player uses zp-addresses. I usually switch $d018 to $04, so the zeropage shows up on top of the screen, and then play the music to see if any chars are changing. If that's the case you can still use the whole zp, as long as you copy the bytes used by the player somwhere else after calling the player, and then copy them back b4 calling it again. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
@cruzer:
think of it! $0000/$0001 for the processor port is actually one of the better solutions. if you put it at $Dxxx this would mean that you split the C64 memory + lose one bitmap (remember: the processor port cannot be mapped away!). same with the C128 solution where they put the MMU registers at $FF00+ |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
ohyeah, in the VIC article or somewhere else, its written down how to write/read mem locations $00/$01, u can read it
by sprite and bitmap collision detection, and you have to make the vic to read from $00/$01 exactly one cycle after the cpu has written sumth there, or sumth similar :) |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
If you can't find it there, try http://www.funet.fi/pub/cbm/documents/chipdata/64doc |