EasyManuals Logo

Sinclair ZX81 User Manual

Sinclair ZX81
92 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #88 background imageLoading...
Page #88 background image
In (a), suppose the string expression has the value s$.
If the slicer is empty, then the result is s$ considered as a substring of itself.
If the slicer is a numerical expression with value m, then the result is the mth character of s$ (a substring
of length 1).
If the slicer has the form (iii), then suppose the first numerical expression has the value m (the default
value is 1), & the second, n (the default value is the length of s$).
If 1 m n the length of s$ then the result is the substring of s$ starting with the mth character &
ending with the nth.
If 0 n m then the result is the empty string.
Otherwise, error 3 results.
Slicing is performed before functions or operations are evaluated, unless brackets dictate otherwise.
Substrings can be assigned to (see
LET
).
The argument of a function does not need brackets if it is a constant or a (possibly subscripted or sliced)
variable.
Function Type of operand
(x)
Result
ABS
number Absolute magnitude.
ACS
number Arccosine in radians.
Error A if x not in the range -1 to +1.
AND
binary operation, right
operand always a
number
Numeric left operand:
A
AND
B = A if B 0, 0 if B = 0
String left operand:
A$
AND
B = A$ if B 0, "" if B = 0
ASN
number Arcsine in radians.
Error A if x not in the range -1 to +1.
ATN
number Arctangent in radians.
CHR$
number The character whose code is x, rounded to the nearest integer.
Error B if x not in the range 0 to 255.
CODE
string The code of the first character in x (or 0 if x is the empty string).
COS
number (in radians) Cosine
EXP
number
e
x
INKEY$
none Reads the keyboard. The result is the character representing (in
mode) the key pressed if there is exactly one, else the empty string.
INT
number Integer part (always rounds down).
LEN
string Length
LN
number Natural logarithm (to base e) Error A if x 0
NOT
number 0 if x 0, 1 if x = 0.
NOT
has priority 4.
OR
binary operation, both
operands numbers
A
OR
B = 1 if B 0, A if B = 0
OR
has priority 2.
PEEK
number The value of the byte in memory whose address is x (rounded to the
nearest integer).
Error B if x not in the range 0 to 65535.
PI
none (3.14159265..)
RND
none The next pseudo-random number y in a sequence generated by taking
the powers of 75 modulo 65537, subtracting 1 & dividing by 65536. 0
y 1.
SGN
number Signum: the sign (-1, 0 or +1) of x.
SIN
number (in radians) Sine
SQR
number Square root
Error B if x < 0
STR$
number The string of characters that would be displayed if x were printed.

Other manuals for Sinclair ZX81

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX81 and is the answer not in the manual?

Sinclair ZX81 Specifications

General IconGeneral
ProcessorZilog Z80A
Processor Speed3.25 MHz
ROM8 KB
InputMembrane keyboard
StorageCassette tape
Power Supply9V DC
Dimensions167 mm x 40 mm x 175 mm
Release Year1981
ManufacturerSinclair Research
Weight350 g
Operating SystemSinclair BASIC
RAM1 KB
PortsTV out, expansion port
DisplayTelevision (RF modulator output)

Related product manuals