Category: Amstrad CPC

Passing Code Pointers as Data in Amstrad CPC BASIC

0 commentsAmstrad CPCAssemblerBASICUncategorizedZ80Amstrad CPCassemblerbasiccodingZ80

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

Variables, DEF FN Definitions and Arrays Storage in Amstrad CPC/Locomotive BASIC

2 commentsAmstrad CPCBASICUncategorizedAmstrad-CPCarraysbasicDEF FNsexecution-stackmemoryreverse-engineeringvariables

(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