Difference between revisions of "Locomotive BASIC"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(add link to kevs website)
(Command list)
Line 16: Line 16:
 
== Command list ==
 
== Command list ==
  
;ABS
+
=== Commands and operators ===
:Returns the absolute value of the given expresion
+
 
;AFTER
 
;AFTER
:Invoke a subroutine after a given time period has elapsed.
+
: [...]
 +
;AUTO
 +
: [...]
 +
;BORDER
 +
: [...]
 +
;CALL
 +
: [...]
 +
;CAT
 +
: [...]
 +
;CHAIN
 +
: [...]
 +
;CLEAR
 +
: [...]
 +
;CLG
 +
: [...]
 +
;CLOSEIN
 +
: [...]
 +
;CLOSEOUT
 +
: [...]
 +
;CLS
 +
: [...]
 +
;CONT
 +
: [...]
 +
;CURSOR
 +
: [...]
 +
;DATA
 +
: [...]
 +
;DEF
 +
: [...]
 +
;DEFINT
 +
: [...]
 +
;DEFREAL
 +
: [...]
 +
;DEFSTR
 +
: [...]
 +
;DEG
 +
: [...]
 +
;DELETE
 +
: [...]
 +
;DI
 +
: [...]
 +
;DIM
 +
: [...]
 +
;DRAW
 +
: [...]
 +
;DRAWR
 +
: [...]
 +
;EDIT
 +
: [...]
 +
;EI
 +
: [...]
 +
;END
 +
: [...]
 +
;ENT
 +
: [...]
 +
;ENV
 +
: [...]
 +
;ERASE
 +
: [...]
 +
;ERL
 +
: [...]
 +
;ERROR
 +
: [...]
 +
;EVERY
 +
: [...]
 +
;FILL
 +
: [...]
 +
;FN
 +
: [...]
 +
;FOR TO STEP NEXT
 +
: [...]
 +
;FRAME
 +
: [...]
 +
;GOSUB
 +
: [...]
 +
;GOTO
 +
: [...]
 +
;GRAPHICS
 +
: [...]
 +
;IF THEN ELSE
 +
: [...]
 +
;INK
 +
: [...]
 +
;INPUT
 +
: [...]
 +
;KEY
 +
: [...]
 +
;LET
 +
: [...]
 +
;LINE
 +
: [...]
 +
;LIST
 +
: [...]
 +
;LOAD
 +
: [...]
 +
;LOCATE
 +
: [...]
 +
;MASK
 +
: [...]
 +
;MEMORY
 +
: [...]
 +
;MERGE
 +
: [...]
 +
;MID$
 +
: [...]
 +
;MODE
 +
: [...]
 +
;MOVE
 +
: [...]
 +
;MOVER
 +
: [...]
 +
;NEW
 +
: [...]
 +
;ON BREAK
 +
: [...]
 +
;ON ERROR
 +
: [...]
 +
;OPENIN
 +
: [...]
 +
;OPENOUT
 +
: [...]
 +
;ORIGIN
 +
: [...]
 +
;OUT
 +
: [...]
 +
;PAPER
 +
: [...]
 +
;PEN
 +
: [...]
 +
;PLOT
 +
: [...]
 +
;PLOTR
 +
: [...]
 +
;POKE
 +
: [...]
 +
;PRINT
 +
: [...]
 +
;RAD
 +
: [...]
 +
;RANDOMIZE
 +
: [...]
 +
;READ
 +
: [...]
 +
;RELEASE
 +
: [...]
 +
;REM
 +
: [...]
 +
;REM
 +
: [...]
 +
;RENUM
 +
: [...]
 +
;RESTORE
 +
: [...]
 +
;RESUME
 +
: [...]
 +
;RETURN
 +
: [...]
 +
;RUN
 +
: [...]
 +
;SAVE
 +
: [...]
 +
;SOUND
 +
: [...]
 +
;SPC
 +
: [...]
 +
;SPEED
 +
: [...]
 +
;SQ
 +
: [...]
 +
;STOP
 +
: [...]
 +
;SUB
 +
: [...]
 +
;SWAP
 +
: [...]
 +
;SYMBOL
 +
: [...]
 +
;TAB
 +
: [...]
 +
;TAG
 +
: [...]
 +
;TAGOFF
 +
: [...]
 +
;TROFF
 +
: [...]
 +
;TRON
 +
: [...]
 +
;USING
 +
: [...]
 +
;WAIT
 +
: [...]
 +
;WHILE WEND
 +
: [...]
 +
;WIDTH
 +
: [...]
 +
;WINDOW
 +
: [...]
 +
;WRITE
 +
: [...]
 +
;ZONE
 +
: [...]
 +
 
 +
=== Operators ===
 
;AND
 
;AND
:Returns bit-wise logical sum of the given variables
+
: [...]
 +
;MOD
 +
: [...]
 +
;NOT
 +
: [...]
 +
;OR
 +
: [...]
 +
;XOR
 +
: [...]
 +
 
 +
=== Functions ===
 +
;ABS
 +
: [...]
 
;ASC
 
;ASC
:Returns the ascii code number of the given letter
+
: [...]
 
;ATN
 
;ATN
:Calculates arc tangent of the given variable
+
: [...]
 +
;BIN$
 +
: [...]
 +
;CHR$
 +
: [...]
 +
;CINT
 +
: [...]
 +
;COPYCHR$
 +
: [...]
 +
;COS
 +
: [...]
 +
;CREAL
 +
: [...]
 +
;DEC$
 +
: [...]
 +
;DERR
 +
: [...]
 +
;EOF
 +
: [...]
 +
;ERR
 +
: [...]
 +
;EXP
 +
: [...]
 +
;FIX
 +
: [...]
 +
;FRE
 +
: [...]
 +
;HEX$
 +
: [...]
 +
;HIMEM
 +
: [...]
 +
;INKEY
 +
: [...]
 +
;INKEY$
 +
: [...]
 +
;INP
 +
: [...]
 +
;INSTR
 +
: [...]
 +
;INT
 +
: [...]
 +
;JOY
 +
: [...]
 +
;LEFT$
 +
: [...]
 +
;LEN
 +
: [...]
 +
;LOG
 +
: [...]
 +
;LOG10
 +
: [...]
 +
;LOWER$
 +
: [...]
 +
;MAX
 +
: [...]
 +
;MIN
 +
: [...]
 +
;PEEK
 +
: [...]
 +
;PI
 +
: [...]
 +
;POS
 +
: [...]
 +
;REMAIN
 +
: [...]
 +
;RIGHT$
 +
: [...]
 +
;RND
 +
: [...]
 +
;ROUND
 +
: [...]
 +
;SGN
 +
: [...]
 +
;SIN
 +
: [...]
 +
;SPACE$
 +
: [...]
 +
;SQ
 +
: [...]
 +
;SQR
 +
: [...]
 +
;STR$
 +
: [...]
 +
;STRING$
 +
: [...]
 +
;TAN
 +
: [...]
 +
;TEST
 +
: [...]
 +
;TESTR
 +
: [...]
 +
;TIME
 +
: [...]
 +
;UNT
 +
: [...]
 +
;UPPER$
 +
: [...]
 +
;VAL
 +
: [...]
 +
;VPOS
 +
: [...]
 +
;XPOS
 +
: [...]
 +
;YPOS
 +
: [...]
  
(Please, fill in. I can't find my CPC manual...)
+
''(Please, fill in. Looks like a lot of work ;-) ...)''
  
 
== Web links ==
 
== Web links ==
  
 
* [http://www.kjthacker.f2s.com/docs/bastech.html Technical information at the Unofficial Amstrad WWW Resource]
 
* [http://www.kjthacker.f2s.com/docs/bastech.html Technical information at the Unofficial Amstrad WWW Resource]

Revision as of 10:41, 1 September 2006

Template:Stub Locomotive BASIC was a BASIC interpreter for the Amstrad CPC range of computers.

Description

Locomotive BASIC, was the best BASIC implementation of that era. It featured a comprehensive graphic capabilities with it's PLOT, DRAW, PAPER, INK, PEN, BORDER, CIRCLE and FILL commands, a feature that was missing in Commodore BASIC.

It had a very extensive sound commands, granting almost full control of the AY-3-8912. With the SOUND command, you could select channels, set envelopes, pitch, noise and volume. That was something unmatched by other computers of that era.

Also there was simple interface for memory menagment, with MEMORY and LOAD commands. The later, alowed for loading of raw screen data, thus providing easy picture showing. Also, the LOAD command together with CALL, PEEK and POKE provided an easy method for mixing basic and assembly code, granting possibility to speed up BASIC routines, witch, being interpreted were inevitably slow.

With DEF FN, ON variable GOTO and ON variable GOSUB, Locomotive BASIC provided something that could be called "stub of a structure programing", feature that was beaten only by the BBC Micro's BASIC.

All in all, if you compare BASIC interpreters of that era, the Locomotive's seems to be the best 'all-rounder' and still some of its features were unmatched by others.

Command list

Commands and operators

AFTER
[...]
AUTO
[...]
BORDER
[...]
CALL
[...]
CAT
[...]
CHAIN
[...]
CLEAR
[...]
CLG
[...]
CLOSEIN
[...]
CLOSEOUT
[...]
CLS
[...]
CONT
[...]
CURSOR
[...]
DATA
[...]
DEF
[...]
DEFINT
[...]
DEFREAL
[...]
DEFSTR
[...]
DEG
[...]
DELETE
[...]
DI
[...]
DIM
[...]
DRAW
[...]
DRAWR
[...]
EDIT
[...]
EI
[...]
END
[...]
ENT
[...]
ENV
[...]
ERASE
[...]
ERL
[...]
ERROR
[...]
EVERY
[...]
FILL
[...]
FN
[...]
FOR TO STEP NEXT
[...]
FRAME
[...]
GOSUB
[...]
GOTO
[...]
GRAPHICS
[...]
IF THEN ELSE
[...]
INK
[...]
INPUT
[...]
KEY
[...]
LET
[...]
LINE
[...]
LIST
[...]
LOAD
[...]
LOCATE
[...]
MASK
[...]
MEMORY
[...]
MERGE
[...]
MID$
[...]
MODE
[...]
MOVE
[...]
MOVER
[...]
NEW
[...]
ON BREAK
[...]
ON ERROR
[...]
OPENIN
[...]
OPENOUT
[...]
ORIGIN
[...]
OUT
[...]
PAPER
[...]
PEN
[...]
PLOT
[...]
PLOTR
[...]
POKE
[...]
PRINT
[...]
RAD
[...]
RANDOMIZE
[...]
READ
[...]
RELEASE
[...]
REM
[...]
REM
[...]
RENUM
[...]
RESTORE
[...]
RESUME
[...]
RETURN
[...]
RUN
[...]
SAVE
[...]
SOUND
[...]
SPC
[...]
SPEED
[...]
SQ
[...]
STOP
[...]
SUB
[...]
SWAP
[...]
SYMBOL
[...]
TAB
[...]
TAG
[...]
TAGOFF
[...]
TROFF
[...]
TRON
[...]
USING
[...]
WAIT
[...]
WHILE WEND
[...]
WIDTH
[...]
WINDOW
[...]
WRITE
[...]
ZONE
[...]

Operators

AND
[...]
MOD
[...]
NOT
[...]
OR
[...]
XOR
[...]

Functions

ABS
[...]
ASC
[...]
ATN
[...]
BIN$
[...]
CHR$
[...]
CINT
[...]
COPYCHR$
[...]
COS
[...]
CREAL
[...]
DEC$
[...]
DERR
[...]
EOF
[...]
ERR
[...]
EXP
[...]
FIX
[...]
FRE
[...]
HEX$
[...]
HIMEM
[...]
INKEY
[...]
INKEY$
[...]
INP
[...]
INSTR
[...]
INT
[...]
JOY
[...]
LEFT$
[...]
LEN
[...]
LOG
[...]
LOG10
[...]
LOWER$
[...]
MAX
[...]
MIN
[...]
PEEK
[...]
PI
[...]
POS
[...]
REMAIN
[...]
RIGHT$
[...]
RND
[...]
ROUND
[...]
SGN
[...]
SIN
[...]
SPACE$
[...]
SQ
[...]
SQR
[...]
STR$
[...]
STRING$
[...]
TAN
[...]
TEST
[...]
TESTR
[...]
TIME
[...]
UNT
[...]
UPPER$
[...]
VAL
[...]
VPOS
[...]
XPOS
[...]
YPOS
[...]

(Please, fill in. Looks like a lot of work ;-) ...)

Web links