Originally published on: Thu, 06 Aug 2009 01:15:42 +0000
I wrote this little subroutine package for the Commodore 64 in 2002. You can likely still find a cached Usenet post to comp.sys.cbm referring to it.
I thought that I would add in an open-source license header and would present it here.
The source code below is for two machine language library routines which can be called from BASIC. The first routine will save a section of the C64's memory to disk. The second will load a file from disk into a specific spot in memory. These functions are akin to Applesoft BASIC's BSAVE and BLOAD binary I/O commands.
I did not wedge the CHRGET routine to add any new command verbs to BASIC; one must use the SYS command to invoke each subroutine. A jump-table at the beginning of the module controls which of the two functions you'll execute. Address 49152 is the BSAVE routine. Address 49152+3 is the BLOAD routine.
Please note that the filename parameter must always be in a variable. I didn't have the routine that would parse a literal properly readily available ... and still don't remember how to do it off the top of my head. ;-)
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Views expressed in this blog are those of the author and do not necessary reflect those of the author's employer. Views expressed in the comments are those of the responding individual.

Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Click **here**
A JavaScript REPL for Android Devices
A Review of Kevin Mitnick's Book Ghost in the Wires
Play MP3 Files with Python on Windows
Command-Line Image Format Conversion
Changing the C64 Text Color in C
Rhino JavaScript to EXE with launch4j
Getting the Windows Console Text Color
Learning Z-80 Assembly Language on the TRS-80
COM Scripting in C by way of JavaScript
Jim Butterfield : The Commodore Guru
Why Some Web Sites will go Dark on Jan 18th
Book Review : Paull Allen - Idea Man
A 90's Experiment in Online Systems - The U.S. West CommunityLink Service