There is a single array @, and it starts at the first byte of free memory after the parse area. The ^ variable stores the address of the start of the array. If I input LANDER.BAS (the classic LUNAR LANDER game) then PRINT ^ gives 1502. This means that Lunar Lander occupies 414 bytes (1502 - 1024 (start of RAM) - 64 (variable storage area)). Free memory is 2048 - 1502 = 546, but some of this is used by INPUT and for the stack.
There is no range checking on the array index, and the index can be negative. This means that @ can be used to access the whole of memory. This can be used in lieu of PEEK and POKE. PRINT @(-(^+1)/2) shows the 16-bit value at address 0000.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.