Passing Code Pointers as Data in Amstrad CPC BASIC
One of my secret coding pleasures is passing a function as a parameter to a subroutine. Most modern languages have what’s called ‘first class code’. That means that you can assign the address of a function to a variable, store it in an array, and pass it as a parameter to a function. This enables …. Read More
How Amstrad CPC BASIC Compresses Error Messages
Amstrad CPC BASIC saves a few bytes by using some interesting compression in the way it stores error messages. Let’s take a look at how it works and how much space it saves. Below is the table of error messages. The messages are stored in what I refer to as ASCII7 format – bit 7 …. Read More
Variables, DEF FN Definitions and Arrays Storage in Amstrad CPC/Locomotive BASIC
(The information in this article comes from reverse engineering Amstrad CPC BASIC. You can find the reverse engineered source code in my CPC BASIC source code repository. You can find an example BASIC program which ‘walks’ the storage areas in the Examples folder of that repository. See also the CPC Wiki page for more technical …. Read More