A Comparision of Keywords on the Oric 1, Oric Atmos, and the ZX Spectrum




Overview

The following is a list of keywords, operators and delimiters used on the Oric 1 & Oric Atmos computers and the ZX Spectrum.

The Oric 1 was produced by Tangerine Computer Sysems and released in 1982, just months after the launch of the ZX Spectrum. With its similar styling, chiclet keyboard, and high resolution display it is quite obvious that the Oric 1 was produced to take on Sinclair's low cost Spectrum. The Oric Atmos is an upgraded version of the Oric 1 with a new ROM and keyboard.

The Oric machines utilise the 6502 microprocessor (The same one the BBC Micro uses).
The 6502 uses a completely different instruction set and registers to the Z80 used by the Spectrum so any machine code used within a BASIC program will have to be rewritten.

Both the Oric 1 & Atmos use a different version of BASIC to the ZX Spectrum called Oric Extended BASIC. The Oric Atmos being an upgraded version of the Oric 1, had some code in the ROM rewritten to eliminate bugs which were present in the Oric 1. Other than that the Atmos and Oric 1 can be regarded as both having the same BASIC and being 'mostly compatible' with each other.

Many of the original bugs of the Oric 1 were still present on the Oric Atmos.

For the meantime, commands intended for the Oric Microdisc will not be listed here, they may however become available here, or on a seperate page, in the future.


Commands

Keyword

Meaning

Comments

CLEAR


CLEAR [n]  (ZX Spectrum, Oric 1 & Oric Atmos)

Result (ZX Spectrum): Clears the screen, deletes all variables, resets PLOT and PRINT positions and clears the GOSUB stack. If a number is specified then RAMTOP is lowered to n.

Result (Oric 1 & Atmos): Wipes all variables currently in use.

ZX Spectrum
CLEAR on the Oric 1/Atmos does not clear the screen.

CONT or CONTINUE


CONT  (Oric 1 & Oric Atmos)

CONTINUE  (ZX Spectrum)

Result: After CTRL-C is pressed (Oric 1 & Oric Atmos)

or

After BREAK* is pressed  (ZX Spectrum)

CONT or CONTINUE will execute the next line after the error occurred.

*The reportL (BREAK into program) occurs on the ZX Spectrum when BREAK is pressed whilst a program is running.

ZX Spectrum
CONTINUE is shortened to CONT on the Oric. The ZX Spectrum keyboard shows CONTINUE as CONT.

GRAB


GRAB  (Oric 1 & Oric Atmos)

Result: Make area of memory normally used for the high resolution display, available to the user.

No equivalent on the Spectrum.

See also HIRES, RELEASE

HIMEM


HIMEM  (Oric 1 & Oric Atmos)

Result: Sets the highest address in memory available for BASIC programs.

Similar to CLEAR on the ZX Spectrum.

HIRES


HIRES  (Oric 1 & Oric Atmos)

Result: Switch display to high resolution mode.

Not on the ZX Specrum as it only has one display mode.

LIST


LIST  (Oric 1 & Oric Atmos, and ZX Spectrum)

Result: Display complete program listing.

LIST n  (ZX Spectrum)

Result: Display program listing from line n or line 0 where no line number specified.

LIST n  (Oric 1 & Oric Atmos)

Result: Display single program line n.

LIST [m]-[n]  (Oric 1 & Oric Atmos)

Result: Display program listing from line m to line n. If m is omitted listing will begin at the start of the program. If n is omitted then listing will stop at the end of the program. If both m and n are omitted, i.e.LIST - ,the complete program will be listed (same as LIST).

ZX Spectrum
Note: Oric micros use a minus sign as the delimiter in a LIST command.

LLIST


LLIST  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Send a complete program listing to the printer.

LLIST n  (ZX Spectrum)

Result: Print the program listing from line n or line 0 where no line number specified.

LLIST n  (Oric 1 & Oric Atmos)

Result: Print single program line n.

LLIST [m]-[n]  (Oric 1 & Oric Atmos)

Result: Print program listing from line m to line n. If m is omitted listing will begin at the start of the program. If n is omitted then listing will stop at the end of the program. If both m and n are omitted, i.e.LLIST - ,the complete program listing will be printed (same as LLIST).

ZX Spectrum
Note: Oric micros use a minus sign as the delimiter in a LLIST command.

LOAD  (ZX Spectrum)

CLOAD  (Oric 1 & Oric Atmos)


LOAD ""  (ZX Spectrum)

CLOAD""[,S]  (Oric 1 & Oric Atmos)

Result: Load the first program encountered on cassette. On the ZX Spectrum double quotes may be replaced by a string variable as long as it is a null string.



LOAD f  (ZX Spectrum)

CLOAD f [,S]  (Oric 1 & Oric Atmos)

Result: Load program f.



LOAD f DATA ()  (ZX Spectrum only)

Result: Load array f from cassette into the variables area of memory.

For the Oric equivalent see RECALL.



LOAD f CODE [m[,n]]  (ZX Spectrum)

CLOAD f [,S]  (Oric 1 & Oric Atmos)

Result: Load data from cassette into the memory location specified when the file was saved. If m is specified then load into memory location m. Optionally n (number of bytes to load) may also be specified)

Note: The Oric does not require any extra parameters (not including the S parameter) to load code into memory.



LOAD f SCREEN$  (ZX Spectrum only)

Result: Load screen data into from tape directly into the display file (same as:LOAD f CODE 16384,6192 )

ZX Spectrum
On the Oric the default data transfer rate is set to 2400 baud. The S parameter sets the data transfer rate to 300 baud. ZX Spectrum has extra options to load dimensional arrays, code direct to memory or a screen to the display file.

The Oric micros can also save and load array data. For more information see RECALL.

LORES


LORES 0¦1  (Oric 1 & Oric Atmos)

Result: Switch display to one of two low resolution modes (0 or 1).

Not on the ZX Spectrum as it only has one display mode.

See also HIRES, TEXT

MERGE  (ZX Spectrum)

CLOAD f,J  (Oric 1 & Oric Atmos)


MERGE f

Result: Merge program f with that already in memory overwriting duplicate program lines.



CLOAD f,J  (Oric 1 & Oric Atmos)

Result: Joins a second BASIC program to the end of a previously loaded program. Line numbers in the second program must be higher than the largest line number in the first program otherwise program will not RUN because line numbers from the second program will co-exist with those in the first.

ZX Spectrum
The Oric's CLOAD with Join parameter is similar to the Spectrum's MERGE but whereas MERGE will overwrite duplicate line number the Oric will not, leading to line numbers being 'doubled up'.

NEW


NEW

Result (Oric 1 & Oric Atmos): Deletes program and variables.

Result (ZX Spectrum): Deletes program and variables and memory up to and including the address held in the system variable RAMTOP.

ZX Spectrum
Similar on both micros. On the Oric machines NEW does not clear the screen. On the ZX Spectrum NEW preserves the system variables UDG, P-RAMT, RASP and PIP.

RECALL


RECALL v,f[,S]  (Oric 1 & Oric Atmos)

Result: Load from tape, the contents of array v with the filename of f. array v may be either numeric (real), numeric integer (%), or string ($).

On the Oric the default data transfer rate is set to 2400 baud. The S parameter sets the data transfer rate to 300 baud.

For the Spectrum equivalent of RECALL see LOAD f DATA ()

See also LOAD, CLOAD

RELEASE


RELEASE  (Oric 1 & Oric Atmos)

Result: Return memory that was previously acquired by GRAB, to normal use.

No equivalent on the Spectrum.

See also HIRES, GRAB

RUN


RUN [n]  (Oric 1, Oric Atmos, & ZX Spectrum)

Result  (ZX Spectrum): Perform CLEAR and GO TO line n (or line 0 if n not specified).

Result  (Oric 1 & Oric Atmos): Clear variables and GOTO line n (or line 0 in n is not specified).

ZX Spectrum
Similar on both micros.

RUN on the ZX Spectrum clears the screen.

On the Oric, if the line number n does not exist then an error will occur. If line n does not exist on the Spectrum, the next valid line number will be executed.

SAVE  (ZX Spectrum)

CSAVE  (Oric 1 & Oric Atmos)


SAVE f [LINE m]  (ZX Spectrum)

Result: Save program f to tape. If LINE is specified then RUN program from line m once loaded (ZX Spectrum)

CSAVE f[,S][,AUTO]  (Oric 1 & Oric Atmos)

Result: Save program f to tape. If AUTO parameter is specified program will run automatically from the first line when loaded (Oric 1 & Oric Atmos).


SAVE f DATA α[$]()  (ZX Spectrum)

Result: Save array α to tape.


SAVE f CODE m,n  (ZX Spectrum)

Result: Save code from memory to tape starting at address m with a length of n bytes.


SAVE f SCREEN$  (ZX Spectrum)

Result: Save display file with filename f to tape (same as SAVE f CODE 16384,6192).
ZX Spectrum
On the Oric the default data transfer rate is set to 2400 baud. The S parameter sets the data transfer rate to 300 baud.

STORE


STORE v,f[,S]  (Oric 1 & Oric Atmos)

Result: Save to tape, the contents of array v with the filename of f. array v may be either numeric (real), numeric integer (%), or string ($).

On the Oric the default data transfer rate is set to 2400 baud. The S parameter sets the data transfer rate to 300 baud.

For the Spectrum equivalent of STORE see SAVE f DATA ()

See also SAVE, CSAVE

TEXT


TEXT  (Oric 1 & Oric Atmos)

Result: Switch display to text mode.

Not on the ZX Specrum as it only has one display mode.

This mode appears to be the same as LORES.

See also HIRES, LORES

VERIFY  (ZX Spectrum)

CLOAD f,V  (Oric 1 & Oric Atmos)


VERIFY f  (ZX Spectrum)

CLOAD f,V[,S]  (Oric 1 & Oric Atmos)

VERIFY f DATA α[$]()  (ZX Spectrum)

VERIFY f CODE [m[,n]]  (ZX Spectrum)

VERIFY f SCREEN$ *  (ZX Spectrum)

*This command will be accepted by the Spectrum but taped SCREEN$ code will fail verification.

Result: Compares program/array/code f from tape with that in memory. Error R if verify fails.
ZX Spectrum
On the Oric the default data transfer rate is set to 2400 baud. The S parameter sets the data transfer rate to 300 baud.


Statements

Keyword

Meaning

Comments

AT  (ZX Spectrum)

PRINT@  (Oric 1 & Oric Atmos)


PRINT AT x,y; (ZX Spectrum)

INPUT AT x,y;  (ZX Spectrum)

Result: Changes PRINT or INPUT position to x,y.

PRINT@x,y ...  (Oric 1 & Oric Atmos)

Result: Start PRINTing from text cursor position x,y.

ZX Spectrum
See also PRINT.

BEEP


BEEP x,y

Result: Sound emitted for x seconds at pitch y.

ZX Spectrum
For Oric 1 and Oric Atmos sound statements see EXPLODE, SOUND, MUSIC, PING, PLAY, SHOOT, ZAP.

BORDER


BORDER m

Result: Changes screen border colour to m.

ZX Spectrum
It is not possible to change the border on the Oric computers.

BRIGHT


BRIGHT n

Result: When n=1 permanent brightness is turned on. When n=0 permanent brightness is off.

keyword  BRIGHT n

Result: When n=1 temporary brightness is turned on. When n=0 temporary brightness is off.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements. When BRIGHT is applied to the keyword LPRINT there will be no effect on characters printed on the ZX Printer.

ZX Spectrum
The brightness of the screen cannot be changed on the Oric computers.

CALL


CALL m (Oric 1 & Oric Atmos)

Result: Calls a machine code subroutine at memory location m. (Oric 1 & Oric Atmos)

Not on the Spectrum. Use USR instead to call machine code.

CHAR


CHAR n,s,fb (Oric 1 & Oric Atmos)

Result (Oric 1 & Oric Atmos): Place character n at the current cursor position on the HIRES screeen. s represents which character set to use, either 0 or 1. fb is the foreground/background parameter:

fb=0 Background colour
fb=l Foreground colour
fb=2 Invert colour
fb=3 Null



Not on the Spectrum. A short BASIC or machine code subroutine could simulate CHAR.

CIRCLE


CIRCLE [c;]x,y,z (ZX Spectrum)

Result: Draws a circle subject to colour items (c), of radius z at position x,y.




CIRCLE z,fb (Oric 1 & Oric Atmos)

Result: Draws a circle of radius z using the current HIRES cursor position as the centre of the circle. fb is the foreground/background parameter:

fb=0 Background colour
fb=l Foreground colour
fb=2 Invert colour
fb=3 Null

ZX Spectrum
On the Oric 1 and Atmos, as with the Spectrum, if any part of the circle being drawn goes off-screen an error will occur.

CLOSE #


CLOSE # stream_number  (ZX Spectrum)

Result: Close device / stream.

ZX Spectrum
ZX Spectrum
Not on the standard Oric 1 and Oric Atmos. A similar command exists for the Oric Microdisc.

CLS


CLS  (Oric 1, Oric Atmos and ZX Spectrum)

Result: Clears the screen. Also sets the current background colour (PAPER on the Spectrum).

ZX Spectrum
Similar result all round.

COPY


COPY  (ZX Spectrum)

Result: Sends the contents of the screen to the ZX Printer.

ZX Spectrum
Not on the Oric.

CURMOV


CURMOV x,y,fb (Oric 1 & Oric Atmos)

Result: Move the high-res cursor by x and y pixels (may be negative values) relative to the current cursor position.

fb is the foreground/background parameter:

fb=0 Background colour
fb=l Foreground colour
fb=2 Invert colour
fb=3 Null

Not on the Spectrum. To move the PLOT position by a relative amount on the Spectrum, one must obtain the current PLOT position from the system variable COORDS, x and y may then be added on. COORDS can be found at memory locations 23677 and 23678.

CURSET


CURSET x,y,fb (Oric 1 & Oric Atmos)

Result: Move the high-res cursor to position x,y.

fb is the foreground/background parameter:

fb=0 Background colour
fb=l Foreground colour
fb=2 Invert colour
fb=3 Null

Not on the Spectrum. To move the PLOT position without drawing a pixel, the system variable COORDS may be POKEd with the correct values. COORDS can be found at memory locations 23677 and 23678.

DATA


DATA e1,e2,e3, ...

Result: Stores data in a list.

ZX Spectrum
Similar on both micros. The ZX Spectrum requires string data to be surrounded by quotes, the Oric 1 and Atmos do not, unless you wish to preserve leading spaces.

DEF FN


DEF FN α([α1[,...,αk]])=e  (ZX Spectrum)

Result: Defines a function. α and α1 to αk can be a single letter or single letter followed by $ for a string argument.


DEF FN α(α)=e  (Oric 1 & Oric Atmos)

Result: Defines a function. The name of α can be longer than a single letter.

ZX Spectrum
Similar on both micros. The Oric 1 and Oric Atmos may only use one dummy variable in the function, and strings are not allowed. The ZX Spectrum may use multiple dummy variables and can handle strings. A definable function on the Spectrum may call itself.

DEF USR


DEF USR = address

Result: Defines the address of a USR function.

The address must be between 0 and 65535 and contain the entry address.

A machine code program can be called with the USR(0) function.
The number between the parentheses must always be zero as the address has already been set with DEF USR.

USR can only be called with a PRINT statement or with a dummy variable.

If no values are to be passed to a machine code routine, then CALL should be used.

Not required on the Spectrum as the address to be called is stored in the USR function.

DIM


DIM α[%¦$](n1,...,nk)  (Oric 1 & Oric Atmos)

DIM α[$](n1,...,nk)  (ZX Spectrum)

Result: Sets up an array of numbers or characters with k dimensions. For numeric arrays all values are set to zero. In the case of a string array all values are set to SPACE (CHR$ 32).

On the Oric, dimensional arrays can also handle integers (%).

ZX Spectrum
The Oric 1 and Oric Atmos do not require DIM if the array is to hold less than 10 elements.

DOKE


DOKE m,n  (Oric 1 & Oric Atmos)

Result: Load a 16 bit word (n) into memory addresses m and m+1.

DOKE can be acheived on the Spectrum with the following code:

POKE m,n-256*INT(n/256)

POKE m+1,INT(n/256)

DRAW

(ZX Spectrum)


DRAW x,y[,z] (ZX Spectrum)

Result: DRAW a high resolution line from the current PLOT position moving x horizontally and y vertically rotating through angle z if third parameter is specified.

DRAW x,y[,fb]  (Oric 1 & Oric Atmos)

Result: DRAW a high resolution line from the current hi-res cursor position to position x,y.

fb is the foreground/background parameter:

fb=0 Background colour
fb=l Foreground colour
fb=2 Invert colour
fb=3 Null

ZX Spectrum
DRAW on the Spectrum uses the relative coordinate system, whilst the Oric micros use the absolute coordinate system.

END


END

Result: Terminates program and returns control to the user. CONT will not continue program. (Oric 1 & Oric Atmos).
Differs from STOP in the way that END cannot continue a program with CONT from where it left off.

Not on the Spectrum. STOP may be used instead.

For a similar approach to END for ending a program on the Spectrum try redirecting the program flow to line 9999 and include a STOP statement on that line. CONTINUE will not work after the STOP in line 9999.

See also STOP, CONT, CONTINUE.

EXPLODE


EXPLODE  (Oric 1 & Oric Atmos)

Result: Generates a pre-defined sound resembling an explosion.
Not on the Spectrum.

Can be simulated with a machine language routine to generate white noise.
Such a routine can be found in issue no.62 of Personal Computer News magazine in the article Making up new noises1.

FILL


FILL m1,m2,m3  (Oric 1 & Oric Atmos)

Result: Fills an area of the screen from the current hi-res cursor position m1 lines down and m2 bytes across (each byte being 8 pixels). m3 is the bit pattern which will be used to fill the required area.

Not on the Spectrum, but machine code could be used to simulate FILL.



FLASH


FLASH n  (ZX Spectrum only)

Result: If n is set to 1 permanent flash effect is turned on. If n is set to zero then permanent flash effect is turned off.

keyword FLASH n  (ZX Spectrum only)

Result: If n is set to 1 temporary flash effect is turned on. If n is set to zero then temporary flash effect is turned off.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements. When FLASH is applied to the keyword LPRINT there will be no effect, obviously.
ZX Spectrum
Although the Oric 1 and Atmos have no FLASH statement a similar effect can be acheived by using control codes.

GOSUB or GO SUB


GOSUB n  (Oric 1 & Atmos)

GO SUB n  (ZX Spectrum)

Result: Stack GO SUB line number and branch (GO TO) line n.

ZX Spectrum
Same result all round with the exception of the spelling, GO SUB with a space for the Spectrum and without (GOSUB) for the Oric.
The ZX Spectrum manual is inconsistent with the spelling of GO SUB, using both GO SUB and GOSUB!

GOTO or GO TO


GOTO n  (Oric 1 & Oric Atmos)

GO TO n  (ZX Spectrum)

Result: Branch or GO TO line n.

ZX Spectrum
Again, like above the Same result all round with the exception of the spelling, GO TO with a space for the Spectrum and without (GOTO) for the Oric.

INK


INK n



Result (Oric 1 & Oric Atmos): Set foreground colour for the whole screen.

Result (ZX Spectrum): Sets permanent foreground colour. When n=0 to 7 a colour is selected. When n=8 transparency is selected. When n=9 contrast is selected.

keyword INK n;  (ZX Spectrum only)

Result: Sets temporary foreground colour. When n=0 to 7 a colour is selected. When n=8 transparency is selected. When n=9 contrast is selected.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements. When INK is applied to the keyword LPRINT there will be no effect on characters printed on the ZX Printer.

ZX Spectrum
INK on the Oric will change the foreground colour on the whole screen, not just individual character squares.

The ink bit patterns on the Oric are reversed compared to the Spectrum (i.e. GRB instead of RGB).

INPUT


INPUT v1[,v2,v3...]  (Oric 1 & Oric Atmos, and ZX Spectrum)

INPUT LINE α$   (ZX Spectrum only)

Result: Computer waits for input of an expression then passes the value of this to the variable v.

ZX Spectrum
The ZX Spectrum allows PRINT items to be used such as INK and PAPER.

INPUT LINE α$ on the Spectrum strips the quotes on the input line and waits for a string to be input.

On the Oric machines, data may be input on any area of the screen.

INVERSE


INVERSE n

Result: Turns permanent inverse video effect on when n=1 or off when n=0.

keyword INVERSE n

Result: Turns temporary inverse video effect on when n=1 or off when n=0.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements.

The INVERSE statement is not implemented on the Oric micros although inverse characters can be made by reversing the foreground and background colours

.

LET  (ZX Spectrum)

[LET]  (Oric 1 & Oric Atmos)


[LET] v=e  (Oric 1 & Oric Atmos)

LET v=e  (ZX Spectrum)


ZX Spectrum
LET is optional on the Oric 1 and Oric Atmos, i.e. :

α$="some text"

LPRINT


LPRINT ...  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Send a line of characters to the ZX Printer (ZX Spectrum only) or printer compatible with LPRINT.

ZX Spectrum
Similar results on ZX Spectrum and Oric micros.

On the Spectrum LPRINT generally works with the ZX Printer but can sometimes be used with other printer interfaces.

MUSIC


MUSIC channel,octave,note,volume  (Oric 1 & Oric Atmos)

Result: Generates a sound based on the given parameters.

channel = The number of sound channels to be used (0-3)
octave = octave of note to be played (0-7)
note = note to be played (0-12)
volume = sets volume level (0-15)

Not on the standard ZX Spectrum.

The 128K Spectrum model can perform something similar with the PLAY statement.

OPEN #


OPEN #m;f1[;n]¦[;n;f2]  (ZX Spectrum)

Result: Open a stream m attached to channel f1 with device number n. Microdrives require a filename f2  (ZX Spectrum)

ZX Spectrum
On the Spectrum the hash symbol after OPEN is not a single character but part of the OPEN # keyword.

Not on the standard Oric 1 and Oric Atmos. A similar command exists for the Oric Microdisc.

OUT


OUT m,n

Result: Outputs byte n to port m.
ZX Spectrum
Not on the Oric 1 or Atmos as the 6502 processor is memory mapped for I/O devices.

OVER


OVER n

Result: If n=0 then permanent overprinting is turned off. If n=1 permanent overprinting is tunred on.

keyword OVER n

Result: If n=0 then temporary overprinting is turned off. If n=1 temporary overprinting is tunred on.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements. No effect when applied to LPRINT.

ZX Spectrum
Not on the Oric. If n=1 OVER essentially performs an eXclusive OR with the old and new pixels. If both pixels are off (0) they will stay off (0). If the old pixel if off (0) and the new one is on (1) the displayed pixel will be on (1). If both old and new pixels are on (1) the diplayed pixel will be (0).

PAPER


PAPER n



Result (Oric 1 & Oric Atmos): Set background colour for the whole screen.

Result (ZX Spectrum): Sets permanent background colour. When n=0 to 7 a colour is selected. When n=8 transparency is selected. When n=9 contrast is selected.

keyword PAPER n;  (ZX Spectrum only)

Result: Sets temporary background colour. When n=0 to 7 a colour is selected. When n=8 transparency is selected. When n=9 contrast is selected.

keyword may be one of PRINT, LPRINT, INPUT, PLOT, DRAW or CIRCLE statements. When PAPER is applied to the keyword LPRINT there will be no effect on characters printed on the ZX Printer.

ZX Spectrum
PAPER on the Oric will change the background colour on the whole screen, not just individual character squares.

The paper bit patterns on the Oric are reversed compared to the Spectrum (i.e. GRB instead of RGB).

PAUSE


PAUSE m


Result: Stop program execution for m*1/50seconds or until a key is pressed.

ZX Spectrum
PAUSE is interupted when a key is pressed.

PAUSE 0 is not timed but lasts until a key is pressed.

To convert the Oric WAIT to the Spectrum PAUSE divide m by 2. For Spectrum to Oric conversion multiply m by 2.

See also WAIT

PATTERN


PATTERN m  (Oric 1 & Oric Atmos)

Result: Introduces an 8 bit pattern (m) to DRAW and CIRCLE statements. m must be in the range 0 to 255.

Not on the Spectrum. A machine code subroutine could be written to simulate the PATTERN statement.

PING


PING  (Oric 1 & Oric Atmos)

Result: Generates a pre-defined sound resembling an 'ping'!.
Not on the Spectrum.

Can be simulated with a machine language routine.
Such a routine can be found in issue no.62 of Personal Computer News magazine in the article Making up new noises1.

PLAY


PLAY tone,sound,envelope,duration  (Oric 1 & Oric Atmos)

Result: Play a sound according to tone channel, sound channel, envelope, and duration.

tone channel may be 0 to 7
sound channel may be 0 to 7
envelope may be 0 to 7
duration may be 0 to 65535

PLAY f1[,f2[,f3]]  (All ZX Spectrum+ 128k models)

Result: Play a series of musical notes according to octave, volume and tempo data stored in the string f1. All three sound channels (f1,f2,f3) may be played at once.

The PLAY statements on the Oric and on ZX Spectrum +128K both work quite differently.

The Oric PLAY sets up the 'shape' of a sound whereas the ZX Spectrum+ 128k models can play a string of notes from up to three channels.

Not on the 16k/48k ZX Spectrum. Melodies may be acheived using BEEP.

See also BEEP, SOUND.

PLOT

(Oric 1 & Oric Atmos)


PLOT x,y,m¦α$  (Oric 1 & Oric Atmos)

Result: Places a character with the ASCII code of m, at screen location x,y on the low resolution screen. Alternatively places a character or string of characters (α$).

x can be from 0 to 39, y can be 0 to 26.

The Oric's PLOT statement is quite different to the ZX Spectrum's. The Spectrum's PLOT places a pixel at x,y whereas the Oric's PLOT is more akin the PRINT AT on the Spectrum.

PLOT

(ZX Spectrum)


PLOT [c;]m,n  (ZX Spectrum)

Result: Sets pixel ink at position m,n subject to c (INK/PAPER/OVER/INVERSE) on the ZX Spectrum.

ZX Spectrum
For the equivalent Oric statement see CURSET.

POKE


POKE m,n  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Load byte n into memory address m.

ZX Spectrum
Same result all round.

POP


POP  (Oric 1 & Oric Atmos)

Result: Drop the last item from the GOSUB stack.

Not on the Spectrum. A machine code subroutine could probably be written to simulate POP, but would most likely be of little use. A well placed GO TO may work but could quickly fill up the GO SUB stack.

Any routine using POP should, ideally, be restructured.

PRINT

(Oric 1, Oric Atmos, and ZX Spectrum)


PRINT@

(Oric 1 & Oric Atmos)


PRINT ...  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Send a series of items to the display subject to control characters (and AT/TAB/INK/PAPER/INVERSE/FLASH/OVER on the ZX Spectrum).

PRINT@x,y ...  (Oric 1 & Oric Atmos)

Result: Starting at text cursor position (x,y), send a series of items to the display subject to control characters.

ZX Spectrum
Similar on both micros with exceptions. On the Oric micros PRINT@ is the same as PRINT AT on the Spectrum.

PULL


PULL  (Oric 1 & Oric Atmos)

Result: Prematurly exits a REPEAT...UNTIL loop.

Not on the Spectrum.

RANDOMIZE


RANDOMIZE [n]  (ZX Spectrum)

Result: Sets system variable SEED to n which will be the basis for pseudo-random numbers (RND). n can be any number between 0 and 65535. When n=0 or if no number is given, then the pseudo-random number sequence is based upon the time elapsed since the Spectrum was powered on.

ZX Spectrum
Not on the Oric 1 or Atmos.

ZX Spectrum keyboard shows shortened RAND and not RANDOMIZE.

READ


READ e1,e2,e3, ...

Result: Read numeric or string information from DATA statement and pass to a variable or variables e1,e2,e3, ...

ZX Spectrum
Similar on both micros with exceptions.

REM

(Oric 1, Oric Atmos, and ZX Spectrum)


'  Single Quote

(Oric 1 & Oric Atmos)


REM ...  (Oric 1, Oric Atmos, and ZX Spectrum)

' ...  (Oric 1 & Oric Atmos)

Result: None, display comment in program listing.
ZX Spectrum
Same result all round. On the Oric 1 and Atmos a single quote can also be used in place of REM.

RESTORE


RESTORE  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Restores DATA pointer to start of program.

RESTORE n  (ZX Spectrum only)

Result: Restores DATA pointer to line n.

ZX Spectrum
The Oric micros can only RESTORE the data pointer to the start of the program.

See also DATA, READ.

RETURN


RETURN

Result: Take line number off GO SUB stack and GO TO the line after that line number.

ZX Spectrum
Same result all round.

SHOOT


SHOOT  (Oric 1 & Oric Atmos)

Result: Generates a pre-defined sound resembling a gunshot.

Not on the Spectrum.

Can be simulated with a machine language routine.
Such a routine can be found in issue no.62 of Personal Computer News magazine in the article Making up new noises1.

SOUND


SOUND channel,pitch,volume  (Oric 1 & Oric Atmos)

Result: Play a sound subject to pitch and volume through channel.

channel can be 0 to 6. Channels 0 to 3 produce pure sound, and channels 4 to 6 produce white noise.

pitch can be 0 to 65535

volume can be 0 to 15


See also BEEP, PLAY.

STOP


STOP

Result: Stops program execution with BREAK in line number (Oric 1 & Oric Atmos) or Report 9 (ZX Spectrum).

ZX Spectrum
Same result all round.

For the Oric see also END.

TAB


TAB(x)  (Oric 1 & Oric Atmos)

TAB x  (ZX Spectrum)

Result: Changes PRINT (Oric 1, Oric Atmos, and ZX Spectrum), LPRINT (ZX Spectrum) or INPUT (ZX Spectrum) position to column x.

ZX Spectrum
INPUT TAB x only works on ZX Spectrum. Brackets are obligatory on the Oric machines.

WAIT


WAIT m


Result: Stop program execution for m*1/100seconds.


WAIT differs from PAUSE in that on the ZX Spectrum PAUSE is interupted when a key is pressed.

To convert the Spectrum's PAUSE to WAIT multiply m by 2. For Oric to Spectrum, divide m by 2.

See also PAUSE

ZAP


ZAP  (Oric 1 & Oric Atmos)

Result: Generates a pre-defined sound 'zap'!

Not on the Spectrum.

Can be simulated with a machine language routine.
Such a routine can be found in issue no.62 of Personal Computer News magazine in the article Making up new noises1.


Compound Statements

Keyword

Meaning

Comments

FOR...NEXT loop

(FOR, TO, STEP, NEXT)


FOR α=x TO y STEP z

    [section of program to be repeated goes here]

NEXT α

Result: Sets up and executes the loop α from x to y with a step of z.

[Note] Step of +1 assumed if STEP omitted)
ZX Spectrum
Same result all round.

Although the NEXT statement is not compounded within the FOR statement as TO and STEP are, it is included here for completeness.

IF..THEN

(Oric 1, Oric Atmos, & ZX Spectrum)


IF..THEN..ELSE

(Oric 1 & Oric Atmos)


IF x THEN s  (Oric 1, Oric Atmos, & ZX Spectrum)

Result: If x is true (non-zero) then s will be executed.


IF x THEN s1 ELSE s2  (Oric 1 & Oric Atmos)

Result: If x is true (non-zero) then s1 will be executed, otherwise s2 will be executed..
ZX Spectrum
ELSE can be simulated on the ZX Spectrum by skipping the line immediately after the IF..THEN if the condition is true.

IF condition THEN statement : GO TO
next_statement

else_statement

next_statement

ON...

ON...GOTO

ON...GOSUB


ON x GOTO m1[,m2...,mk]  (Oric 1 & Oric Atmos)

ON x GOSUB m1[,m2...,mk]  (Oric 1 & Oric Atmos)

Result: Branch to line m if x is true.

The ZX Spectrum can simulate ON..GOTO/GOSUB with

GO TO (m1 AND x=1)+(m2 AND x=2)+
(mk AND x=k)

REPEAT...UNTIL


(Oric 1 & Oric Atmos)

REPEAT

    statements

UNTIL condition


Result: Sets up and executes a REPEAT loop and performs statements. When condition is met UNTIL closes the loop.

Not on the ZX Spectrum but a REPEAT loop to wait for a keypress can be achieved with the following code.

LET exit=1

FOR r=0 TO 0 STEP 0

IF INKEY$<>"" THEN LET r=exit

NEXT r

Explanation:

The exit variable is set to '1'. This is just a convenient name to make the program easier to follow.

The FOR loop is a dummy loop which will be our REPEAT.

Next comes the line which checks for a keypress. If true r, the REPEAT loop variable, will be set to exit or 1, and the loop will be exited at NEXT r

NEXT r completes the loop, this is the equivalent of UNTIL.

See also PULL


Functions

Keyword

Meaning

Comments

ABS


ABS x  (ZX Spectrum)

ABS(x)  (Oric 1 & Oric Atmos)

Returns: Absolute magnitude of x, i.e. distance on number line from zero, -1=1 -2=2

ZX Spectrum
Same result all round.

ACS


ACS x

Returns: Arccosine (inverse cosine) of x in radians.

ZX Spectrum
Not on the Oric micros. Substitute with a definable function:

DEF FN ACS(X)=ATN(SQR(1-X*X)/X)

And call with:

FN ACS(X)

ASC


See CODE

ASN


ASN x

Returns: Arcsine (inverse sine) of x in radians.
ZX Spectrum
Not on the Oric micros. Substitute with a definable function:

DEF FN ASN(X)=ATN(x/SQR(1-X*X))

And call with:

FN ASN(X)

ATN


ATN x  (ZX Spectrum)

ATN(x)  (Oric 1 & Oric Atmos)

Returns: Arctangent (inverse tangent) of x in radians.

ZX Spectrum
Same result all round.

ATTR


ATTR (x,y)

Returns: numeric value between 0 and 255 of the attribute at position x,y.

ZX Spectrum
Not on the Oric. See also POINT, SCREEN$, SCRN.

BIN


BIN b

Returns: decimal value of a base2 (binary) 16 bit number.
ZX Spectrum
Only on Spectrum. Not strictly a function but a numerical notation.

A short subroutine could easily be coded to simulate this function on the Oric.

See also HEX$ function, # (hexadecimal number prefix)

CHR$


CHR$ x

Returns: Single character or control code, from position x in the character set.

ZX Spectrum
Although the CHR$ function performs the same task on both the Spectrum and Oric micros, the end result may be different. Both micros use a character set based on ASCII.

CODE  (ZX Spectrum)

ASC  (Oric 1 & Oric Atmos)


CODE α$  (ZX Spectrum)

ASC(α$)  (Oric 1 & Atmos)

Returns: Numeric value (between 0 and 255) representing the position in the character set of α$. This is the inverse of the CHR$ function.

ZX Spectrum
Although the CODE / ASC function performs the same task on both computers, just like CHR$ above, the end result may be different.

COS


COS x  (ZX Spectrum)

COS(x)  (Oric 1 & Oric Atmos)

Returns: Cosine of x in radians.

ZX Spectrum
Same result all round.

DEEK


DEEK(m)  (Oric 1 & Oric Atmos)

Returns: numeric value (0 to 65535) stored at memory locations m and m+1. This function performs a double PEEK or to put it another way it converts a base256 number to a decimal (base10) number.

DEEK can be acheived on the Spectrum with the following code:

PEEK m+256*PEEK (m+1)

EXP


EXP x  (ZX Spectrum)

EXP(x)  (Oric 1 & Oric Atmos)

Returns: Numeric value for the function ex where e=2.7182818...

ZX Spectrum
Same result all round.

FN


FN α(α1, αk)  (ZX Spectrum)

Result: Calls a function. α and α1 to αk can be a single letter or for the ZX Spectrum only, a single letter followed by $ for a string argument.

FN α(m)  (Oric 1 & Oric Atmos)

Result: Calls a function. α with m as the argument.

ZX Spectrum
A definable function on the ZX Spectrum may be numeric or string.



See also DEF FN.

FRE


FRE(0)  (Oric 1 & Oric Atmos)

Returns: An integer indicating the number of bytes in memory that are left to the user.

FRE("")  (Oric 1 & Oric Atmos)

Result: Frees up space by reorganising string variable memory.

On the ZX Spectrum free space can be found by :

PRINT (PEEK 23730+256*PEEK 23731)
-USR 7962

The Spectrum tidies string variable space as it goes.

GET


GET v[$]  (Oric 1 & Atmos)

Returns: ASCII code or character after waiting for a key press.

Not on the Spectrum.

This function can be simulated with a short subroutine:

1000 REM **GET KEY PRESS**

1010 PAUSE 0

1020 LET k$=INKEY$

1030 IF k$="" THEN GO TO 1010

1040 LET GET=CODE k$

1050 RETURN

The subroutine is called with a GO SUB to line 1000 and uses the string variable k$ to temporarily store the ASCII character relating to the key which has just been pressed. The function CODE is then applied to k$ to obtain the character's ASCII code, this is then stored is the variable GET.
k$ contains the character relating to the key which was pressed.

See also INKEY$.

HEX$


HEX$(m)

Returns: A string consisting of the hexadecimal (base16) representation of the decimal number m. (Oric 1 & Oric Atmos).

Not on the Spectrum. A definable function could be used to perform the same task.

INKEY$

(ZX Spectrum)


KEY$

(Oric 1 & Oric Atmos)

KEY$  (Oric 1 & Oric Atmos)

INKEY$  (ZX Spectrum)

Both KEY$ and INKEY$ requires no operands.

Returns: Single character from a keypress.

Typical usage would be

PRINT INKEY$  (ZX Spectrum)

A$=KEY$  (Oric 1 & Oric Atmos)

LET A$=INKEY$  (ZX Spectrum)

or

10 IF INKEY$="" THEN GO TO 10  (ZX Spectrum)

ZX Spectrum
Difference in spelling but the same result all round.

IN


IN m

Returns: numeric value between 0 and 255 for the port m.
ZX Spectrum
Not on the Oric 1 or Atmos as the 6502 processor is memory mapped for I/O devices.

INT


INT x  (ZX Spectrum)

INT(x)  (Oric 1 & Oric Atmos)

Returns: x rounded down to the greatest integer (floor).

ZX Spectrum
Mostly the same result on each micro with the exception that occurs on the ZX Spectrum when INT -65536 is performed (the wrong result is given as -1).

KEY$


See INKEY$

LEFT$


LEFT$(α$,m)  (Oric 1 & Oric Atmos)

Returns: First m characters of α$.

On the Spectrum LEFT$ can be emulated with the TO string slicing facility:

β$=α$( TO m)

See also MID$, RIGHT$, TO.

LEN


LEN(α$)  (Oric 1 & Oric Atmos)

LEN α$  (ZX Spectrum)

Returns: numeric value for the length of α$.

ZX Spectrum
Same result all round.

LN


LN(x)  (Oric 1 & Oric Atmos)

LN x  (ZX Spectrum)

Returns: numeric value for the natural logarithm of x.

ZX Spectrum
Similar result all round, the ZX Spectrum diplays result to 8 decimal place wheras the Oric will display 9 decimal places.

See also EXP, LOG, ↑, ^.

LOG


LOG(x)  (Oric 1 & Oric Atmos)

Returns: numeric value for the common logarithm to base 10 of x.

Not on the Spectrum.

A function can be defined to perform the same task:

DEF FN l(x)=LN x/LN 10

See also EXP, LN, ↑, ^.

MID$


MID$(α$,m[,n])  (Oric 1 & Oric Atmos)

Returns: n characters of α$, starting at position m. If n is omitted the entire string to the right of m is returned. m must be greater than zero.

On the Spectrum MID$ can be emulated with the TO string slicing facility:

β$=α$(m TO m+n-1)

See also LEFT$, MID$ (Statement), RIGHT$, TO.

PEEK


PEEK(m)  (Oric 1 & Oric Atmos)

PEEK m  (ZX Spectrum)

Returns: numeric value (0 to 255) stored at memory location m.

ZX Spectrum
Same result all round.

POINT


POINT(x,y)  (Oric 1 & Oric Atmos)

POINT (x,y)  (ZX Spectrum)

Returns: -1 (Oric) or 1 (ZX Spectrum) if pixel is on or 0 if it is off, for the pixel location x,y.

ZX Spectrum
POINT is virtually the same on the Oric as it is on the ZX Spectrum except that when a pixel is switched on -1 will be returned on the Oric, and on the Spectrum it will be 1. Should this cause any problems when converting programs then apply ABS on the Oric, or on the Spectrum negate the result.

POS


POS (device)  (Oric 1 & Oric Atmos)

Result: Returns current horizontal cursor position for selected device.

device can either be 0 for the screen or 1 for the printer.

The ZX Spectrum's returns screen positions on two axes.

For the current row position use:

24-PEEK 23689

For the current column position:

33-PEEK 23688

For the current ZX Printer column position use:

PEEK 23680-(PEEK 23680)<32

RIGHT$


RIGHT$(α$,m)  (Oric 1 & Oric Atmos)

Result: Returns last m characters of α$.

On the Spectrum RIGHT$ can be emulated with the TO string slicing facility:

β$=α$(LEN α$-m+1 TO )

See also LEFT$, MID$, TO.

RND


RND(x)  (Oric 1 & Oric Atmos)

Returns:

If x=0 then the last pseudo-random number generated is returned.

If x=1 then a pseudo-random number between 0 and 1 is generated

if x<0 then the pseudo-random generator is started from a fixed point.



RND  (ZX Spectrum)

Returns  (ZX Spectrum):

A pseudo-random number between 0 and 1 is generated.



To summerise:

RND(0)  on the Oric is the same as

(PEEK 23670+256*PEEK 23671)/65536  on the ZX Spectrum



RND(1)  on the Oric is the same as

RND  on the ZX Spectrum



RND(-x)  on the Oric is the same as

RANDOMIZE x  on the ZX Spectrum




ZX Spectrum

See also RANDOMIZE

SCRN

(Oric 1 & Oric Atmos)


SCREEN$

(ZX Spectrum)


SCRN(x,y)  (Oric 1 & Oric Atmos)

Returns: ASCII code of character displayed at location x,y.



SCREEN$ (x,y)  (ZX Spectrum)

Returns: character displayed at location x,y.

ZX Spectrum
Both statements perform virtually the same task. The Oric will return an integer in the form of an ASCII code, whereas the Spectrum will return the character itself.

SGN


SGN(x)  (Oric 1 & Oric Atmos)

SGN x  (ZX Spectrum)

Returns: signum (or sign) of x, for instance -1 if x<0, 0 if x=0 or 1 if x>1.

ZX Spectrum
On the Oric 1 and Atmos, brackets are obligatory.

SIN


SIN(x)  (Oric 1 & Oric Atmos)

SIN x  (ZX Spectrum)

Returns: Sine of x in radians.

ZX Spectrum
Same result all round.

SPC


PRINT SPC(n);  (Oric 1 & Oric Atmos)

Result: Prints a multiple amount of spaces (n).

Not on the ZX Specrum but a quick and simple way to simulate SPC would be to define a dimensional string array and slice the number of spaces required.

For example:

DEF FN s$(n)=s$( TO n)

DIM s$(255)

PRINT FN s$(20);

would print 20 spaces.

Strictly speaking the definable function is not required but it does look and work more like SPC than just using the string slicing method on its own:

s$( TO n)

with one desirable side effect being that if n=0 there will be no error when using FN, but a 'Subscript Error' will occur if you use just standard string slicing.

After DIM no other setting up is required as all newly defined string arrays default to blank spaces (CHR$ 32). This is not very memory efficient though as 255 memory locations are required just to set up s$ with spaces.

See also PRINT, TAB.

SQR


SQR(x)  (Oric 1 & Oric Atmos)

SQR x  (ZX Specrum)

Returns: square root of x.

ZX Spectrum
Same result all round.

STR$

STR$(x)  (ZX Spectrum)

STR$ x  (ZX Spectrum)

Result: string comprising of the numeric value of x.

ZX Spectrum
Same result all round.

TAN


TAN(x)  (Oric 1 & Oric Atmos)

TAN x  (ZX Spectrum)

Returns: Tangent of x in radians.

ZX Spectrum
Same result all round.

USR


USR(m)  (Oric 1 & Oric Atmos)

Result: Places the value of m in the floating point accumulator. Once the machine code routine is completed, USR returns to the main body of the program. The result must either be printed (PRINT USR (0)) or assigned to a variable (A=USR(0)).


USR m  (ZX Spectrum)

Returns: contents of the bc register pair after calling machine code at memory location m.

ZX Spectrum
The ZX Spectrum will return the value of the bc register pair (Z80). Z80 and 6502 machine language subroutines are totally incompatible with each other and must be completely rewritten to accomodate the machine the code is being ported to.

See also CALL, DEFUSR.

USR


USR α$

Returns: location in memory of user defined graphic α$.

ZX Spectrum
The function USR (with string argument) is completely different to USR (numeric argument) above and is used to find the location of a particular user-defined graphic. The Oric 1 and Oric Atmos have a different way of defining UDGs.

VAL


VAL(α$)  (Oric 1 & Oric Atmos)

VAL α$  (ZX Spectrum)
Returns: numeric value evaluated from the string α$.

ZX Spectrum
The Oric micros will only evaluate numbers and anything else will return a zero. The ZX Spectrum will evaluate numbers, mathematical operators, logical operators and variables.

VAL$


VAL$ α$

Returns: string evaluated from the string α$.
ZX Spectrum
There does not appear to be a simple way to simulate this function in Oric Extended Basic.


Constants

Keyword

Meaning

Comments

FALSE


FALSE  (Oric 1 & Oric Atmos)

Returns: The numerical equivalent of zero.

Not on the Spectrum. Can be replaced in a program simply with :

0  (zero!)

or by defining a variable in lieu of a FALSE constant.

LET FALSE=0

See also TRUE.

PI


PI

PI requires no operands.

Returns: 3.1415927 (ZX Spectrum)

or

3.13159265 (Oric 1 & Oric Atmos)

(π) Ratio of circumference of a circle to its diameter

Typical usage might be:

LET R=C/(2*PI)

ZX Spectrum
PI (π) is stored on the Spectrum as 10 digits but will only display 8 digits.

TRUE


TRUE  (Oric 1 & Oric Atmos)

Returns: The numerical equivalent of minus one (-1).

Not on the Spectrum. Can be replaced in a program simply with :

-1  (See note)

or by defining a variable in lieu of a TRUE constant.

LET TRUE=-1

Note: In most cases can just be replaced with '1' but check context of program first.

See also FALSE.


Operators

Keyword

Meaning

Comments

-

Unary Minus/Negation


-x

Result: negates x.

ZX Spectrum
Same result all round.

-

Binary Minus/Subtraction


x-y

Result: a numeric value resulting from y being subtracted from x.

ZX Spectrum
Same result all round.

+

Addition


x+y

Result: a numeric value resulting from y being added to x.

ZX Spectrum
Same result all round.

+

String concatenation


α$+β$

Result: concatenates (joins together) string α with string β to form a new string.

ZX Spectrum
Same result all round.

/

Division


x/y

Result: a numeric value resulting from x being divided by y.

ZX Spectrum
Same result all round.

*

Multiplication


x*y

Result: a numeric value resulting from x being multiplied by y.

ZX Spectrum
Same result all round.

Raise to the power of


x↑y  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: a numeric value resulting from x being raised to the power of y (xy).

ZX Spectrum
On the Oric 1 and Atmos, to give the correct result when x is negative the equation -x↑y requires that the base (the -x part) is enclosed in brackets.

i.e. (-x)↑y

This technique will not work on the ZX Spectrum. If the base number (x) is negative it will produce an 'Invalid Argument' error. A function can be defined to get round this :

DEF FN e(x,y)=(SGN x*(y/2<>
INT (y/2)+(y/2=INT (y/2)))*ABS x↑y

<

Less than


x<y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x<y otherwise 0 (ZX Spectrum)

Result: -1 if x<y otherwise 0 (Oric 1 & Oric Atmos)

ZX Spectrum
Similar result. See note 1.

>

Greater than


x>y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x>y otherwise 0 (ZX Spectrum)

Result: -1 if x>y otherwise 0 (Oric 1 & Oric Atmos)

ZX Spectrum
Similar result. See note 1.

<=

Less than or equal to


x<=y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x≤y otherwise 0 (ZX Spectrum)

Result: -1 if x≤y otherwise 0 (Oric 1 & Oric Atmos)

ZX Spectrum
Similar result. See note 1.

>=

Greater than or equal to


x>=y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x≥y otherwise 0 (ZX Spectrum)

Result: -1 if x≥y otherwise 0 (Oric 1 & Oric Atmos)

ZX Spectrum
Similar result. See note 1.

=

Variable assignment


[LET] x=y  (Oric 1 & Oric Atmos)

LET x=y  (ZX Spectrum)

Where x and y can be either numeric or strings but cannot be mixed.

Result: x is assigned the value y.

ZX Spectrum
Same result all round.

=

Is equal to


x=y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x=y otherwise 0 (ZX Spectrum)

Result: -1 if x=y otherwise 0 (Oric 1 & Oric Atmos)

ZX Spectrum
Similar result. See note 1.

<>

Is not equal to


x<>y

Where x and y can be either numeric or strings but cannot be mixed.

Result: 1 if x≠y otherwise 0.

ZX Spectrum
Similar result. See note 1.

AND


x AND y

Where x is a number or a string, and y is always numeric.  (ZX Spectrum)

Where x and y are both numeric.  (Oric 1 & Oric Atmos)

Returns  (ZX Spectrum): x if y is true (non-zero) or 0 if y is false (zero).

Result  (Oric 1 & Oric Atmos): A bitwise calculation of x and y. Bits in x and y are compared. If bits in both x and y are 1 then the resulting bit after performing a bitwise AND will be 1 otherwise it will be 0.
Testable conditions will return either -1 (true) or 0 (false).

ZX Spectrum
A similar result may occur on both the Spectrum and the Oric 1/Atmos.

See note 2.

To convert the ZX Spectrum's 'Boolean AND' use the following code on the Oric 1 or Atmos:

SGN (x AND y)

OR


x OR y

Where x and y are both numeric.

Returns  (ZX Spectrum): 1 if x or y≠0, value of x if y=0.

Result  (Oric 1 & Oric Atmos): A bitwise calculation of x and y. Bits in x and y are compared. If bits in either x or y are 1 then the resulting bit after performing a bitwise OR will be 1 otherwise it will be 0.

ZX Spectrum
A similar result may occur on both the Spectrum and the Oric1/Atmos.
See note 2.

To convert the ZX Spectrum's 'Boolean OR' use the following code on the Oric:

Z=SGN (x OR y)

IF Z AND ABS(Z)>y THEN Z=x

NOT


NOT x

Where x is numeric.

Returns  (ZX Spectrum): zero if x≠0, 1 if x=0.

Result  (Oric 1 & Oric Atmos): A bitwise reversal of x. Bits in x are reversed; 0 becomes 1, 1 becomes 0.

ZX Spectrum
A similar result may occur on both the Spectrum and the Oric 1/Atmos.

In the event of a problem converting from one machine to the other the following code may help:

To convert the ZX Spectrum's 'Boolean NOT' use the following code on the Oric 1 and Atmos:

x=ABS(x=0)

To convert from the Oric to the Spectrum use this code:

LET x=-x-1


Delimiters

Keyword

Meaning

Comments

TO


v$(x TO y)

v$(x TO)

v$(TO y)

v$( TO )  * This works but is pointless!

Returns: Slices string v from x to y, x to end of string or start of string to y. TO without any operands will return a string unsliced (see fourth example).
ZX Spectrum
Not on the Oric 1 & Oric Atmos. For the equivalent string slicing statements see LEFT$, MID$ and RIGHT$.

;

Semi-colon


PRINT ;  (Oric 1, Oric Atmos, and ZX Spectrum)

LPRINT ;  (ZX Spectrum only)

INPUT ;  (ZX Spectrum)

INPUT message;v  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: separates items within a PRINT, LPRINT (ZX Spectrum only) or INPUT statement.

message is text within double quotes. v is a numeric or string variable.

ZX Spectrum
Similar usage all round.

'

Apostrophe


PRINT '  (Oric 1, Oric Atmos, and ZX Spectrum)

LPRINT '  (ZX Spectrum only)

INPUT '  (ZX Spectrum only)

Result: Moves the PRINT (or LPRINT) position down a line.

ZX Spectrum
The Oric 1 and Atmos micros cannot use an apostrophe as a delimiter in an INPUT statement. It is unclear if an apostrophe will work on the Oric micros, but it is accepted without error.

,

Comma


as a PRINT item


PRINT ,  (Oric 1, Oric Atmos, and ZX Spectrum)

LPRINT ,  (ZX Spectrum only)

INPUT ,  (ZX Spectrum*)

Result: Moves the PRINT position to halfway across the screen (or printer) or to the start of the next line if PRINT position is greater or equal to halfway.

*The Oric 1 and Atmos micros may only use a comma within an INPUT statement to seperate operands.

ZX Spectrum
ZX Spectrum INPUT comma works, just like the PRINT comma, by moving the PRINT position 15 characters along.

,

Comma


as an operand/parameter delimiter


Examples:

POKE x,y  (Oric 1, Oric Atmos, and ZX Spectrum)

ATTR (x,y)  (ZX Spectrum)

Result: Separates operands/parameters within a statement.

ZX Spectrum
Mostly the same all round.

#

Hash


as a stream prefix


PRINT #m  (ZX Spectrum only)

LPRINT #m  (ZX Spectrum only)


OPEN #stream_number;device;device_number;filename

    (ZX Spectrum with ZX Interface 1)


Result: Channel input/ouput through stream m.

ZX Spectrum
The hash does not prefix a stream on the Oric micros.

Some statements on the ZX Spectrum may require the ZX Interface 1.

#

Hash


as a hexadecimal number prefix



#h  (Oric 1 & Oric Atmos)

Returns: a decimal (base10) number from the hexadecimal (base16) number h.

ZX Spectrum
A short BASIC routine could be written to convert hexadecimal to decimal, on the Spectrum.

:

Colon

Type: Statement delimiter

s1 : s2 : s3 ...

Result: Allows more than one statement per line number to be entered.

ZX Spectrum
Same result all round.

"

Single quotation marks


α$="some text"  (Oric 1, Oric Atmos, and ZX Spectrum)

PRINT "some text"  (Oric 1, Oric Atmos, and ZX Spectrum)

LPRINT "some text"  (Oric 1, Oric Atmos, and ZX Spectrum)

INPUT "some text"  (Oric 1, Oric Atmos, and ZX Spectrum)

Result: Encloses text within a string or within a PRINT, INPUT or LPRINT statement.

ZX Spectrum
ZX Spectrum can store a single quote within a set of quotation marks like so

""some text""

produces the output:

"some text"

For the same result on the Oric use the character code CHR$(34), for instance:

PRINT CHR$(34);"some text";CHR$(34)

or for a string variable

α$=CHR$(34)+"some text"+CHR$(34)



Nomenclature

This list uses the same letters to represent variables, expressions and sequences etc. as the ZX Spectrum BASIC manual.

α,β represents a single letter
v represents a variable
x,y,z represents numerical expressions
m,n represents numerical expressions rounded to the nearest integer
b represents a 16 bit binary number
h represents a hexadecimal number
e represents an expression
f represents a string valued expression
s represents a sequence of statement separated by colons :
c represents a sequence of colour items, each terminated by commas , or semi-colons ; A colour item has the form of a PAPER, INK, FLASH, BRIGHT, INVERSE or OVER statement.


References

1. "Making up new noises", Personal Computer News, No.62, May 26th 1984, p.18
Sinclair ZX Spectrum BASIC Programming, Steven Vickers (author), Robin Bradbeer (editor)
The ORIC-1 Basic Programming Manual, John Scriven (author), Sunshine Publications Ltd (publisher), 1983
The ORIC ATMOS Manual, Ian Adamson (author), Pan Books (publisher), 1984


Notes

[1] Due to the way the Oric 1 and Oric Atmos make logical comparisons they will always return -1 if true whereas the Spectrum will return +1. This should not be a problem when converting code between machines but should a problem be encountered use ABS result on the Spectrum to negate the positive result or
-result on the Oric 1 or Atmos to negate the -1 and make it positve.

[2] Whether the result is correct or not will depend on the context of the program.
If the flow of the program only requires boolean logic then converting programs between machines should not cause many problems. However, if a logical 'bitwise' result is required then this is not possible with standard Sinclair BASIC and machine code should be used to return the desired result.

External Links

ZX Spectrum manual for download at World of Spectrum.
Oric 1 manual at thespider.oric.org
Oric Atmos manual at thespider.oric.org




Last revision : 28/07/2024