| |
oziphantom
Registered: Oct 2014 Posts: 478 |
KERNAL IO and the safe memory regions
Does anybody have a handy dandy list of "places that need to be saved" for KERNAL drive IO on
C64
C128
C+4
I know the IDE64 docs have a 64 list. |
|
... 8 posts hidden. Click here to view all posts.... |
| |
Comos
Registered: May 2004 Posts: 71 |
Depends which Kernal call you are acutally executing,some ZP addys can be overwritten temporarily.
Example when calling OPEN (when SETLFS and SETNAM are done before with a valid drive number @ $BA), ZP addy like $90 must be set to $00, because it's updated by OPEN ,other ZP that must be set $98=$00,$99=$00,$9A=$03 , or just call $FFE7 if some heavy ZP use is done before and these address are not relevant afterwards.
During CHKIN or CHKOUT, index tables @ $259-276 must not be tampered (if we are opening just one file,then the index table quite small), that counts also for $99 and $9a.
During CHRIN/CHROUT, the $99 & $9a still must be not tampered.
If the device is Kernal serial calls dependant, the ZP addy $02A1 must remain set to $00 during CHKIN/CHKOUT.
The vector table starting from $0314-$0333 needs to be preserved too, if you need to maintain compatability. |
| |
TWW
Registered: Jul 2009 Posts: 541 |
If you can afford the Y-Register you shave of 7 cycle pr byte swapped and save a couple of bytes;
swapzp:
sei
lda #$34
sta $01
ldx #$02
swapzp2:
lda $00,x
ldy zpstore,x
sty $00,x
sta zpstore,x
inx
bne swapzp2
lda #$35
sta $01
rts
|
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Not sure if it's really necessary to post really trivial code that can be and was described in a few words, then show how to make it even more trivial. |
| |
TWW
Registered: Jul 2009 Posts: 541 |
Awww… show me on the doll here where the trivial code touched you.. |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
Quote: Awww… show me on the doll here where the trivial code touched you..
ROFL!
(not funny because of what krill said or whatever, just in itself) |
| |
oziphantom
Registered: Oct 2014 Posts: 478 |
results so far, C64 and C128 are done. +4 is being the special kooky butterfly we all hate it for...
AE/AF are modified by the "test code" and C1/2 is also used by the test code.
This does a "send command", save file, load, scratch file, save SEQ, load SEQ file.
C64
0090 rw
0091 r
0093 rw
0094 rw
0095 rw
0098 rw
0099 rw
009a rw
009d rw
00a3 rw
00a4 rw
00a5 rw
00ac rw
00ad rw
00ae rw
00af rw
00b7 rw
00b8 rw
00b9 rw
00ba rw
00bb rw
00bc rw
00c1 rw
00c2 rw
00c3 w
00c4 w
0259 rw
0263 rw
026d rw
02a1 r
031a r
031b r
031c r
031d r
031e r
031f r
0320 r
0321 r
0322 r
0323 r
0324 r
0325 r
0326 r
0327 r
0328 r
0329 r
0330 r
0331 r
0332 r
0333 r
c128 2-138,200-3ff,800-1300
0090 rw
0091 rw
0092 rw
0093 w
0094 rw
0095 rw
0098 rw
0099 rw
009a rw
009d rw
009e w
009f rw
00a0 r
00a1 r
00a2 rw
00a3 rw
00a5 rw
00ac rw
00ad rw
00ae rw
00af rw
00b7 rw
00b8 rw
00b9 rw
00ba rw
00bb rw
00bc rw
00c0 w
00c1 rw
00c2 rw
00c3 w
00c4 w
00c6 r
00c7 r
00d3 w
00d4 rw
00d5 w
00d7 r
00d8 r
00d9 r
00e0 r
00e1 r
00e2 rw
00e3 rw
00ec r
00f1 r
02aa w
0314 r
0315 r
031a r
031b r
031c r
031d r
031e r
031f r
0320 r
0321 r
0322 r
0323 r
0324 r
0325 r
0326 r
0327 r
0328 r
0329 r
0330 r
0331 r
0332 r
0333 r
0362 rw
036c rw
0376 rw
08a9 r
09a9 r
0a03 r
0a04 r
0a0f r
0a1c rw
0a1d rw
0a25 rw
0a26 rw
0a27 r
0a28 rw
0a29 rw
0a2a rw
0a2c r
0a35 rw
0a36 rw
0a37 rw
0a38 rw
0a3a r
10a9 r
11d6 r
11d7 r
11d8 r
11d9 r
11da r
11db r
11dc r
11dd r
11de r
11df r
11e0 r
11e1 r
11e2 r
11e3 r
11e4 r
11e5 r
11e6 r
1224 r
1226 r
1228 r
1285 r
1286 r
1287 r
12fd rw
although the 128 doesn't show any executes for the 02a2-02fb range.. the 02aa shows that FETCH 02a2 was used.
The 128 also seems to have some IRQ values dirtying it. |
| |
oziphantom
Registered: Oct 2014 Posts: 478 |
so when the Vice docs in the emulator say trace does load store exec by default, what it means is load store by default ;)
Correct C128 values
0090 wr
0091 wr
0092 wr
0093 wr
0094 wr
0095 wr
0098 wr
0099 wr
009a wr
009d wr
009e wr
009f wr
00a3 wr
00a5 wr
00ac wr
00ad wr
00ae wr
00af wr
00b7 wr
00b8 wr
00b9 wr
00ba wr
00bb wr
00bc wr
00c1 wr
00c2 wr
00c3 w
00c4 w
00c6 r
00c7 r
02a2 re
02a3 r
02a4 r
02a5 re
02a6 r
02a7 r
02a8 re
02a9 re
02aa wr
02ab re
02ac r
02ad r
02ae re
02af re
02b0 re
02b1 r
02b2 r
02b3 re
02b4 r
02b5 r
02b6 re
02b7 re
02b8 re
02b9 wr
02ba re
02bb r
02bc r
02bd re
02be r
02bf r
02c0 r
02c1 r
031a r
031b r
031c r
031d r
031e r
031f r
0320 r
0321 r
0322 r
0323 r
0324 r
0325 r
0326 r
0327 r
0328 r
0329 r
0330 r
0331 r
0332 r
0333 r
0362 wr
036c wr
0376 wr
0a0f r
0a1c wr
0a35 wr
0a37 wr
0a38 wr
0a3a r
and the +4
0038 r
0090 rw
0091 r
0093 rw
0094 r
0095 w
0097 rw
0098 rw
0099 rw
009a rw
009b rw
009c rw
009d rw
009e rw
00ab rw
00ac rw
00ad rw
00ae rw
00af rw
00b0 rw
00b2 rw
00b3 rw
00b4 w
00b5 w
00ba rw
00d8 rw
00d9 rw
00f9 rw
0318 r
0319 r
031a r
031b r
031c r
031d r
031e r
031f r
0320 r
0321 r
0322 r
0323 r
0324 r
0325 r
0326 r
0327 r
032e r
032f r
0330 r
0331 r
0509 rw
0513 rw
051d rw
05e8 rw
07d9 er
07da re
07db re
07dc r
07dd r
07de re
07df rw
07e0 re
07e1 r
07e2 r
07e3 re
07e4 re
07e5 r
07e6 r
07e7 r
07e8 r |
| |
Peiselulli
Registered: Oct 2006 Posts: 81 |
Where is the list of VIC20 ? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11114 |
"so when the Vice docs in the emulator say trace does load store exec by default, what it means is load store by default ;)"
that shouldnt be the case - please report a bug |
| |
mr.micro
Registered: Aug 2010 Posts: 5 |
Quote: Awww… show me on the doll here where the trivial code touched you..
LMFAO!! |
Previous - 1 | 2 - Next |