Difference between revisions of "Merging BASIC programs"

From BeebWiki
Jump to: navigation, search
(.)
 
m
(One intermediate revision by one user not shown)

Revision as of 00:43, 19 June 2010

You can merge two BASIC programs together by loading a second program at the end of the one in memory, but overwriting the end-of-program marker two bytes below TOP.

 >LOAD "part1"
 >OSCLI "LOAD part2 "+STR$~(TOP-2):END

The END is needed to tell BASIC to update its internal pointers. This method is used by the BASIC Make system commonly used with BASIC libraries such as the ones at mdfs.net/blib.