Printer Control Statements; I/O Input/Output Statements; 1.5.14 Arithmetic Functions - Sharp MZ-80A Owner's Manual

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

114
1.5.12 Printer control
statements
PRINT/P
10
PRINT/P
A.
AS
Performs the
nearly
same
operation
as
the
PRINT
statement
on the
optional
printer (MZ-80P4.
P5 or
P6).
Prints the numeric value of A and the character
string
of variable
AS
on the line printer.
20
PRINT/P
CHRS
(5)
Executes
paper home feed. (CHRS(5) is a control
code.)
30
PRINT/P
CHR$(
1 8)
Sets
the enlarged
character
print
mode. (CHR$(18)
is
also a control
code.)
COPY/P
10
COPY/P
1
Causes
the printer
to
copy
the character display.
PAGE/P
100
PAGE/P
20
Specifies
20 lines
to
be contained
in
one page of the line
printer.
1.5.13
I/O
input/output
statements
INP
Reads data on the specified
I/O
port.
10 INP
@12,
A
The statement on line number 10
reads data
on
I/O
port
12.
20 PRINT
A
OUT
Outputs data
to the
specified
I/O
port.
30 B
=
ASC ("A")
The statement on line 40
outputs
the ASCII code of the character
40 OUT
@13.
B
"A"
to
I/O
port
13.
1.5.14 Arithmetic functions
ABS
100
A
=
ABS (X)
Substitutes the absolute value of variable X
into
variable A.
X
may
be either a constant
or an
expression.
Ex) ABS (-3)
=
3
ABS (12)= 12
INT
100 A
=
INT
(X)
Substitutes the greatest
integer
which
is less than
X
into variable A.
X
may be either a numeric constant or an expression.
Ex)
INT (3.87)
=
3
INT
(0.6)
=
0
INT (-3.87)
=
-4
SGN
100
A
=
SGN
(X)
Substitutes one of the following values
into
variable
A:
1 when
X<0,
0 when X=0 and
1
when X>0. X
may
be either a constant
or an
expression.
Ex)
SGN
(0.4)
=
1
SGN (0)
=
0
SGN (-400)
=
-
1
i

Advertisement

Table of Contents
loading

Table of Contents