Uploaded May 2022 | Updated November 2026, 3 hours ago
How to deal with memory in commodore basic. How much available memory do we have on commodore 64?
Explaining how FRE command works, a command that calculates the amount of free memory in basic and does garbage collection on commodore 64.
If You like this video you can buy me a coffee: ko-fi.com/josipretrobits
Code used in this video: github.com/josipk/Commodore64/blob/main/free_memory_c64.txt
Amount of free memory in basic:
?fre(0)+65536*(fre(0){less then}0)
or
sys46374
?(peek(52)-peek(50))*256+(peek(51)-peek(49))
Index:
0:00 - Intro
0:31 - How to use FRE() command
5:07 - Strings in Commodore Basic and effects on memory
7:40 - Garbage collector in Commodore Basic
12:37 - Explaining FRE() command
14:15 - Commodore Basic Memory Map and Stack
17:25 - FRE() command, Assembly code
20:05 - How little is 38911 bytes
23:09 - Memory difference between an array of integers and floats
26:00 - Garbage collector performance
30:12 - Forcing Commodore 64 to run out of the memory
33:07 - Conclusion and The End
How to deal with memory in commodore basic. How much available memory do we have on commodore 64?
Explaining how FRE command works, a command that calculates the amount of free memory in basic and does garbage collection on commodore 64.
If You like this video you can buy me a coffee: ko-fi.com/josipretrobits
Code used in this video: github.com/josipk/Commodore64/blob/main/free_memory_c64.txt
Amount of free memory in basic:
?fre(0)+65536*(fre(0){less then}0)
or
sys46374
?(peek(52)-peek(50))*256+(peek(51)-peek(49))
Index:
0:00 - Intro
0:31 - How to use FRE() command
5:07 - Strings in Commodore Basic and effects on memory
7:40 - Garbage collector in Commodore Basic
12:37 - Explaining FRE() command
14:15 - Commodore Basic Memory Map and Stack
17:25 - FRE() command, Assembly code
20:05 - How little is 38911 bytes
23:09 - Memory difference between an array of integers and floats
26:00 - Garbage collector performance
30:12 - Forcing Commodore 64 to run out of the memory
33:07 - Conclusion and The End










