Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tiny BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Basic concepts=== {{See also|BASIC interpreter#Compilers vs. interpreters|l1=BASIC interpreters}} Tiny BASIC was designed to use as little memory as possible, and this is reflected in the paucity of features as well as details of its [[BASIC interpreter|interpreter system]]. Early microcomputers lacked the RAM and [[secondary storage]] for a BASIC [[compiler]], which was more typical of timesharing systems. Like most BASICs of the era, Tiny Basic was interactive with the user typing statements into a command line. As microcomputers of the era were often used with teletype machines or "dumb" terminals, direct editing of existing text was not possible and the editor instead used takeout characters, often the backslash, to indicate where the user backed up to edit existing text. If the user typed a statement into the command line the system examined it to see if it started with a number. If it did not, the line was immediately parsed and operated on, potentially generating output via {{code|PRINT}}. This was known as "direct mode". If the line was entered with a leading number, the number was converted from decimal format, like "50", and converted to a 8-bit value, in this case, {{code|$32}} [[hexadecimal]]. This number was used as an index into an [[array]]-like storage area where the rest of the line was stored in exactly the format it was typed. When the user typed {{code|LIST}} into the command line the system would loop over the array, convert the line number back to decimal format, and then print out the rest of the text in the line. When a program was present in memory and the user types in the {{code|RUN}} command, the system enters "indirect mode". In this mode, a pointer is set to point to the first line of the program, for instance, 10 ({{mono|{{#invoke:BaseConvert|10to16|10|width=2|prefix=$|suffix={{sub|hex}}}}}}). The original text for that line is then retrieved from the store and run as if the user had just typed it in direct mode. The pointer then advances to the next line and the process continues.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)