

I started out with P2000T, ZX spectrum and MSX so I stared out with basic just like you.

I never used Z80 back in the day, but I would imagine something like this: Z80 would be a little shorter because it has more registers and can use double-byte instructions. Note that I’ve probably mis-remembered the syntax. To make the comparison fair, we’ll assume that the assembler programmer is clever enough that they’ve managed to store both variables in the zero page to avoid complex addressing, and that the carry bit is already clear.
#DOWNLOAD PROGRAM AT90S2313 WITH ARDUINO PROGRAMMING CODE#
So let’s compare this with the equivalent native code for a 6502. And remember these are 16-bit variables, not 8. The variables would typically not be stored in registers on an 8-bit CPU (registers are precious, after all). In a typical 8-bit interpreted BASIC from the day, the line number and initial space would be stored as a single 16-bit unsigned integer, so your example line would be 7 bytes. Posted in Arduino Hacks Tagged arduino, basic, basic interpreter, c++, tiny BASIC Post navigation Right now, all we know is we’ll be spending the weekend digging through our copies of Dr. Tiny BASIC was originally conceived for the Altair 8800 that shipped with 256 bytes of RAM stock, so it seemed like a perfect fit. says he started this project to see how ‘old bearded ones’ conjured up so many impressive programs with a few kB of RAM. Not much, but more than the lowest-end BASIC Stamp. The BASIC interpreter eats up around 600 bytes in the Arduino RAM, leaving about 1.4 kB for BASIC code. Kernighan and Ritchie said themselves, “code involving a goto can alway be written without one” but found that using goto left a lot more room available for BASIC code.

True to Tiny BASIC’s assembler roots, ’s C port makes extensive use of the “infinitely-abusable” goto statement. The code is meant to be a faithful port of Tiny BASIC for the 68000, and true to Tiny BASIC form, it fits in the very limited RAM of the Arduino. Sent in a project he’s been working on – a port of a BASIC interpreter that fits on an Arduino.
