Page 1 of 1

overwriting a file in TMP

Posted: Thu May 24, 2018 4:34 pm
by shampoocell
I'm sure I'm missing something silly here, but surely I should be able to write to disk to the same file name once I've worked on more code in Turbo Macro Pro on the C64, yes? For example, I work for a night, then write my file to disk either as a sequence (via -> w) or as a binary PRG file (via -> s) and call it "FOO." The next day, I can come back and load "FOO" and write some more code, but if I try to use either command above and write "FOO" to disk again, I get a "file exists" error.

I'm sure I'm missing some newbie step involving writing to disk; what is it??

Re: overwriting a file in TMP

Posted: Thu May 24, 2018 4:55 pm
by John West
It's been a long time since I've used a C64, and I have never used that assembler. But... you could try saving your file as @:FOO (or possibly @0:FOO). I think that was the syntax for "save and replace".

Re: overwriting a file in TMP

Posted: Fri May 25, 2018 12:12 am
by shampoocell
John West wrote:
It's been a long time since I've used a C64, and I have never used that assembler. But... you could try saving your file as @:FOO (or possibly @0:FOO). I think that was the syntax for "save and replace".
You are awesome!! @: did the trick! Thank you so much!

Re: overwriting a file in TMP

Posted: Fri May 25, 2018 4:48 am
by BigDumbDinosaur
shampoocell wrote:
John West wrote:
It's been a long time since I've used a C64, and I have never used that assembler. But... you could try saving your file as @:FOO (or possibly @0:FOO). I think that was the syntax for "save and replace".
You are awesome!! @: did the trick! Thank you so much!
Watch out for @SAVE (save-with-replace). Some Commodore floppy drives have problems with the save-with-replace function and end up trashing the BAM (block allocation map), cross-linking files and otherwise making a mess of the disk. The only Commodore drives I know of that correctly implement save-with-replace are the 1571 with the second revision ROMs and the 1581.