Category:Sinclair ZX81 BASIC: Difference between revisions

Content added Content deleted
mNo edit summary
mNo edit summary
Line 8: Line 8:
The ZX81 has no moving parts and only four microchips: the 3.25MHz Z80 CPU, an 8k ROM chip containing the operating system and BASIC, a 1k RAM chip, and an uncommitted logic array. Since there is no separate video chip, the CPU spends about 75% of its time driving the display and only 25% doing everything else. This can, however, be controlled under BASIC using the <code>FAST</code> and <code>SLOW</code> commands: <code>FAST</code> blanks the screen and allows the processor to operate at full speed, and <code>SLOW</code> reverts to the default behaviour. Even <code>FAST</code> mode can be slower than some other BASIC dialects running on comparable hardware, because ZX81 BASIC has no integer type: all numeric operations have to be done on 40-bit floats using software floating-point routines.
The ZX81 has no moving parts and only four microchips: the 3.25MHz Z80 CPU, an 8k ROM chip containing the operating system and BASIC, a 1k RAM chip, and an uncommitted logic array. Since there is no separate video chip, the CPU spends about 75% of its time driving the display and only 25% doing everything else. This can, however, be controlled under BASIC using the <code>FAST</code> and <code>SLOW</code> commands: <code>FAST</code> blanks the screen and allows the processor to operate at full speed, and <code>SLOW</code> reverts to the default behaviour. Even <code>FAST</code> mode can be slower than some other BASIC dialects running on comparable hardware, because ZX81 BASIC has no integer type: all numeric operations have to be done on 40-bit floats using software floating-point routines.


The original machine's 1k of RAM was shared between the display, the system variables and stack, and the user's program and variables. The Timex-branded model marketed in the United States had a minimum of 2k, as did many clones; an expansion pack was available from Sinclair to increase the RAM to 16k, and expansions of other sizes were produced by third parties.
The original machine's 1k of RAM was shared between the display, the system variables and stack, and the user's program and variables. The Timex-branded model marketed in the United States had a minimum of 2k, as did many clones; an expansion pack was available from Sinclair to increase the RAM to 16k, and expansions of other sizes were produced by third parties. Most ZX81 BASIC programs on Rosetta Code will work with the 1k configuration, but unfortunately some of them require 2k. The minimum RAM requirement is usually stated in a note to the program: where it is omitted, it can be assumed to be 1k.


A PDF version of the manual, <cite>ZX81 BASIC Programming</cite> by Steve Vickers, is available [http://zxnext.narod.ru/manuals/ZX81_Manual.pdf here].
A PDF version of the manual, <cite>ZX81 BASIC Programming</cite> by Steve Vickers, is available [http://zxnext.narod.ru/manuals/ZX81_Manual.pdf here].