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
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
A TCP Command Line Interface in Rhino JavaScript
Directory Traversal in Rhino JavaScript
Thwarting HTTP Referer Trackbacks
A Simple Media Control Interface Script Processor
Auto Save Clipboard Images Redux
Getting the Windows Console Text Color
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer