BASIC loader

From Wikipedia, the free encyclopedia
Jump to: navigation, search

A BASIC loader is a computer programming technique used with the BASIC programming language to POKE machine language opcodes into RAM. The technique was most prevalent in type-in program listings published for home computers of the 1980s as it allowed the publication of programs that gained the benefits of fast-executing assembly language without requiring the user to own or know how to operate an assembler or machine language monitor program.[1]

The programs most often took the form of a short "stub" loader followed by a (sometimes lengthy) series of DATA statements that contained the core program logic as decimal opcodes. The loader mainly consisted of a For loop that enumerated the DATA statements and POKEd them into memory. The starting location for the POKEs was determined by the memory map of the platform in question; some loaders were able to distinguish between related platforms and alter the starting address based on what it found. Sometimes the DATA statements were in hexadecimal, in which case the loader would contain code to translate from hex to the decimal numbers demanded by the POKE command. After inserting the assembly language program into memory, the loader program could use BASIC's SYS command to initiate execution of the assembly language code from a designated entry point.