Sharp MZ-700 Series Owner's Manual page 96

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

2.8.5 Preparing machine language programs
A m a c h i n e language p r o g r a m w h i c h fills t h e e n t i r e display screen w i t h t h e c h a r a c t e r s s u p p o r t e d b y t h e
M Z - 7 0 0 is p r e s e n t e d in t h i s s e c t i o n as an e x a m p l e .
T h e f o l l o w i n g B A S I C p r o g r a m l o a d s s u c h a m a c h i n e p r o g r a m i n t o m e m o r y a n d calls it.
10 L I M I T
$ B F F F
2 0 GOSUB 5 0
3 0 USRC$C0003
4 0
END
5 0 FOR
I
= 4 9 1 5 2
TO
4 9 1 8 !
6 0
READ M
7 0 POKE
I , M
8 0 NEXT
I
9 0
RETURN
Limits the BASIC area to $BFFF.
•Calls the machine language program.
DATA
1 9 7 : R E M
PUSH BC
1 10 DATA 2 1 3 : REM
PUSH DE
1 2 0 DATA 2 2 9 :REI1
PUSH HL
1 3 0 DATA 2 2 , 0 : R E M
LO D , 0
1 4 0 DATA 3 3 , 0 , 2 0 8 :REf1
LD
H L , D 0 0 0 H
1 5 0 DATA
1 , 2 3 2 , 3 • REM
LD
B C ,
1
0 0 0
1 6 0 DATA 2 4 3 : R E M
DJ
1 7 0 DATA 21 1 , 2 2 7 : R E M
OUT
C E 3 H T A
1 8 0 DATA
1 1 4 ^ REM
S T 0 : L D
C H L 3 , D
:
1 9 0 DATA 3 5 :REM
INC HL
!
2 0 0
DATA 2 0 :REM
INC D
2 1 0
DATA
11 : R E n
DEC BC
2 2 0
DATA
120 : REM
LD A , B
2 3 0 DATA
177 :REM
OR C
2 4 0 DATA
1 9 4 , 1 4 , 1 9 2 • REM JP
N 2 , S T O
2 5 0
DATA 2 1 1 , 2 2 5 : REM
OUT
C E 1 H ] , A
2 6 0
DATA 2 5 1 : R E M
E I
2 7 0
DATA 2 2 5 :REt1
POP HL
2 8 0 DATA 2 0 9 • R E M
POP DE
2 9 0
DATA
193 :REM
POP BC
3 0 0
DATA 2 0 1 : R E M
RET
Reads data for the machine language program from DATA
statements and writes it into the machine language area.
Beginning of data for the machine language program.
Switches the memory block to video RAM. (See page
155).
Sets a display code to video RAM.
Switches the memory block to RAM. (See page 127.)
Returns to the BASIC program.
If t h e m a c h i n e language p r o g r a m h a s b e e n g e n e r a t e d w i t h t h e m o n i t o r a n d saved o n c a s s e t t e t a p e u n d e r
t h e file n a m e D I S P L A Y C O D E , use t h e f o l l o w i n g p r o g r a m t o call t h e m a c h i n e language p r o g r a m .
1 1 0
L I M I T
S B F F F
1 1 0
L O A D
" D I S P L A Y C O D E "
1 2 0
U S R
C S C 0 0 0 )
94-

Advertisement

Table of Contents
loading

Table of Contents