On Sun, 3 Jan 2021 22:40:33 -0000 (UTC), Martin Gregorie
declaimed the following:
>I know that all so-called BASICs differ, some radically from the original
>Dartmouth BASIC. I thought that the context would make it plain that I
>was talking about PICAXE BASIC, which differs enough from traditional
>BASICs to be given another name (labels not numbers for branch
>destinations and subroutines, long names for variables, named constants,
>unsigned arithmetic and comparisons, conditional statement inclusion).
>
PICAXE BASIC and BASIC-Stamp BASICs were optimized for microcontrollers
with GPIO. Unsigned arithmetic maps to an 8-bit GPIO control register quite
well (especially for bit masking). The processor chips have most of their
flash memory filled with a simplified BASIC byte-code interpreter -- one's
application gets downloaded (as byte-code) to a small EEPROM (or worse -- a
large RAM) and is treated as data by the interpreter.
A BS2 has only 32-bytes of RAM, and 6 of those are dedicated to GPIO
input, output, and direction control. That leaves just 13 16-bit variables
or 26 8-bit variables. The BS2 does allow defining variables and bit,
nybble, byte, or word -- and the compiler does its best to optimize the RAM
allocation. The manual does imply that the BS2 supports signed 16-bit
values -- but when outputting them (debug print) one needs to specify the
SDEC formatter, otherwise one gets an unsigned representation.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|