Today we'll look through the Commodore 64 6510 assembly language source of the Benchmark BASIC utility. Even if you have no interest in the benchmarking aspects, we'll cover a wide variety of development techniques, including: use of the Turbo Macro Pro assembler, softpatching the C64 ROMs, fixing the ?OUT OF MEMORY error, great resources for understanding the BASIC and KERNAL codebase, how location 1's memory control really works, how to use BASIC's floating point math routines, and even more.
To support 8Bit Show And Tell:
Become a patron: / 8bitshowandtell
Onetime donation: https://paypal.me/8BitShowAndTell
2nd channel: / @8bitshowandtell247
Download the Benchmark BASIC .d64 (see instructions below, and in video):
https://8bitshowandtell.com/downloads...
Links mentioned in video:
Original Benchmark BASIC video: • Fastest C64 10 PRINT (oneline) With ...
Block Transfer fix: • Fixing a Bug in Rodnay Zaks' "Program...
PageTable: https://www.pagetable.com/c64ref/c64d...
Tool Kit video: • 8Bit Book Club: Tool Kit: BASIC and ...
CodeBase: https://codebase64.org/doku.php?id=ba...
Transactor Anthology: https://archive.org/details/transacto...
Greg's C64 OS 6510 port article: https://c64os.com/post/6510procport
Advanced machine language: https://archive.org/details/The_Advan...
TI$ video: • Commodore 64 and 128 TIME: Exploratio...
To use: mount/attach the .d64 image
LOAD"BENCHMARK BASIC",8,1
SYS 49152 to start
STOP+RESTORE keys to disable
To load the source code (requires REU):
LOAD"TMP+REU",8,1
SYS 32768
to view disk directory: [back arrow] *
to load: [back arrow] L
file name: bb33 (or whatever latest filename is on disk)
cursor keys to navigate source file
[back arrow] 3
press S to start
The REU is required to assemble to RAM at $C000 (where Benchmark BASIC lives) because Turbo Macro Pro also uses that memory range. But if you don't have access to an REU, a workaround is to assemble to disk with [back arrow] 5, and then give a filename. Once assembly is complete, you can reset the computer, load the object code with ,8,1 and SYS 49152 to start it.
Index:
0:00 Recap about Benchmark BASIC use
2:08 How to load the source in Turbo Macro Pro
4:28 About the $C000 origin, and why REU
8:50 SEI: Set Interrupt Disable
10:06 ?OUT OF MEMORY ERROR fix
13:53 ROM copy routine
18:06 Modify READY. prompt
19:20 Resources: PageTable.com and Dan Heeb's Tool Kit books
21:34 Patching RUN
23:00 Location 1: Switching out the ROMs
28:46 When RUN is typed... more patching
32:14 Jiffy Clock reset, handing control back
34:12 Just scrolling once, the wonders of C='s screen editor
38:44 Final cleanup
40:18 About BASIC's floatingpoint routines
43:10 Stashing, printing, converting, dividing floating points
48:36 ENDing
49:51 Conclusion, thanks!