Galaksija BASIC
Encyclopedia
Galaksija BASIC was the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

 of the Galaksija
Galaksija
The Galaksija was originally a build-it-yourself computer designed by Voja Antonić. It was featured in the special edition Računari u vašoj kući of a popular eponymous science magazine, published late December 1983 in Belgrade, Yugoslavia...

 build-it-yourself home computer
Home computer
Home computers were a class of microcomputers entering the market in 1977, and becoming increasingly common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single nontechnical user...

 from Yugoslavia
Socialist Federal Republic of Yugoslavia
The Socialist Federal Republic of Yugoslavia was the Yugoslav state that existed from the abolition of the Yugoslav monarchy until it was dissolved in 1992 amid the Yugoslav Wars. It was a socialist state and a federation made up of six socialist republics: Bosnia and Herzegovina, Croatia,...

. While being partially based on code taken from TRS-80
TRS-80
TRS-80 was Tandy Corporation's desktop microcomputer model line, sold through Tandy's Radio Shack stores in the late 1970s and early 1980s. The first units, ordered unseen, were delivered in November 1977, and rolled out to the stores the third week of December. The line won popularity with...

 Level 1 BASIC, which the creator believed to have been a Microsoft BASIC
Microsoft BASIC
Microsoft BASIC was the foundation product of the Microsoft company. It first appeared in 1975 as Altair BASIC, which was the first BASIC, and the first high level programming language available for the MITS Altair 8800 hobbyist microcomputer....

, the extensive modifications of Galaksija BASIC—such as to include rudimentary array
Array data type
In computer science, an array type is a data type that is meant to describe a collection of elements , each selected by one or more indices that can be computed at run time by the program. Such a collection is usually called an array variable, array value, or simply array...

 support, video generation code (as the CPU itself did it in absence of dedicated video circuitry) and generally improvements to the programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

—is said to have left not much more than flow-control
Control flow
In computer science, control flow refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are executed or evaluated....

 and floating point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...

 code remaining from the original.

The core implementation of the interpreter was fully contained in the 4 KiB ROM "A" or "1". The computer's original mainboard had a reserved slot for an extension ROM "B" or "2" that added more commands and features such as a built-in Zilog Z80
Zilog Z80
The Zilog Z80 is an 8-bit microprocessor designed by Zilog and sold from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes...

 assembler.

ROM "A"/"1" symbols and keywords

The core implementation, in ROM "A" or "1", contained 3 special symbols and 32 keywords:
  • ! - begins a comment
    Comment
    A comment is generally a verbal or written remark often related to an added piece of information, or an observation or statement. These are usually marked with an abbreviation, such as "obs." or "N.B."...

     (equivalent of standard BASIC REM command)
  • # - Equivalent of standard BASIC DATA statement
  • & - prefix for hex
    Hexadecimal
    In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

     numbers
  • ARR$(n) - Allocates an array of strings, like DIM, but can allocate only array with name A$
  • BYTE serves as PEEK
    PEEK and POKE
    In computing, PEEK is a BASIC programming language extension used for reading the contents of a memory cell at a specified address. The corresponding command to set the contents of a memory cell is POKE.-Statement syntax:...

     when used as a function (e.g. PRINT BYTE(11123)) and POKE
    PEEK and POKE
    In computing, PEEK is a BASIC programming language extension used for reading the contents of a memory cell at a specified address. The corresponding command to set the contents of a memory cell is POKE.-Statement syntax:...

     when used as a command (e.g. BYTE 11123,123).
  • CALL n Calls BASIC subroutine as GOSUB in most other BASICs (e.g. CALL 100+4*X)
  • CHR$(n) converts an ASCII
    ASCII
    The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

     numeric code into a corresponding character (string)
  • DOT x, y draws (command) or inspects (function) a pixel at given coordinates (0<=x<=63, 0<=y<=47).
  • DOT * displays the clock or time controlled by content of Y$ variable. Not in standard ROM
  • EDIT n causes specified program line to be edited
  • ELSE standard part of IF-ELSE construct (Galaksija did not use THEN)
  • EQ - compare alphanumeric values X$ and Y$
  • FOR standard FOR loop
    For loop
    In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement....

  • GOTO standard GOTO
    Goto
    goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control...

     command
  • HOME equivalent of standard BASIC CLS
    Cls (computing)
    cls is a command used by the command line interpreters COMMAND.COM and cmd.exe on DOS, OS/2 and Microsoft Windows operating systems to clear the screen or console window of commands and any output generated by them. It does not clear the user's history of commands, however...

     command - clears the screen
  • HOME n protects n characters from the top of the screen from being scrolled away
  • IF standard part of IF-ELSE construct (Galaksija did not use THEN)
  • INPUT user entry of variable
  • INT(n) a function that returns the greatest integer value equal to or lesser than n
  • KEY(n) test whether a particular keyboard
    Computer keyboard
    In computing, a keyboard is a typewriter-style keyboard, which uses an arrangement of buttons or keys, to act as mechanical levers or electronic switches...

     key is pressed
  • LIST lists the program. Optional numeric argument specifies the first line number to begin listing with.
  • MEM returns memory consumption data (need details here)
  • NEW clears the current BASIC program
  • NEW n - clears BASIC program and moves beginning of BASIC area
  • NEXT - standard terminator of FOR loop
    For loop
    In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement....

  • OLD - loads a program from tape
  • OLD n - loads program to different address
  • PTR - Returns address of the variable
  • PRINT - Printing numeric or string expression.
  • RETURN - Return from BASIC subroutine
  • RND - function (takes no arguments) that returns a random number between 0 and 1.
  • RUN - runs (executes) BASIC program. Optional numeric argument specifies the line number to begin execution with.
  • SAVE - saves a program to tape. Optional two arguments specify memory range to be saved (need details here).
  • STEP - standard part of FOR loop
    For loop
    In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement....

  • STOP stops execution of BASIC program
  • TAKE - replacement for READ and RESTORE. If the parameter is variable name, acts as READ, if it is number, acts as RESTORE
  • UNDOT x, y "undraws" (resets) at specified coordinates (see DOT)
  • UNDOT * - Stops the clock, not part of ROM
  • USR - Calls machine code subroutine
  • WORD - Double byte PEEK and POKE

ROM "B"/"2" additional symbols and keywords

The extended BASIC features, in ROM "B" or "2", contained one extra reserved symbol and 22 extra keywords:
  • %
  • /LABEL
  • ABS(x)
  • ARCTG(x)
  • COS(x), COSD(x)
  • DEL
  • DUMP
  • EXP(x)
  • INP(x)
  • LDUMP
  • LLIST
  • LN(x)
  • LPRINT
  • OUT
  • PI
  • POW(x,y)
  • REN
  • SIN(x), SIND(x)
  • SQR(x)
  • TG(x), TGD(x)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK