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 > Saving files using Kernal
2003-05-15 14:09
HCL

Registered: Feb 2003
Posts: 716
Saving files using Kernal

Does anyone know if it's possible to save a file with a different starting adress than the current one?

I just learned some months ago (thanx iopop :) that when using ActionReplay monitor, you can type:

S "MY FILE",8,1000,2000,5000

..and the memory between $1000 and $2000 will be saved, but with the starting adress $5000. Is it possible to achieve this using the Kernal Save ($ffd8 or something..)?
2003-05-15 16:22
White Flame

Registered: Sep 2002
Posts: 136
The KERNAL takes start and end addresses as parameters, and stores the start address at the beginning of the file. You're going to have to open the file and write out the 1st two bytes yourself. After that, either dump the bytes to the file with your own loop, or see if you can jump into the KERNAL SAVE routine at the point after which it saves the SA (which would probably require more setup than simply dumping the bytes yourself).
2003-05-15 22:13
Krill

Registered: Apr 2002
Posts: 2804
HCL: are you _the_ hcl? just wondering because i didnt expect such a question from you.
2003-05-15 22:26
raven
Account closed

Registered: Jan 2002
Posts: 137
what Krill said ^_^
2003-05-15 23:06
Steppe

Registered: Jan 2002
Posts: 1509
Nah, that was me using one of my multiple accounts... ;-)
2003-05-16 07:24
HCL

Registered: Feb 2003
Posts: 716
> Krill, Raven: are you _the_ hcl? just wondering because i
> didnt expect such a question from you.

Why not? What's your problem? Of course i'm _the_ HCL! Why wouldn't i dare asking such a question?

Thanx White Flame for the answer, which i consider to be; no, the Kernal does not support that feature.

Anyone else?
2003-05-16 12:20
Stryyker

Registered: Dec 2001
Posts: 465
As the kernel is, it cannot do as you want using the SAVE routine.

Why not write your own? It isn't that hard and $0334 is just nice for it. I remember when I was learning to code and didn't have any hardware like AR - closest was a paper clip to reset :) Just add an extra 2 bytes in zp for load address like, after SETLFS and SETNAM has been used, lda #<start, sta ZP, lda #>start, sta ZP+1, lda #<loadad, sta ZP+2, lda #>loadad, sta ZP+3. lda #ZP, ldx #<save+1, ldy #>save+1, jsr SAVE after you have redirected $0332/$0333 (in a wedge type formation) and use the standard file byte writing. Maybe even checking ZP+2 ora ZP+3 and if =0 then write first byte address as start address, else write contents of ZP+2, ZP+3. You could then add some extras to save under IO and ROMs. Should be very short code.
2003-05-19 07:40
HCL

Registered: Feb 2003
Posts: 716
Ok, thank you very much, i think i have the answer i needed in this topic.

>> Stryyker: Why not write your own?

:), well, i just thought maybe for once i could avoid writing *my own*. The saver was ment for ByteBoozer (released today), and every extra byte in the code will make the cruncher less able to handle large files.

The shortest way, i think, was to transfer the file before saving. Done.
2003-05-19 08:23
Krill

Registered: Apr 2002
Posts: 2804
Quote: > Krill, Raven: are you _the_ hcl? just wondering because i
> didnt expect such a question from you.

Why not? What's your problem? Of course i'm _the_ HCL! Why wouldn't i dare asking such a question?

Thanx White Flame for the answer, which i consider to be; no, the Kernal does not support that feature.

Anyone else?


Hi David,

well the point is not about you _daring_ to ask such a question but about you as one of the few good c64 coders not knowing about those kernel details. but don't take this as an offence, i was just wondering and, if i was you, would check the kernel myself (preferably a kernel disassembly, of course).

but well, you make me wonder sometimes anyway with what you write in scrolltexts and demo notes, making the impression that it's lame to analyze others' code. i learnt almost everything hacking around in the monitor. but that aside,

just go on producing ruling code =D
2003-05-19 09:31
HCL

Registered: Feb 2003
Posts: 716
Krill:

Well, you're right.. Of course i probably *could* examine the Kernal and find out the answer myself. But i was short of time, and personally i don't really *like* examining the Kernal, not using it at all :). I just thought that i could use this brilliant web-portal to get the answer quickly!

Btw. *what* scrolltext and notes do you refer to Gunnar?
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
apprentix
jmin
kbs/Pht/Lxt
Dymo/G★P
Laurent
celticdesign/G★P/M..
MAT64
Spinball/Excess
Mason/Unicess
Guests online: 362
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (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 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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