Sharp MZ-80A User manual


MACHINES
SUPPLIED
IN
THE
U.K.
AND
REPUBLIC
OF
IRELAND
HAVE
48K
BYTE
RAM
FITTED
AS
STANDARD

Personal
Computer
MZ-80A
Owner’s
Manual
080311-250182
C
SHARP
CORPORATION

NOTICE
This
apparatus
complies
with
requirements
of
EEC
directive
76/889/EEC.
This
manual
is
applicable
to
the
SA-5510
BASIC
interpreter
used
with
the
SHARP
MZ-
80A
Personal
Computer.
The
MZ-80A
general-purpose
personal
computer
is
supported
by
system
software
which
is
filed
in
software
packs
(cassette
tapes
or
diskettes).
All
system
software
is
subject
to
revision
without
prior
notice,
therefore,
you
are
requested
to
pay
special
attention
to
file
version
numbers.
This
manual
has
been
carefully
prepared
and
checked
for
completeness,
accuracy
and
clarity.
However,
in
the
event
that
you
should
notice
any
errors
or
ambiguities,
please
feel
free
to
contact
your
local
Sharp
representative
for
clarification.
All
system
software
packs
provided
for
the
MZ-80A
are
original
products,
and
all
rights
are
reserved.
No
portion
of
any
system
software
pack
may
be
copied
without
approval
of
the
Sharp
Corporation.
a

Preface
This
manual
describes
the
Sharp
MZ-80A
personal
computer.
Read
this
manual
thoroughly
to
become
familiar
with
the
operating
procedures,
BASIC
language
and
precautions.
This
manual
des¬
cribes
the
MZ-80A
and
associated
software.
Chapter
1
describes
the
features
of
the
MZ-80A,
general
operating
procedures-read
these
sections
first,
and
language
specifications
and
summary
of
the
standard
system
software
BASIC
interpreter
SA-
5510.
BASIC
(an
abbreviation
for
“Beginner’s
All-purpose
Symbolic
Instruction
Code”)
was
devel¬
oped
as
an
all
purpose
language
to
provide
beginners
with
a
means
of
easily
programming
computers
to
solve
a
diverse
range
of
problems.
Its
simplicity
and
versatility
make
it
well
suited
to
personal
pro¬
gramming
applications.
BASIC
SA-5510
is
an
extended
BASIC
interpreter
which
enables
the
MZ-80A
computer
to
be
used
to
its
fullest
capacity.
Chapter
2
describes
command
and
subroutines
of
the
MONITOR
SA-1510.
Chapter
3
describes
the
hardware.
This
information
will
be
helpful
to
you
if
you
intend
to
expand
system.
iii

Precautions
The
MZ-80A
is
one
of
the
finest
personal
computers
in
the
world;
its
design
incorporates
all
the
technical
knowledge
accumulated
by
Sharp
in
its
many
years
of
experience
in
the
electronics
field.
All
units
are
thoroughly
inspected
prior
to
shipment
so
that
each
will
operate
normally
when
it
is
un¬
packed.
However,
be
sure
to
check
visually
for
any
damage
caused
during
transportation.
If
any
damage
is
found
or
any
parts
are
missing,
contact
your
dealer
immediately.
Observe
the
following
guidelines
to
keep
your
set
in
optimum
operating
condition:
■
Do
not
place
the
MZ-80A
in
locations
where
the
temperature
is
extremely
high
or
low
or
where
it
varies
to
a
great
extent.
Avoid
exposing
the
unit
to
direct
sunlight,
vibration
or
dust.
■
Handle
the
power
cable
carefully
to
prevent
it
from
being
damaged.
When
removing
it
from
the
AC
outlet,
turn
the
power
off
first,
then
pull
the
plug
(do
not
pull
the
cable).
■
If
the
power
switch
is
turned
off
then
immediately
turned
on
again,
initialization
may
not
be
per¬
formed
correctly.
Allow
a
few
moments
after
turning
the
power
off
before
turning
it
on.
■
The
personal
computer
MZ-80A
contains
32K
byte
RAM
as
standard
equipment.
When
you
use
system
software
that
requires
the
disk
drive
access
(DISK
BASIC',
FDOS,
etc.),
it
is
necessary
to
expand
the
existing
RAM
area
to
48
K
bytes.
For
more
detailed
information,
see
Appendix
5.
-
IMPORTANT
-
For
users
in
the
United
Kingdom:
The
wires
in
the
mains
lead
of
this
apparatus
are
coloured
in
accordance
with
the
following
code:
BLUE
:
Neutral
BROWN
:
Live
As
the
colours
of
the
wires
in
the
mains
lead
of
this
apparatus
may
not
correspond
with
the
coloured
markings
identifying
the
terminals
in
your
plug,
proceed
as
follows:
■
The
wire
which
is
coloured
BLUE
must
be
connected
to
the
terminal
which
is
marked
with
the
letter
N
or
coloured
BLACK.
■
The
wire
which
is
coloured
BROWN
must
be
connected
to
the
terminal
which
is
mark¬
ed
with
the
letter
L
or
coloured
RED.
iv

Contents
Notice
ii
Preface
Hi
Precautions
.
iv
Chapter
1
Your
MZ-80A
and
BASIC
Programming
1
1.1
Profile
of
the
MZ-80
A
2
1.2
Operating
the
MZ-80
A
4
Top
view
and
rear
view
of
the
MZ-80A
4
1.2.1
Activating
the
BASIC
interpreter
SA-55
10
5
1
.2.2
Keyboard
6
1.3
Basic
operations
for
programming
9
What
is
the
Direct
Mode?
.
12
The
Four
Arithmetic
Operations
13
String?
Expression?
14
What
are
the
PRINT’S
1st
and
2nd
Approaches?
15
Let
the
Computer
Run!
16
LIST
for
Quick
Understanding
17
Error
Puts
the
Computer
in
Confusion
18
Collect
the
Statewentÿi
19
Correct
the
Statement!
20
Further
Study
of
Comma
and
Semicolon
21
Colon
and
it’s
Use
22
Does
“A
=
B”
Equal
“B=A”?
23
Variables
the
Computer
is
Very
Fond
of
24
Computing
the
Earth
25
Archimedes
and
the
Mysterious
Soldier
26
The
Function
Family
Members
27
Free
Definition
of
Function
....
DEF
FN
28
This
is
INPUT,
Answer
Please
29
Yes
or
No
in
Reply
to
a
Proposal?
.
.ÿ*
30
DATA
and
READ
go
hand
in
hand
31
Don’t
Oppose
GOTO
32
IF
____
THEN
.
33
v

IF
...
.
THEN
and
its
Associates
34
Leave
Any
Decision
to
IF
35
Password
Found
for
Numbers
36
FOR
....
NEXT
is
an
Expert
of
Repetition
37
Loop
in
a
Loop
38
Line
up
in
Numerical
Order
39
How
many
Right
Triangles
are
Possible?
40
TAB
(
)
is
Versatile
41
Grand
Prix
using
RESTORE
42
Talkative
Strings
43
Another
type
of
INPUT
44
LEFTS,
MIDS.
RIGHTS
45
LEN
is
a
Measurement
for
Strings
46
ASC
and
CHRS
are
Relatives
47
STRS
and
VAL
are
Numeral
Converters
48
Print
out
as
£123,
456,
789
49
Difference
between
the
Simple
and
Compound
Interests
50
Annuity
if
Deposited
for
5
years
51
Subroutine
is
the
Ace
of
Programs
52
Stop,
Check
and
Continue
53
Jump
in
masse
Using
the
ON
....
GOTO
statement
54
ON
....
GOSUB
is
the
Use
of
a
Subroutine
Group
55
Primary
Array
has
the
Strength
of
100
Men
56
Array
is
also
Available
for
String
Variables
57
Array
is
the
Master
of
File
Generation
58
Challenge
of
French
Study
59
Secondary
Array
is
More
Powerful
60
What
about
the
Multiplication
Table?
61
Random
Number
is
the
One
Left
to
Chance
62
Make
a
Dice
using
the
RND
function
63
Quick
Change
into
a
Private
Mathematics
Teacher
64
Probable
Calculations
for
Figure’s
Areas
65
Let’s
Make
Money
at
the
Casino
66
Let’s
Create
Exercises
using
the
RND
Function
67
SET
or
RESET?
68
Introduction
to
the
Principles
of
TV
69
Wild
Sketch
70
vi

The
Secret
of
an
Oval
Graph
71
GET
is
a
useful
Key
Input
72
Let’s
Have
a
Look
at
a
Position-Taking
Game
73
TIS
is
a
Digital
Clock
74
Time
for
a
Morning
Call
to
a
Friend
in
Tokyo?
75
Enjoyment
of
Music
76
“I
Change
Strings
to
Music”
said
Mr.
MZ-80A
77
Prelude,
Allegro
Amabile
78
Now
Make
a
Music
Library
79
I’ll
Get
Up
at
7
Tomorrow
Morning
80
Two
Exercises
81
Here’s
Advice
on
how
Lists
can
be
made
82
Cards
if
Dealt
by
a
Poker
Player
83
Program
Recording
(SAVE)
84
Use
of
VERIFY
and
LOAD
Commands
85
Data
can
also
be
Stored
on
Cassette
Tape
86
Technique
to
Memorize
a
Music
History
87
List
of
School
Work
Results
88
Music
Library
Kept
on
Tapes
89
Data
Bank
is
a
Computer’s
Speciality
90
Telephone
Number
List
is
also
a
Data
Bank
91
SOS
in
Morse
Code
92
Signals
in
Dots
and
Dashes
93
Unending
“Time”
94
Miniature
Space
Dictionary
95
A
Solution
of
Simultaneous
equations
96
Find
1000
Prime
Numbers
100
701,
260
Hours
105
1.4
Reserved
word
106
1.5
List
of
BASIC
SA-55
10
commands,
statements
and
functions
107
1.5.1
Commands
107
1.5.2
Assignment
statement
108
1.5.3
Input/output
statements
108
1.5.4
Loop
statement
...
109
1.5.5
Branch
statements
110
1.5.6
Definition
statements
110
1
.5.7
Comment
and
control
statements
Ill
vii

1.5.8
Music
control
statements
112
1.5.9
Graphic
control
statements
112
1.5.10
Cassette
data
file
input/output
statements
112
1
.5.1
1
Machine
language
control
statements
113
1.5.12
Printer
control
statements
114
1.5.13
I/O
input/output
statements
114
1.5.14
Arithmetic
functions
114
1.5.15
String
control
functions
116
1.5.16
Tabulation
function
116
1.5.17
Arithmetic
operators
117
1.5.18
Logical
operators
117
1.5.19
Other
symbols
118
1.5.20
Error
message
table
120
1.6
How
to
obtain
copied
BASIC
tapes
122
Chapter
2
Monitor
Program
of
the
MZ-80A
123
2.1
MONITOR
SA-1
5
10
Commands
and
Subroutines
124
2.1.1
Using
monitor
commands
124
2.1.2
Monitor
subroutines
124
2.2
MONITOR
SA-1
5
10
Assembly
Listing
130
Chapter
3
Hardware
Configuration
of
the
MZ-80A
161
3.
1
The
MZ-80A
system
configuration
162
3.1.1
Memory
configurations
164
3.1.2
Key
scanning
system
167
3.2
The
MZ-80
A
circuit
diagram
169
3.3
Expansion
equipments
176
3.4
Technical
Data
of
Z80
CPU
178
APPENDIX
209
A.
1
ASCII
Code
Table
210
A.2
Display
Code
Table
211
A.
3
Mnemonic
Codes
and
Corresponding
Object
Codes
212
A.4
Specifications
222
A.5
Caring
for
the
system
224
viii

Your
MZ-80A
and
BASIC
Programming
Chapter
1

1.1
Profile
of
the
MZ-80A
You
must
know
the
configuration
of
a
computer
to
construct
programs
which
can
actually
run
on
it
.
The
more
you
know
about
the
console,
memory,
processors,
peripheral
environment,
and
language
processing
programs,
the
more
efficient
and
elaborate
your
programs
will
be
because
you
can
create
your
programs
taking
full
advantage
of
the
computer
facilities.
You
can.
however,
acquire
detailed
such
detailed
knowledge
only
by
accumulating
experience
in
designing
and
running
programs
on
a
computer
yourself.
This
first
section
presents
a
profile
of
the
SHARP
MZ-80A
personal
computer
to
allow
you
to
grasp
an
outline
of
its
hardware
configuration
and
basic
operating
procedures.
In
the
next
section,
we
will
take
our
first
steps
in
computer
programming.
■
Profile
The
MZ-80A
is
an
integrated
personal
computer
which
made
its
debut
in
the
fall
of
1
98
1
.
It
is
a
completely
new
multi-purpose
small
computer
designed
with
a
wide
range
of
future
hardware
and
software
applications
in
mind.
Its
greatest
features
are
its
high
speed
and
ease
of
operation.
When
it
was
introduced,
the
MZ-80A
was
widely
acclaimed
as
a
system
which
would
open
a
new
dimension
in
computer
programming.
Figure
1.1
is
a
simplified
illustration
of
the
hardware
configuration
of
the
MZ-80A.
It
consists
of
a
storage
unit
(which
stores
programs
and
data),
a
central
processing
unit
(which
performs
operations
on
data
as
directed
by
the
pro¬
grams
in
the
storage
unit
and
transfers
the
data
to
and
from
the
storage
unit),
and
several
input/output
units.
The
storage
unit
is
divided
into
main
memory,
monitor
program,
and
video
RAM
sections.
The
MZ-80A
has
32
K
bytes
of
RAM
(read/write
memory)
in
its
main
memory
section.
The
main
memory
section
can
be
expanded
to
48
K
bytes
by
incorporating
an
additional
16
K
bytes
of
RAM.
The
input
units
include
a
keyboard
and
a
cassette
tape
unit.
The
output
units
include
CRT
display,
cassette
tape,
and
audio
output
units.
Keyboard,
casselte
tape
unit,
input
port
Central
processing
unit
(Z80
CPU)
CRT
display
unit,
cassette
tape
unit,
audio
output
unit,
output
port
Figure
1.1
MZ-80A
configuration

3
The
central
processing
unit,
which
consists
of
control
and
arithmetic
sections,
performs
active
dynamically;
it
serves
as
the
brain
of
the
computer
and
controls
it
overall
operation.
Its
operation,
however,
is
made
up
of
repetitions
of
the
following
simple
operating
sequence:
1
.
A
data
item
containing
an
instruction
is
read
from
storage.
2.
The
instruction
is
executed.
In
other
words,
logically
speaking
it
is
a
collection
of
data
items
in
the
storage
unit
give
instructions
that
cause
the
computer
to
operate
in
a
dynamic
manner.
This
collection
of
data
items
is
called
a
program.
It
is,
therefore,
necessary
to
prepare
a
program
to
indicate
the
steps
of
a
job
and
store
it
in
the
storage
unit
to
cause
the
computer
to
perform
the
job.
Inside
the
computer,
data
and
control
signals
are
logically
represented
by
binary
numbers
which
are
represented
by
the
digits
of
0
and
1
.
The
number
of
digits
of
a
binary
number
(i.e.,
a
sequence
of
Os
and
Is)
is
counted
in
terms
of
bits.
For
example,
the
8-bit
binary
number
00110101
is
a
data
item
which
has
a
length
of
8
bits
(this
is
equivalent
to
53
in
decimal
representation).
Since
bits
are
too
small
to
be
convenient
for
indicating
the
length
of
data,
a
unit
called
the
“byte”
is
used
to
indicate
a
data
item
of
8
bits.
One
byte
can
represent
up
to
28
(=
2
56)
different
numbers.
The
MZ-80A
employs
a
Z80,
a
so-called
8-bit
microprocessor
(which
process
one
byte
of
data
at
a
time),
as
its
central
processing
unit.
Accordingly,
programs
which
give
instructions
and
data
to
be
processed
are
all
stored
and
trans¬
ferred
in
byte
units.
Byte
locations
in
the
storage
unit
are
designated
by
a
2-byte
pointer
in
the
central
processing
unit.
With
this
2-byte
pointer,
the
Z80
can
address
up
to
216
(=
65536)
locations.
Since
2*°
(=
1024)
represents
1
K
bytes,
the
Z80
is
said
to
have
an
address
space
of
64
K
bytes.
As
mentioned
above,
the
MZ-80A
main
storage
unit
is
made
up
of
48
K
bytes,
or
3/4
of
the
Z80
RAM
(Random
Access
Memory)
address
space.
RAM
is
a
type
of
memory
which
can
be
freely
read
and
written;
on
the
other
hand,
ROM
(Read
Only
Memory)
can
only
be
read.
The
majority
of
special-purpose
computers
dedicated
to
automatic
control
systems
and
many
personal
computers
have
memories
in
which
1/3
to
1/2
or
more
of
the
memory
space
is
composed
of
ROM
for
storage
of
control
or
system
programs
(e.g.,
BASIC
interpreter
programs).
The
use
of
RAM
in
the
memory
configuration
of
the
MZ-80A
is
based
on
the
premise
that
main
memory
should
be
freely
available
for
a
variety
of
uses.
The
MZ-80A
stores
all
system
programs
in
external
files
from
which
they
are
loaded
into
main
memory
by
a
monitor
program.
The
SA-5510
BASIC
interpreter,
one
of
the
MZ-80A
system
programs,
functions
to
translate
BASIC
source
pro¬
grams
into
machine
code
for
execution.
The
personal
computer
MZ-80A

4
1.2
Operating
the
MZ-80A
This
section
describes
the
constituent
units
of
the
MZ-80A
and
their
functions.
■
Top
view
of
the
MZ-80A
CRT
display
Main
keyboard
Tape
counter
Cassette
tape
deck
Cassette
tape
deck
control
buttons
Numeric
pad
Figure
1.2
■
Rear
view
of
the
MZ-80A
Volume
control
Brightness
control
I/O
module
access
window
No.
1
~
4
Figure
1.3

5
1.2.1
Activating
system
software
The
MZ-80A
personal
computer
is
supported
by
system
software
which
is
filed
in
software
packs.
BASIC
SA-5510
is
stored
on
a
cassette
tape
file,
and
must
undergo
initial
program
loading
whenever
it
is
to
be
used.
Loading
is
easily
achieved.
First,
turn
on
the
power
switch
on
the
back
of
the
MZ-80A.
The
Monitor
program
starts
and
the
following
message
will
be
displayed
on
the
CRT
display.
*
*
MONITOR
SA-1
5
10
*
*
*
Sf
A
1
—
cursor
flickers
Place
the
BASIC
cassette
file
in
the
cassette
tape
deck
and
press
the
[jL]
key.
then
press
the
[
CR
1
key.
(L:
Load)
The
Monitor's
program
loader
starts,
and
message
“4
PLAY”
is
displayed.
Press
the
|
PLAY
1
button
of
the
cas¬
sette
tape
deck.
The
program
loader
loads
the
BASIC
interpreter
(photo
at
left
of
Figure
1
.4),
and
upon
completion
of
loading,
the
MZ-80A
displays
the
message
illustrated
in
the
photo
at
right
and
the
BASIC
interpreter
begins
to
operate.
The
message
"Ready”
indicates
that
system
control
is
at
the
BASIC
command
level
and
that
the
system
is
ready
to
accept
any
command.
••
MONITOR
SA-1518
M
>L
*
PLAY
Loading
BASIC
SA-5510
«•
MONITOR
SA-1510
••
•L
•
PLAY
Loading
BASIC
SA-5510
BASIC
interpreter
SA-5510
Copyright
1981
by
SHARP
Corp.
20204
Bytes
Ready
Figure
1.4
Please
refer
to
the
chapter
2
on
activating
system
software
from
the
diskette
files
and
Monitor
commands.

6
1.2.2
Keyboard
The
keyboard
of
the
MZ-80A
is
arranged
as
shown
in
Figure
15,
and
is
divided
into
2
areas;
main
keyboard
and
numeric
pad.
7
V
X
9
)
\
'
+
■
/-H1
Til
5
W
r~\
1
2
-*ÿ
E
N
T
i
_
S
1
—
*
—
N
00
rH
numeric
pad
main
keyboard
Figure
1
5
The
keyboard
of
the
MZ-80A
The
main
keyboard
(typewriter
keyboard)
conforms
to
ASCII
standard
and
includes
character
keys
and
control
keys
(such
as
the
carriage
return
key,
the
control
key
and
the
cursor
control
keys.)
The
numeric
pad
is
for
entering
numeric
data
and
is
similar
to
that
of
an
ordinary
electronic
calculator.
The
main
keyboard
has
two
operating
modes;
(1]
Normal
mode
[2]
Graphic
mode
Keys
provided
on
the
main
keyboard
produce
different
characters
according
to
operating
mode,
as
shown
in
Figure
1.6.
normal
mode
A
a
hold
down
SHIFT
graphic
mode
V
4*
hold
down
SHIFTS
Figure
1.6
Different
characters
of
the
X
key
Note
that
the
letter
key
normally
produce
capital
letters.
To
enter
lower
case
letters,
hold
down
the
SHIFT
key
then
press
the
letter
key-just
opposite
of
an
ordinary
typewriter.
The
reason
for
this
is
that
capital
letters
are
generally
easier
to
read
on
the
screen,
so
most
people
prefer
to
write
their
programs
in
capital
letters.

7
Figure
1
.7
shows
the
control
keys
(the
stippled
keys).
7
/\
8
9
*
'3
-
nr
t
/
\
E
\rÿ\
3
lj
o
00
|-
n
The
functions
of
the
control
keys
are
explained
below.
SHIFT
Similar
to
the
shift
key
of
an
ordinary
typewriter;
when
this
key
is
depressed,
the
character
keys
and
some
control
keys
are
shifted.
Carriage
return
key.
The
ENT|
key
has
the
same
function
as
the
[
CR
key.
GRPH
If
this
key
is
pressed
in
the
normal
mode,
the
graphic
mode
is
entered
and
the
cursor
pattern
changes
from
“
fif
”
to
“
*ÿ
”,
and
vice
versa.
INST
DEL
DEL
erases
the
character
at
the
left
of
the
cursor
location,
shifting
all
following
characters
of
the
string
to
the
left
one
space.
INST
inserts
a
space
where
the
cursor
is
located
by
shifting
all
following
characters
of
the
string
to
the
right
one
space.
:
HOME
returns
the
cursor
to
the
upper
left
hand
comer
of
the
display
screen.
CLR
clears
the
display
screen
and
also
returns
the
cursor
to
the
screen's
upper
left
hand
comer.
In
the
graphic
mode,
HOME
produces
the
reverse
character
“
H
”,
and
CLR
produces
the
reverse
character
“
H
”,
t
o*so»
T
Cursor
control
keys.
Each
key
moves
the
cursor
in
the
direction
indicated
by
the
arrow
(normal
position
and
shift
position).
In
the
graphic
mode,
each
key
produces
the
reverse
arrow;
DDES.
When
this
key
is
pressed
with
the
SHIFT
key
depressed,
a
break
code
is
generated,
and
halts
execution
of
BASIC
programs.

8
Figure
1.8
shows
the
[CTRL]
key
and
some
other
keys
(the
stippled
keys).
n
8
/
\
9
+
-v
4
r~[
’
1
E
'
0
/
\
00
a
l
_
k
T
l
_
The
functions
of
these
keys
depressing
the
CTRL
key
are
explained
below.
CTRL
+
A
CTRL
+
IT
CTRL
+
D
CTRL
+
Z
CTRL
CTRL
CTRL
+
m
This
locks
the
SHIFT
]
key
so
that
it
does
not
need
to
be
held
down.
Pressing
these
keys
again
or
pressing
the
CR
key
releases
the
shift
lock.
This
rolls
down
the
listing
of
the
CRT
display.
This
rolls
up
the
listing
of
the
CRT
display.
This
generates
the
character
This
character
is
used
as
a
delimiter
(PASCAL,
FDOS,
etc.)
This
sets
the
character
display
mode
to
reverse
mode.
Pressing
these
keys
again
sets
the
character
display
mode
to
normal
mode.
This
sets
the
V-RAM
configuration
to
the
MZ-80K
mode.
This
sets
the
V
RAM
configuration
to
the
MZ-80A
mode.

9
1.3
BASIC
Operations
for
Programming
Now
let’s
start
our
study
of
BASIC
programming.
Here,
our
purpose
is
to
allow
the
beginner
to
gain
familiarity
with
the
basic
elements
of
programs.
In
the
first
section,
we
will
construct
very
short
programs
to
illustrate
fundamen¬
tal
concepts
and
learn
about
basic
operations
which
are
required
during
the
course
of
BASIC
programming.
That
is,
we
will
learn
:
jTl
How
to
construct
a
program.
[~2]
How
to
run
a
program.
[~3~|
How
to
correct
a
program.
[7
How
to
store
a
program
(on
cassette
tape).
[~5~]
How
to
run
a
program
stored
in
an
external
file.
HD
Constructing
a
program
To
have
a
computer
do
a
job,
it
must
be
given
sequence
of
instructions
according
to
which
it
is
to
work.
Determin¬
ing
the
sequence
of
instructions,
implementing
them
as
a
BASIC
program
,
entering
the
program
into
the
MZ-80A
from
the
keyboard,
and
correcting
the
program
afterwards
are
operations
which
are
fundamental
to
program
development.
The
problem
is
given
below
is
a
simple
example
of
work
to
be
done
on
a
computer.
Example
0:
Read
two
numeric
data
items
from
the
keyboard
,
compute
their
sum,
and
display
the
result.
The
sequence
of
instructions
is,
as
indicated
in
the
problem,
“read
two
numeric
data
items
from
the
keyboard,”
“compute
their
sum,”
and
“display
the
result."
These
instructions
are
written
in
BASIC
as
follows:
10
INPUT
A
20
INPUT
B
two
numeric
data
items
from
the
keyboard.
30
LET
C
=
A
+
B
.......
Compute
their
sum.
40
PRINT
C
...........
Display
the
result.
SO
END
End.
On
the
first
two
lines,
variables
A
and
B
are
assigned
two
numeric
values
through
the
INPUT
statement,
which
has
the
function
of
receiving
data
from
the
keyboard.
On
the
next
line,
the
sum
of
A
and
B
is
assigned
to
variable
C.
Tire
content
of
C
is
shown
on
the
display
unit
through
the
PRINT
statement
on
the
next
line,
which
has
the
function
of
displaying
data
on
the
CRT
display
unit.
Then
the
program
ends.
Although
we
explain
these
steps
as
if
they
were
a
matter
of
course,
they
are
far
from
self-explanatory.
Thus,
it
is
here
that
we
will
begin
our
study.
There
are
two
points
to
keep
in
mind
in
the
above
problem:
■
A
BASIC
program
is
written
using
words
such
as
INPUT,
LET,
PRINT,
END,
etc.
Lines
containing
these
words
are
called
INPUT
statements,
PRINT
statements,
and
so
forth.
■
Each
line
begins
with
a
number
such
as
10.
In
other
words,
a
BASIC
program
is
made
up
of
statements
beginning
with
a
set
of
words
(called
reserved
words)
or
their
abbreviations,
and
numbers
(called
line
numbers)
which
precede
the
statements.
Although
the
above
program
has
only
five
lines,
it
is
a
complete
program.
In
fact,
a
single
line
can
constitute
a
program
if
it
contains
a
line
number
and
a
statement.
Large
programs
have
the
same
program
elements
ss
such
a
single
line
program.

10
The
next
step
is
to
enter
their
program
into
the
computer
from
the
keyboard.
This
is
not
hard
to
do;
you
can
enter
it
in
the
same
way
you
type
on
a
typewriter.
You
must
take
note,
however,
of
the
following:
■
All
variable
names
and
words
such
as
INPUT
and
PRINT
must
be
entered
in
upper
case
letters.
The
MZ-80A
keyboard
prints
upper
case
letters
in
the
normal
mode
and
lower
case
letters
in
the
shift
mode,
so
you
need
not
press
the
SHIFT
key
(as
with
a
typewriter)
when
keying
upper
case
letters.
■
Each
line
must
be
terminated
by
pressing
the
CR
key
(or
ENT
key
on
the
numeric
key
pad).
A
line
of
data
keyed
in
is
not
stored
in
memory
as
a
program
line
until
the
CR
key
is
pressed.
Now,
key
in
the
first
line.
1
0
INPUT
A
CR
The
cursor
on
the
screen
will
move
to
the
beginning
of
the
next
line
when
the
CR
key
is
pressed.
Enter
the
second
and
third
lines
in
succession.
The
entire
program
is
stored
in
memory
when
the
END
statement
on
line
number
50
is
entered,
followed
by
pressing
the
CR
key.
Now
key
in:
L
1
S
T
CR
The
listing
of
program
input
will
appear
on
the
screen.
LIST
is
a
command
which
displays
the
list
of
program
lines
stored
in
memory
on
the
screen.
It
is
called
a
command
to
distinguish
it
from
statements
(such
as
INPUT)
which
are
used
within
the
program.
|_2j
Executing
a
program
To
execute
a
program,
give
the
RUN
command
to
the
computer.
Key
in:
R
U
N
CR
A
“
?
”
mark
will
then
appear
on
the
next
line
and
the
cursor
will
flash.
This
means
that
the
program
execution
has
started
and
that
the
first
INPUT
statement
is
being
executed.
Key
in,
for
example,
the
number
19
as
the
value
of
variable
A.
Entry
of
data
during
execution
of
the
INPUT
statement
must
also
be
terminated
by
pressing
CR
1
9
CR
It
is
convenient
to
use
the
ENT
1
key,
instead
of
the_CR
key,
when
entering
numeric
values
from
the
numeric
key
pad.
The
second
INPUT
statement
is
then
executed
and
a
“
?
”
mark
again
appears
on
the
screen.
Key
in
"81”
as
the
value
of
variable
B.
8
1
CR
The
computer,
on
receiving
the
variable
B
value,
performs
computation
and
assignment
operations
as
directed
on
line
number
30,
then
displays
the
result
1
0
0
on
the
screen
as
directed
by
the
PRINT
statement
on
line
number
40.
Thus,
we
obtain
the
result
of
adding
19
+
81.
The
computer
ends
program
execution
when
it
encouters
the
END
statement
on
line
number
50,
displays
Ready
on
the
screen
and
causes
the
cursor
to
start
flashing
again.
The
“Ready”
message
indicates
that
the
computer
is
in
a
mode,
called
the
command
mode,
in
which
no
program
is
executed
and
commands
are
awaited.
In
the
command
mode.
you
can
enter
commands
such
as
LIST
and
RUN
or
modify
the
program.
0
Correcting
a
program
The
procedure
for
correcting
or
modifying
a
program
is
basically
the
same
as
the
procedure
for
creating
one.
For
example,
to
modify
the
above
program
so
that
the
result
of
A
—
B
is
assigned
to
variable
C
and
the
content
of
C
is
displayed
on
the
screen,
it
is
necessary
to
key
in
3
0
LET
C
=
A
-
B
CR
as
mi
ch
an
af'
0
le:
wl
in
Pi
N
Other manuals for MZ-80A
1
Table of contents
Other Sharp Desktop manuals

Sharp
Sharp MZ-80B User manual

Sharp
Sharp PC-1500A User manual

Sharp
Sharp ZQ-4400 User manual

Sharp
Sharp MZ-80A User manual

Sharp
Sharp MZ-80B User manual

Sharp
Sharp MZ-3500 User manual

Sharp
Sharp MZ-5600 User manual

Sharp
Sharp MZ-700 Series User manual

Sharp
Sharp MZ-5500 User manual

Sharp
Sharp CE-159 User manual

Sharp
Sharp Mobilon HC-4000 User manual

Sharp
Sharp MZ-3500 User manual

Sharp
Sharp PN-L602B User manual

Sharp
Sharp PN-L602B Instruction Manual

Sharp
Sharp MZ-700 Series User manual

Sharp
Sharp SCR3042FB User manual

Sharp
Sharp YO-250M User manual

Sharp
Sharp YO-270 User manual

Sharp
Sharp MZ-800 User manual

Sharp
Sharp MZ-808 User manual