Back to Browse

Adding Command Line-esque Parameters to C64 and C128 Programs

22.7K views
Jan 2, 2024
27:41

It's actually pretty easy to add support for command-line-style parameters to Commodore 64 and Commodore 128 programs by reading the line input buffer with some PEEKs. We examine how to do this, why this might be beneficial, and give some example code in BASIC and Assembly. We also learn a bit about how BASIC parses and interprets our code, and the internal structure of these commands and programs. And we look at the Commodore 128 feature to RUN a file from disk that further enhances the use of parameters. Download the D64 of today's code: https://8bitshowandtell.com/downloads/runparams.d64 To support 8-Bit Show And Tell: Become a patron: https://patreon.com/8BitShowAndTell One-time donation: https://paypal.me/8BitShowAndTell 2nd channel: https://youtube.com/channel/UCAgWzEh5c8391eJnELDy9OA Previous videos referenced: "About Commodore 64 BASIC Abbreviations": https://youtu.be/AYhuPM0KH1o "Cracking a Commodore 64 Game From Cassette: Livingstone, I Presume?": https://youtu.be/DDErGI2c7zk "4-Byte Commodore 64 Demo and Follow-up on 10 PRINT Orthogonal [32 bytes]": https://youtu.be/aMaMzsL9vVQ "Using Commodore 64 BASIC SYS Parameters in Machine Language": https://youtu.be/3ZV8LtpMbvA Index: 0:00 Can parameters be added to a Commodore BASIC program? 1:57 How EXAMPLE 1 works 5:42 What's the point? 7:15 Some problems 9:12 EXAMPLE 2: More Robust 10:55 BORDER: A slightly more useful example 14:28 Rhymes with Orange: a tokenization problem 16:02 Commodore 128 Mode: RUN "FILENAME" 18:30 Turbo Macro Pro: Assembly example 19:52 BASIC Header / Stub 21:13 TXTPTR / rest of code walkthrough 24:35 Modifying for border colour version 25:36 Thanks!

Download

1 formats

Video Formats

360pmp440.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.