12

After loading a file list from a floppy disk it is hard to program in BASIC because the file list is interpreted as BASIC lines.
For example there can be 20 lines with the number 1, because 20 files have a file size of one, so to delete them, you have to type 1+RETURN 20 times.

Is there a way to use BASIC in this case without having to Soft Reset or Hard Reset the C64?

21

Try using the "new" command. This clears BASIC's memory, so that you can write a new program.

7

A workaround is to load the DOS WEDGE from the 1541 Demo Disk. Once installed, it enables several disk commands without interfering with the BASIC memory. For example @$ will list the directory without overwriting BASIC memory.

  • 7
    "Sell you a disk drive that could independently run your computer code? Sure. Sell you a disk drive to which you can save your code without having first memorised your disk's contents? You'll need a software extension for that." – Tommy Sep 6 '17 at 20:21
2

The best way is to have some sort of accessory program installed. There are a few options:

  • on the Commodore 1541 test/demo disk there is a program called "DOS WEDGE". You can load and run this, and it will take a little memory (I think at $C000, 49152, but it might be in the cassette buffer instead) with a little machine language program that will let you do a directory. I believe you type >$ (it might just be $). > by itself will also let you read the disk drive error channel. This test/demo disk came for free with the 1541 drive, and you should be able to find disk images of it online; all the contents are public domain and are freely redistributable.
  • some fast load cartridges like Epyx Fast Load have a wedge-like capability too which will let you pull a directory.
  • the Commodore 128, 16 and Plus/4 (plus PETs/CBMs that had BASIC 4.0) have a DIRECTORY command (you can also use CATALOG, which I tended to use instead because c-shift-A was the abbreviation instead of d-i-shift-R). This lets you pull a directory without erasing an existing program in BASIC memory.

You can clear existing BASIC programs (and directories loaded via LOAD"$",x) with the NEW command, and you can also reset the C64 entirely via the command SYS64738, which is the equivalent of a soft reset of the entire system and will reset things to the initial power-up screen.

2

You might also try to start the BASIC program on a different location.

It is determined by the values of the bytes 43, 44. By default the BASIC starts at 2048, thus the values are 1 in 43 and 8 in 44. (The 1 might be some rounding reason ;-) ). But you can change it.

More exactly:

POKE 43, 1: POKE 44, 192

will move the start of the BASIC program to 49152, where you have free 4kB to load the directory. After you got your list, you can move the BASIC area back to 2048.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.