0% found this document useful (0 votes)
336 views59 pages

uPF1 Monitor Program Listing (Original Scan)

MULTITECH'S uPF1 (Microprofessor-1) Monitor Program Listing (Original Scan)
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
336 views59 pages

uPF1 Monitor Program Listing (Original Scan)

MULTITECH'S uPF1 (Microprofessor-1) Monitor Program Listing (Original Scan)
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

NlPF-1

MONITOR PROGRAM SOURCE LISTING

MULTITECH INDUSTRIAL CORP.

MONITOR

hlPF-1

PROGRAM
SO:URCE LISTING

Copyright© 1981 by M ultitech Industrial Corp. No part 'Of, this puoucatloo may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic,. mechanical, photocopying, recording, or otherwise. , without the prior written permission 0,1 the publisher. Sixth Edition

COPYRIGHT Copyright © 1981 by MULTITECH INDUSTRIAL CORP. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of MUL TITECH INDUSTRIAL CORP.

DISCLA.lMER MUL TITECH INDUSTR IAL CORP. makes no representations or warranties, either express or implied, with respect to the contents hereof and specifically disclaims any warranties or merchantability or fitness for any particular purpose. MU LTITECH INDUSTRIAL CORP. software described in 'this manual is sold or licensed "as is". Should the programs prove defective following their purchase, the buyer (and not MUL TITECH INDUSTRIAL CORP., its distributor, or its dealer) assumes the entire cost of all necessary servicing, repair, and any incidental or consequentiai damages resulting from any defect in the software. Further. MULTITECH INDUSTRIAL CORP. reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of MU LTITECH INDUSTRIAL CORP. to notify any person of such revision or chanqes,

AA. '\:.I

hlultitech
INDUSTRIAL
OFFICE!

CORP,

16F'l. 135 CH~EN tWO 'N. ROAD. sec. 2, TAlp'E' 10479. TAIWAN. R,O.C. TEl: 102)505.5533 TElEX: 19162 MULTIIC FAX: 102)505-4451

FACTORY! 1 )NDUSTRVE. ROAD. III. HSINCHU SCIENCE-BASED INDUSTRIAL HSINCHU. TAIWAN 300. R,O_C,

PARK

LOC

MPF-I OBJ CODE M STMT SOURCE STATEMENT

1 2
. 3 4 5 6 7 8
9

;**•••••••• *••*••• ************ ••*.**.**** •••*••• *•••••••• * ••


;. ;. ;. ;. COPYRIGHT,MOLTITECH INDUSTRIAL CORP. 1981 All right reserved. No part of this software may be copied wi t ho ut the ex~ress written consent of MULTITECH INDUSTRIAL CORP.

, .* • .******••*•••••• ****** •••**•••••••••••••••••• **•••• *•••*** •• ,

;* ;*

• ... ... ...

10 11 12 13 14 16

15

P8255 DIGIT
SEG7

17
18 20

19

21
22

KIN PWCODE ZSUMf

EQU EQU EQU EQU EQU EQU

03H OlB

028 OOH

7lH

OASH

;8255 port I control ;8255 r port C ;8255 I port B ;8255 I port A ; Power-up code will make the sun of ;This ;moni tor codes to be zero. timing. (In this

all

23 26
27 24 25

The folloWing EQUATEs are used for depend on the CPU clock r r eq uenc y, crystal frEquency is 1.79 MHz.) COLDEL FIKHZ F2KHZ

Their values version, the

28 29 30 31
32 33 34

EQU
EQU EQU

201 65 31 42

MPERIOD EQU

;Column delay for routine time ;SCAN and SCANt. wave, ;Delay count for lK Hz square TONEIK. i us ed by rout1n ;Delay count for 2K Hz square wave, i used by routi ne TONE2K. ;lK Hz and 2K Hz threshold, used by ;tape input routine PERIOD.

35
36 37 38 39 41 42 43

40

44 45 46 47 48 49 50 51
52 53

The following EQUATEs are for tape modulation •. If the quali ty of tape recorder 1s good, the user may change '4 4 2 8' to "2 2 1 4'. This will double the tape data rate. If the quali ty of tape recorder is poor, the user may change '4 428 ' to '66 3 12'. This will improve error per.fomance but slow d own the data rate. Although the data lomat is changed, the tape is still ccxnpatible in each case, because only the ratio 1s detected in the Tape-read. ONE lK ONE-2K ZERO lK ZERO-2K EQU EQU EQU

EQU

4 4 2 8 (8255 I)

;•••***••***•••••••• ****••••• **•••**.*****.* ••*******.** •••*


I/O port assignment: port A (address OOH): bit 7 ~- tape input bit 6 -'USER KEY' on bit 5-0 row of ke)tboard

57 58

54 55 56

keyboard, matrix

active low input ,active

low

MPF-I
LOC OBJ CODE M STMT SOURCE STATEMENT 59·

port

60 61 62 63
64 ~5

B (address 01H): 7 .segaments bi t 7 s egam ent; d bi t 6 decimal point bi t 5 segam ent c bi t 4 segam ent; b
bi.t 3 s.. ga.ment a e

of LED,

acUve

high

66 67 68 70 71 72
73 69

port

74
75 76 77 78 79 80
81 83 84 85

bi t 2 segament f bit 1 s-egament s hi t 0 s eg azn eot ,e C (address 02R); bi t 7 tape & tone output bit 6 -- BREAK enable. NMI (CPU pin 17) will goes to low 5 Ml's (machine cycle one) after .t ht s bi t goes to low. (Ttlis bi t is connected to the reset input of external count e r , ) bi t 590 -- col tmns of keyboard and display matrix, ac t Ive high. Bl t 5 is the leftmost column.

;******************** ••****** ••**********************.******

82

86 87
88 90

89 91 92 93
94

95 96
97

0000
'0002

0600
10FE

100

98 99

-- r,eset-The're are two cases that will geuerate a RESET signal: (1) PG~er-up (H) 'RS' key pressed In both cases, the fol:low actions will be taken: a) disable interrupt, set interrupt mode to 0 set I register to 00 and sc'&art execution at address 0000 (by Z80 CPU Hsel.f). . b) 1nl tial user's PC to the lowest RAMaddress; c) set user's SP to IF9FH; d) set user's I register to 00 and disable ·user's 1nterr~pt flip-flop; In addition, subroutine INI Will be called on power-up reset, wl:!ich has the follow! ng effec·ts: e) disable BREAK .POINT; f) set the contents of location lFE.EH IFEPH fa 66 and and 00 respectively. Thisw111 make Lns t z-uct Lon RST 38H (opcode FF) have the same eftect as BREAK. Memory location POWERUP used to disti nguish power-up is f rom as-key. (POWERUP) contains a random data when power-up and corrta ina PWCODE (OA5H) tl:!ereafter.

101 Initlal ·output.

102 103 104 105

LD DJNZ

B,O

; Power-up delay port


90H~

8255 to mode 0 w1.tll The control word is


LD DU'T A,lOOlOOOOB (P82S5), A

A input,

port

Band

0004 0006

SE90 0:'103

106 107
108 109 110

0008
OOOA

111 112 113


114 U5

Wh.en th.e control word is ports are 01 eared to O. BREAK and deactivate all port C.
LD

sent out to 8255, all output It is necessary 'to disable I/O by e endf ng ocoa to

DaDe

3Eeo D302

OUT
LD

A,ocoa
(DIGIT)

31AF1F

116

SP,SYSSTK

,A

;1 n it Lal systan

stack

____________________________________

__ --

.2

LaC

MPF-l OBJ CODE STMT SOURCE STATEMENT M 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132

If the
PWCODE.

content of location POWERUP is call subroutine INI. Continue

not equal otherwise.


,~ r

to

OOOP 0012 0014

3AE51F FEA5 C4C103

LD

A. (POWERUP)

CP CALL

PWCODE

NZ.INI

Determine ~he lowest RAM address by ch ec kf ng whether address 1000R is RAM. If yes, set user's PC to this value. Otherwise, set it to 1800H.

0017 OOlA OOlD 00lF 0021 0024

210010 2802

LD

HL,1000H
RAMCHK

CDF60S
22DCIF 2600

CALL

2618

133 134
135 136 137 138 139 140

PREPC

JR LD LD LD

Z. PREPC H,18H

H,O

(USERPC) • HL

Address 28H and 30H are reserved for BREAK (RST 28H) and software BREAK (RST 30H). Ski p these area, monitor prog ram res urnes at RESET!.
JR RESET1

0026 0028

180!

141
142 143 144 145

RST28

~.***********.**************************.****.*.************

146 147 148 149


150 151 152 153 154 155 156

ORa 28H Address 28M is the entry point of BREAK trap. If a location is set asa BREAKI point, the monitor will change the content of this location to C7 (RST 28H) before transfering control to user's program. In execution of user's program, a. trap will occur if user's PC passes this l oca t Lon- Themonl tor tb'ell takes ov er control and the content of BREAK address will be restored. Monitor takes care of everything and makes the whol e mechanism transparant to, the user" The return address pushed onto stack is the PC after .• executing RST 28'H. The original break address should be one less than that" Tbe follow! ng 3 instructions decrease the content of (SP) by one Wi ~hout changing
HL.
EX DEC

157 158
0028 0029 002A 0028 002E 0030 E3 2S
E3

22E81F
180E

159 160 161 162 163 164

LD
JR

EX

(SP) , HL (HLTEMP). CONT28

HL

(SP),

HL

HL

165
166 168 169 170

;******** ••******.*.***.** •••****.******* •••• *•••••• *~******


RST30 ORa 30M

167

171
174

172 173 0030 1834

Instruction RST 30H (opcode F7) 1s usually used as: i} So,ftwa re break:; .• 11) Tenninator of ·user's program. TIl'e effect of this ·instruction is to save all us,er's registers and return to monitor.
JR NMI

LOC

MPF-I OBJ CODEM STMTSOURCE STATEMENT 175 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
206 209 176
••••• '" "'. '" "'. >I< "' ........

; This is a part of reset routine. Address ; 0030. are reserved for break point. Reset ; s.kips this area and resunes here. RESE'TI LD
JR

*"' '" . ,...*.* ************************** ... * **

0028 and routine

*"''''**

0032 0035

22D21F 1810

;set user's I r'egister and ;interrupt flip flop to 0 RESET.2 ;monitor resumes at RESET2

(USERIP) ,HL

;**** •• *******.******************

••• ************.***********

The following byte makes tbe sun of the monitor code in ReM zero. ,ROMTEST a self-cbecking is routine. This routine r eq ui r-es the s un of ROM to be zero.

0037 0038

71

DEFB
ORG

ZSUM
38B:

RST38

l*··**····*···········****·********·····**·****··****·*****.
Entry po f rrt of RST 3aH (opcode FF) or mode 1 interrupt. P'etch the address stored in location IFRE and IFEF, then jUJIp to this address. Initially, IFEE and IFEF are set to 0066. 80 RST 38 will have the same effect as ·software break. Py changing the content of 1PEE a.nd IPEF. tbe user can define his or her own service routine. The n ex t three instructions push the contents of lFEE a nd IFEF to stack wi tho ut cha ngI ng any regi sters .• PUSH LD HL HL,(IMIAD) (SP). ilL now the address of user Pop out this address then

0038 0039
D03e

85 2AEE1F E3

207 208
21,1.

EX

210

0030

C9

212 213 214 215 216 217 218 219


220

The top of the stack is define:i service routine. branch to it.

CONT28: This is a part the pr'og ram at LD

, .*** •• ***********.****

RET

•• *****.********************.****
service routine. It

•• ***

of break RST28. (ATEMP).A

cout i nues

003E

32E71F

221 222 223 225 227 228


229 226 224

The monitor has changed the content of us er ' IS program at break address. The next 3 instructions restored the destroyed content. BRAD contains the break address, BRDA contai.ns the origlnal data at break address. LD LD LD HL,(BRAD) A, (BROA) (HL),A

0041 0044 0047

2AEOIF

3AE'21F 77

230 231 232

----------------------------------

LOC

MPF-I OBJ CODEM STMT SOURCE STATEMENT 233 234 Send break enable signal A nonmaskable interrupt LO OUT LO LO NOP RET to will hardware counter. be issued at the

0048 004A 004C 004F 0052 0053

3E80 0302 3AE71F 2AE8lF 00 C9

235
236 237 238 239 240' 241 242 243 244

5th

M1's.

A,10000000B (DIGIT),A A, (AT.EMP) HL, (HLTEM P)

1st 2nd 3rd 4th

!ofl 1111 Ml lII1

245 246
. 47 2 0054 0057 005A 0059 2'19F IF 22DOIF AF 32E61F 250 252 254 255 256 257 258 259 261 262 263

Return to user's program •. Execute the instruction at break address. After finishing one instruction, a nonmaskable interrupt happens and con.trol is t ransf er-red to the moni tor again • RESET2: LD LO XOR LO HL,USERSTK (UBERSP) HL , II (TEST) ,A ;set user's SP

248 249 251 253

TEST is a flag for monitor's own use. blanking (hit 7 of TEST) and automatic (bi t 0) use this flag. Clear it her e, LO IX, MPF_I ;Initial

Illegal leading display

key-in zero pattern.

005E

DD219F07

260
0062 C30000

Address 0066 is Skip this area, JP

the address for norma.akable interrupt. monitor resumes at SETS TO

OJO!
0068

006S__,FF

264

265 266 267 268

NMI

, ;****************************************~******************
ORG66U Entry point of nonmaskable interrupt. mil will wben MONI key is pressed or when user's program breaked. The service routine which starts here user's registers and status. It also check the of user's 8P• LD LO OUT (ATEMP) ,II A,10010000B {P8255),A A,OeOH (DIGIT},A A, (ATE1IP) (HLTEMP),HL HL ;get (ADSAVE), HL (USERPC) ,ffL HL, (HLTEMP) (USERSP),SP BP, USERIY+2 IY ;save A. register occur is saves all va l Ld i ty

SETS',(O

269 270
271 32E11F 3E90 0303 3Eeo 0302 3AE71F 2.2E81F E1 220·EIF Z2DetF 2AE81F E073001F 31001F FOES

. 72 2
0066 0069 006B 0060 006F 0071 0014 0071 0078 007B 007E 00B1 00B5 00B8 273 274

275 276
277 279

278
281 282 283 284

280

LD OUT LD RGSAVE LD LO LD -LD LO LO PUSH

;set 8'255 100 mode O. B,a output. ; Port ~ input; ;disable break and LED's A register ;restore HL ;save register r-et ur n address from stack ;Save r et ur n address into ;ADSAVE. ;Set user's PC to return ;.address. HL register ; restore SP ·;set user's SP to current by ;save other registers ;continousl y pushing them

POP

285 286
287 289

288

290

----------------

MPF-I
LOC OBJ CODE M STMT SOURCE STATEMENT 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 . 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 PUSH PUSH· PUSH PUSH EXX EX PUSH

OOSA D08e 0080 OOBE OOBF 0090 0091 0092 0093 0094 0095 0096 0097

DOES D9

EXX

IX
HL BC

;onto

stack

E5 D5

DE.

C5 09 08 F5 08 E5 D5 C5 F5

EX

PUSH PUSH PUSH PUSH

AF,AF' AF AF,AF' HL DE BC AF

save I register. two instructions The next (IFF2) is copied into flip-flop The interrupt flag (P/V) by 1 nst rue t i on LD A. I. parity ( enabled or disabled) status The interrupt flag. by tesU ng parity can be detennined LD

0098 009A

ED57 32031F

LD

A. I (USERIF +1). A instructions save IFF2 into

four Tile next IFF. user's LD JP LD LD LO The next

009D 009F OOA2 OOA4 OOA7

3EOO E2A400 3EOl 32021F 3-1AF1r

SETIF

A,O PO,SETIF A,l (USERlF) SP,SYSSTK 8 i nst ructions

;PO
,A ;set check to a

---,

P/V

SP to SP. n.ot

system

stack

SF points If the user's ERR-SP. in RAM, display


LD LD DEC CALL JR . DEC CALL JR' HL. (USERSP) lX •.ERR:_SP HL
RAMCHK

user's location

DOAA

OOAD 00B1 0082 0085 0087 OOB8 DaBS

2ADOlF 0021B507 2B CDF605 2019 28 CDF605 2013

NZ,SETSTO HL RAMCHK NZ,SETSTO

are st.ack a nd sys t en stack If the user's SYS-SP. This cllecki ng display overlayed, instructi.ons. following is don.e by the LD
NQP NOP

OOSD ODCl 00C2 00C3 DOCS OOC7

DD21AF07 00 00 1162EO 19 3B07 DD2lB6lF

IX,SYS_SP

LD ADD LO

OOCS

JR

DE, -USERSTK+l HL,DE C.SETS~ IX,OIS •.F

_______________________________________________________________ 6

LOC

MPF-I OBJ CODEM StMT SOURCB STATEMBNT 37 1804


349
BCF

OOCD OOCE

350 351 352 353 354 356 357 358 359 360 361 362 363
364 365 355

SETSTO: STATEis a menory location contains the monitor status. It wiN be described in detail' later. STATE 0 stands for fi.xed display pattern. Tile initial pattern' uPF--l' or message 'BYS-BP' ••• belong to· this category. Tile next two i.nstruct1on set STATE to zero. XOR LD ;set A to 0, also clear (STATE) ,A A,(BRDA) jrestore the data at j break address
A

JR

BRRSTO

;set ;the

carry flag to indicate user's SP is legal.

0000 0001 0004 0007 OODA

AF 32B4lF 3AE21F 2AEOlF 77

Carry

flag

BRRsm

LD LD LD

0008

DCOB04

366 367 368 369 310


371 372 375

HL,(BRAD) (HL),A

If the user's SP is legal (carry set), display user's PC and the content at PC. Otherwise, display fixed message (ERR-SP or SYS-SP or uPF--l) CALL C,MEMDP2

373 374

;••••••••• *•••••************.*** ••***.******.***************


; Scan the di spl ay and keyboa rd. Wb en a key is ; detected, take proper action according to the ; key pressed. MAIN: LD
CAL:'

OODB

OOEI
00E4 00E7

3lAFlF
CDFE05

376 377 378 379 380 381


382

CDCB06 l8F5

383 384
3R5

CALL
JR

3d6 387 388 389 390 391 392 393 394 396 397 398 399 400 402
403 404 395

SP, SYBSTK i Ini tial syst em stack. BCAN ;Scan display and input keys. ;Routine SCANwil1 not return until ;any key is pressed. BEEP ;After a key is detected, there ;w111 be aceonpa m ed witll a beep ; sound. MAIN ;Back to MAIN, get more keys and i execute then .•

KEYEXEC:

;••••*****.*********.*.*************** ••********************
Input key dispatch routi n e , This routine uses .the key cod a returned by subroutine SCAN, wbich is one byte stored in A register. Tile range of key code is from 00 to IFK. (i) key code ~ 00 ~ OFH : These are hexadecimal keys. CP Branch to routine KHEX.

00E9

OOEB

FEI0 3824

401

JR

C,KHEX

10H

405 406

If the key entered is not hexad ec Ima L, it must be a function or subfunction key. This means the previous

------------------------

LOC

MPF-I OBJ CODEM STMTSOURCE STATEMENT 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 ,numeric entry bas t ermt na t ed , BIt 0 of T.ESTflag must be set at the b eg t nnang of a Dew numeric entry. This Is d one by the next two instructions. (If hit 0 of TEST Is set, the data buffer will be automatically c1 eared when a hexadecimal key is ent er ed , ) LD SET (ii) HL,'l'EST O,{HL)

OOED OOFO

21E61F CBCS

key code ~ 10H 9 17H : (+, -. GO, STEP, DATA. SBR, INS, DEL) There is no state co.r-r-espo ndtng to these keys. The response of then depends on the current state and minor-state. (E.g., the response of '+' key depends on the current function. It is illegal when the display is 'uPF--l', but is legal wen the display Is of 'address-data' fOllD.) In this documentation, they are .nam ed 'sub-function key'. They are all branched by tab 1 e KSUBFUN and routin BRANCH. SUB CP LD JP lOB
8.

OOF2 00F4 00F6 00F9

D610 FE08 213707 DAB003

HL,KSUBFUN C,BRANCH

(iii)

key code" ISH 9 lFH (PC, Addr, CBr, Reg, Move, Rela, WRtape, RDtape) These keys are named 'function key'. They are acceptable at any time. When they are hit, the moni tor wi 11 uncondi tionall y enter a .new state. STMINOR contains the minor-state, which is required to dispatch some sub-function keys (e.g. +, - ). LD SUB LD LD IX,DIsPBF 8
HL, STATE

OOFC 0100 0102 0105

DD21B61F 0608 21E41F


77

(HL) ,A

0106 0109 010B OlOE

21E31F 3600 214107 C3B003

LD

LD LD

JP

(HL),O ;set STMINOR to 0 HL,KFUN ;KFUNis the base of branch table ;the offset is store::! in A BRANCH

HL,STMINOR

;set STATE to key-code minus 18H ; The STATE.i s update he.re. It will ;be modified later by local service ; routines if the function-key is PC, ;Addr or CBr. For other function;keys, STATEwill not be modified , ;later.

; ; STATE: O=FIX l .. AD

........•...................•........................
;Display fixed pa.ttern, ;The hex key entered is ;menory address. ;The h~ key entered is ;menory data. interpreted

......
as

e.g. 'uPF--l'. interpreted as

----------------------------------~------------~8

LOC

OBJ CODEiii S'l1IT SOURCE STATEMENT 465 466 467 468 469 470
471

MPF-I

3-RGFIX 4.... V 5-RL 6=WT 7"RT

8=RGAD 9=RGDA

472 473 474 475 476 477 478 479


480 481

,;Display ;exped: ,Expect ;Expect ;Expect ;Expect ;Hex-key ;address ;Hex-key ;da.ta fa

fixed pattern: 'Reg-' and register Due to' be entered. parameters tor 'Move' function. parameters for 'Rela' function. paramet,ers tor "Rtape' tunc. parameters for 'ROtape' tunc. entered '1'1.11 be interpreted as name for registers. entered, w1U be interpreted as r regi sters.

"

482
483

484 485 486


487 488 490 491

489

492
493 494 495 496

497
498 499 500 501 502 503

Sub routi ne name conventions : (i) K.???? -- K stands for key, ?1?? is tbe key name, e. g. KINS correspo nds to key 'INS'. Eacb time a key ??1?, is entered, the routi n e with name K???? will be executed. All of them are branched by table KFUN or KSUBFUN. for bexadecimal, ???? is the (ii) H???? -- H stands current STATE. For exampl e, routi ne RDAwill be executed if the entered key is hexadecimal and STATEis DA now. These routines are branched by table RTAB. (iii) I??1? -- I stands for incrElIlent (+ key), 1??? is the current STATE. E.g. IMVwill be executed .... hen STATE is MV and '+' key is en t er ed , These routines are branched by table ITAB D standS for decrenent (- key), ???? is (iv) O???? the current STATE. These routines are b ra.ncbed ust ng tabl e DTAB. (v) G???? -- G standS for 'GO' key. ???? is the current STATE. These routines are branched using table GTAB.

504
505 507

Hexadecimal, '+'. '-' and 'GO' key may be en.tered after different function keys. The monitor uses branch tables and STATE to determine the current function and branch to the proper entry point. KHEX: ;Executed when hexadecimal Ieeys are pressed. ;Use HTABand STATE for further branch.

506 508 509


0111

4F 214B07 3AE41F C3B003

510

0115 0118

0112

511 512 513


514

LD
BRI LO

C.A
HL,RTAB

;save A register in C ; 1Jb.lch 1s the hex key-code.

515 516 517 518


519 520 521

LD JP

A, (STATE)

BRANCR

KINC:

522

;Branched by KSUBFUN table. ;Executed when' +, key is pressed. ;Use ITAB and STATE for further branch. ; STATE~s will be stored in A register at

-:

BRI.

------------------------------------

__~

MPF-I
LOC OBJ CODEfA S'DtT SOURCE STATEMENT

011B 011E

215707
laFS

523 524 525


526

LD

JR

aRI

HL. ITAB

0120 0123

216307
18PO

0125 0128

216F07
18EB

012A

CDE503

527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
554

KOEe; jBranched by KSUBFUNtable. Executed ;when ,_, key 1s pressed. Use DTAB and ;STATE for further branch. STATE wUl be ;stored in A r~ister at BRl. LD HL, MAB

JR

BRI

,
KGO: ;Branched by KSUBFUNtable. Executed jwhen 'GO' key 1s pressed.. Use GTAB and ;STATE for further branch. STATE will be ;stored in A r~ister at BRl.

LD JR

BRI

HL,GTAB

KSTEP; ;Branched by table KBUBFUN. ;when 'STEP' key is pressed. CALL TES1\!

Executed

012D 01.30

C2BS03 3E80

0132

C3A302

555 556 557 558 559 560 561 562 564 565 566 567 568
569 563

JP
LD

JP

;Check if the left 4 digits jof tbe displa,Y,,·are mallory address. ;If not, di~ble all LED's as ;a 'Mlrniog -to the user. Th1s ;is done by routine IGNORE. NZ. IGNORE ;This data will be output A,10000000B ;to port B to enable ; BREAK. It Is done by ;routine PREOUT. PREOUT

KDATA: ;Branched by table KSUBFUN. Executed ;.hen 'D~TAt key 1s pressed. CALL ;Check. if the I eft 4 digits ;,of the display are mallo.ry address. NZ,TESTRG ;If not, branch to TESTRG ;to check whether the display ;is. register or not. MEMDP2 ; If yes, display tbe data of ;that address and set STATE ;to 2. TESTM 8 C, IG.NORE check if the status (RGAD or RGDA). If not. i8 nore this is 8 or 9

0135 0138 013A 0130 013E 0140

COE503 2004 COOB04

570 571 572 573 574


575 576

JR
CALL

C9

FE08 DASB03

579

577 578 580

TBSTRG

RET CP dP

key and

_________________________________________________________________________ 10

"

MPF-I
LOC OBJ CODE M S1IIT SOURCE STATEMENT

0143

CD7704 C9

583 586

581 582 584 585 587 588

.CALL
RST

R. ron P9

send out a warning message. If yes, display register aDd set status to 9 (RGDA).

0146

589 590 591

KSBR: ;Branched by table KSUBFOH. Executed ;w.hen 'SOr' key (set break. point) is ;pressed. CALL JP LD
CALL

0147 014A 0140


0150 0153

CDE503 C2BB03

592 593 594


595 596 597 598 599 601 602

2ADBIF
COFS05 C2BB03 22EOl.F CDOB04 C9

600

JP LO
CALL RET

0156 0159 015C

603 604 605 606 607 608 609 610


611

;Check if the display is of ; 'address-data fom. NZ, IGNORE; If aot , ignore this key and ;send out a warning message .• HL,(AD8.AVE) ;If yes, get the address ;belng displa.y now. RAMCHK ;Cbeck if tbis address is tin RAM. NZ,IGNORE ;11 not, ignore the 'SBR' key ;and send out a warning messa.ge. (BRAD),HL ;If yes, set this address as ;a break point. MEMDP2 ;Display the data of break ;address and set STATE to ;2 (DA).
TESTM
I

612 0150 0160 0163 0166 0167 016A 0168 016E


0171

KINS: ;Branched by table KSUBFUN. Executed ;when 'Ins' key (insert) is pressed.
CALL

COE503 C2BB03 2AOEIF 00 22AFLF 23 22831F COF60S C2BB03

0174

IlFELD

614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638

613

TESTM

JP LD NOP LD INC LO JP

;Check if the display is of ; 'address-data' 10m now. liZ. IGNORE; If not ,. ignore the 'INS' key . ;and send out a warning message. HL, (ADSAVE) ; If yes, get the address being ;displayed now.

CALL

LD

(STEPBF+4), HL RAMCHK; eb eck if t be add ress to be ;ins:erted is in RAM. NZ,IGNORE ;If not, ignore tbe 'INS' key ;and send out a waraing message. ; If the address to be inserted ;is in IBOO-1DFF,store 10'E into ;STEPBF+2 ;Otberwise, ignore the 'INS' key.· ;Tbis is done by the following ;instructions. DE,IDPEH

HL

(STEPB.F). HL ; Store this address In ;STEPBF and the next address. ;In STBPBF+4 for later use.

______________________________________________________________

~t1

LOC 0177 0178 017A 017C

OBJ CODE M STM~ SOURCB 7C PElE 3807 1'820 DABB03 16.27 ED53BllF 639

MPF-I STAT8M&NT LD CP JR CP JP LD

640

A,R
C,SKIPHI 20M C, IGNORE O,27H (8 TEPBF+2 •DE )
lEH

641
842 643 644

OI7E

0181 0183

648

645 646 647

SKI PH!

LD

649 650 651 652 653 654 655 656 651 658 659 660 661
662 663 664

665 666
667

668
669

670
671

;When one byte is inserted at some ;address, all data below this address twill be shIfted down one position. ;The last location will be shifted out ;and therefore lost. ;The RAM1s div~ded into 3 blocks as ;insert is conc er ned , Tbey are: ; 180O-1DFF.,~EOO-IFFF a ad 200O-27FF ; The 2 nd block cannot be inserted lind ;ls usually used as data bank. System ;data that of course cannot be shifted tare also stored in this bank. Each ;block is independent ot the other when ;shift Is performed, i.e. the data ;shifted out of the first block will Dot ; be propaga. ted to Dext bl ock, ;The shift is accomplished by block ;transfer, 1.e. MOVE. Tbls ls the ,job of subroutine GMV. ;Routine GMVnee:l.s 3 parameters .hich jare s t o r ed in step-buffer (STEPBF): ;STEPBF: starting address (2 bytes); ;STETBF+2: ending ad.dresB (2 bytes); ;STEPBF+4; destination address (2 bytes). OOMV

0187 al8A

CDE402

AF

674 675 677 678

672 673 676 679 680 681


682

XOR

CALL

018B 018P 0192 0195

OIBC

12 2AB31F 22DEIF CDOB04 C9

683 684 6S5 6S6


687

LD LO LD CALL

GMV A ;After the RAMhas been shifted dOIl/D, ;the data of the address to be inserted ;is cleared to zero. This is done by ;the next two instructions. Register ;OE contain inserted address after GMV iis performed. (DE),A HL,(STEPBF+4) ;Store the data in (STEPBF+4) (ADSAVE), L H ;into (ADSAVE). MEMDP2 ;Display the address and data, also ;Bet STATEto 2.

, KDEL:

RET SJrecuted pressed .•

0196 0199

CDSS03 C2BB03

688 689
690 691 692 694 696

; Brancbed by tabl e KSUBPUN. ;when 'D'el r (delete) key is CALL TESTM

693 695

JP

;Cheek if the display is of ; 'add ress-da ta' fa ItD.. NZ,IGNORE;If not, ingore the 'Del' key and ;send out a \Warning message. ; 'Delete' Is quite siml.lar to ; I Insert ", exc~t that the memory ;is shlfted up instead of shUted

________________________________________________________________

12

LOC

MPF-I OBJ CODEM S'llfT SOURCESTATEMENT ;down. See the comments on ; routine KINS for detail. HL, (ADSAVE) ;Get the address being displayed ;00'11. Thts is the' address to ;be deleted.

D19C

2ADEIF

698

697

699

LD

0191" OlAO OlA3

00 22B31F CDP60S C2BB03

700 701 702 703 704 705 707 70S 709


710 711 706

NOP LD

CALL

OlA6

JP

712 71.5 716 717


718 719 720

DIAD . OlAF 01Bl

01A9 DlAC

UOOIE
FEtE FE20 DABB03 1628 23 22AFlF l8C5

713 714

7C

LD LD

3807

CP JR
JP

(STEPBP+4), HL RAMCHK ;Cbeck if the address Is tn RAM. NZ, IGNORE ;If DOt, ignore this kef a nd ;send out a warning m,essa.ge. ;Following instructions prepare the ;parameters for routine GM"V in step;buffer. Refer to routine KINS fol:' ;detail. DE,lEOOH A,R IEH C,SKIPH2

CP

01B3

20H C, IGNORE
D,28H (STEP8F+2), DE HL (STEPBF) ,HL

01B6

LD SKIPH2

01B8 OlBC
01BD

ED53Bll.F

721 722

LD LD JR

723

INC

OICO

724' 725
726 727

DOMV

";*.**••••••••••• *•••••

****•••••••***••***•••••••••••••*•••••
E:s;ecuted when

Dl{;2

OlC5
OlCS

2AOCIF 22DElF CDOB04

728 729 730 731


732

[{PC: , Branched by t'ab I e KFUN. ; 'PC' key is pressed. LD LD CALL

OlCB

C9

735 736 737

733 734

HL, (USERPC) ;Store the user's program (ADSAVE),HL ;couoter into (ADSAVE) MEMDP2 ;Routine MEMDP2 displays the address ;.1n (ADSAVE) and its data. It also ;set the STATE to 2.

738 739 740

KCBR: ; Branched by table KFUN. j 'CBr' (clear break point) CALL LD CALL CLRBR

RET Executed when key is pressed.

DlCC
OICF 0102 0105

CDDE03
22DEIF CDDB04

741 742 743

744 745

C9

746 747 748 749 750

;Call subroutine CBRBRto clear ;brea.k point. When returned, the HL ;register will con ta t n FPFF. (ADSAVE),HL ;Store FFPF into (ADSAVE) MEMDP2 ;Display address and 1ts data. Also ;set STATE to 2.

0106

OD2lCA07

751 752 753


754

KREG: ; Branched by tabl e KFUN. Execut ed when ; 'REg' key is pressed. LD IX,REG_ jRoutine SCAN uses ,IX as a pointer ;for display buffer. Set IX to REG

RET

__________________________________________________________

13

LOC

MPF-I OBJ CODEM S'l'MTSOURCESTATEMENT 755 756 757 758


759 ;wi 11 make SCANdisplays

OlDA

CDC404

CALL

PCONY

OlDD

C9

OlDE OlEl

CD0204 C9

760 761 762 763 764 765 766 767 76B 769
770

RIlT
KADDR: Branched by KFUN table. 'Addr' key is pressed.

,'Reg;Decode user's flag P and F' to ;binary display fomat. This ;fol'!llat will be used later. when ;user requires the monitor to ;display decoded flag by pressing ;keys 'SZXH', 'XPNC' ••••

Executed

when

CALL
RET

MEMDPI ;Display

the

; (ADSAVE) and ;to 1 (AD).

address stored in its da ta , Set STATE

771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
787

Function Move, Relative, Read-tape and Write-tape require from one to th.ree parameters. They are storm in STEPBF (step buffer). STMINOR (minor s ta.t ua) contains the number of parameters bas been entered. For Move and Rela tl v e, the default value of the first parameter is t he add ress stored in (ADS AVE). Tbere is no defaul t val ue for the first parameter (filename) of Read- and Write-tape. Wben the function keys are pressed, S'l'MINOR is a.utomatically reset to o.

011';2

2ADE1F 22AFIF

DIES

DIES
OlEB

CD3A04 C9

KMV: 788 ; BranChed by table KFUN. Executed when ; 'Move' key is pressed. 789 .790 KRL: Branched by ta.hle !ePlIN. Execut~ when 791 'Rela' (relat1.ve) key .1s pressed. 792 LD HL, (ADSAVE) ;Store the contents of ADSAVE 793 ;into STEPBF as default value 794 ;of ii rst pa.rameter. 795 LD (STEPBF) ,HL 796 797 KWT: KFUN. Executed 798 ; Branched by table ; when 'WRtape' key Is pressed. 799 800 801 KaT: Branched by tal:Jle KFUN. Executed when 802 'RDtape' ~ey Is pressed. 803 804 STEPDP ;D.1splay the parameter that CALL 805 ;is being entered now by calling 806 ;Subroutine STEPDP. 807 RET 808 809 ••••**********••*•••••••••** •••••••• **** ••••••• *•••••• ***** 810 Tbe foIl owi ng sub rout! nes wi til name H??? 811 are the service routine for hex ... iecimal c 812

___________________________________________________________________

14

LOC

OBJ

CODE M SniT

SOURCE

MPF-I STATEMENT

813
01EC

C3SS03

01EF 01F2 OU5

2ADElF
COFS05

C2BBD3 CDEE03

01P8

815 816 817 818 819 820 821 822 823 824 825 826 821 828
829

814

; keys are
HFIX

corresponding all brancbed JP

to eacb STATE. ' Tbey by table BTABanel aTAT.El. ;When the display is fixed pattern ;hexadecimal k.li!ya are Ulegal. ;Disable all LBO's as a warning ;message to the user. Tbis is wilat ; routine IGNORE does.

IGNORE

HDA

LD

CALL
JP

CALL

OlFB
01FC

79 ED6P
CDOB04

OlFE
0201 0202 0205 0208

C9 21DE1F CDFA03 79

830 831 832 833 834 835 836 837 838 839
840 841 842 844 845

LO RLD
CALL

HL,(ADSAVE) ;Get the address being displayed ;now from (ADSAVE) RAMCHK ;Check if it is in RAM. NZ. IGNORE; If not, ignore thi s key and ;send out a. warning message. PRECL1 ;If this is tbe first hexadecimal ;key entered atter function or stib;function key,reset the data of tbat ;address to O. (by routine PERCL1) A,C ;Tbe key-code is saved in. C at ; routine KHBX. Restore it to A. ;Rotate the key-code (4 bits) into ;the address obtained above. (in HL) MEMDP2 ;Display th,e address and data, ;then set STATE to 2 (DA). HL,ADSAVE .PRECL2 ; It this is the first hezdacimal ;key atter function key is entered, ;set the contents ot ADS AVE to O. A,.C jThe key-code is saved in C ;by routine KKEX. ;The next three instructions shift ;the address beipg displayed by ;ODe digi t.
HL

HAD:

RET LD
CALL

813

LD

0209 020B 02De 02PE 0211

EDSF

CD0204

23 BD6F

846 847 848


849 851

RLD RLD CALL RET


HRGAD: HRGFIX: INC

850 852 853 854 855 856 857 860 861 862 863 864 865 866 867 868
869 858 859

MEMDP1 ;Display the address !lnd its j da t.a , Also, set STATE to

C9

~.hi/A-.'-

J:~

0212

0213 0217 021A 021B


D21C 021P

79 D021B61F 21E31F 87 77
CD7304

LD LD
LD ADD

A,C

LD

CALL
RET

IX, DISPBF HL,STMINOR AtA ;The key-code is the register ;name. Double it and store it ;into STMINOR. (HL) ,A. ;Display regis.ter and set REGDP8 ;STATE to 8. (RGAD)

C9

HRT

870

HWT

HRL

______________________________________________________________

~15

LOC

MPF-I OBJ CODEM STMT SOURCB STATEMENT

0220

CD5504

0.223

CDFA03

0226 0227 0229 022A 022C


022F

79 ED6F 23 C9

871 872 873 874 875 876 877 878 879


880

HMV:

CALL

CALL

LOCSTBF (Jse S'l1IHlORand STEPBF to calculate the address of current parameter in step buffer. PRECL2 If this is tbe fi rst hex key entered, cl eared the parameter (2 bytes), by A,C Ccontaios the key-code. Rotate the parameter (2 bytes) 1 digit left w!th the key-code.

LD RLD INC

PRECL2.

ED6F CD3A04 CDBB04

881 882 883


884 885

RLD

HL STEPDP ;Display the parameter.

0230 0233 0236 0237 0239 023C

CDEE03 79
ED6F

886 887 888 889


890 892 894 895

HRGOA

CALL RET CALL CALL LO RLD CALL

891 893 896


897 899

LOCRGBF ;Calculate th.e address of ;the register being modified. !'RECLI ; If this is the f1 rst hex ;key entered. Clear the register ;(1 byte) by PRECL1. A,C ;Rotate user's register (1 byte) ;1 d.1g1t left with th-e key-code ;stored in C. REGOP9 ;Display the register ;3TATK to 9 (RGDA). and set

CD7704 C9

898 900 901 902 903 904


;

RET

905 906 907 908·

ng rout! nes wi tb naQIe ; 1?1?? are the service .routioes for ; '+' key correspOhd.1ng to each STATE. ; They a re all b ranched bY tabI e ITAB ;and STATE. IFIX: IRGFIX: JP

; Tbe follow!

023D

C3BB03

0240 0243 0244


0247

2ADE1F

909 910 911 912 913 914


915

IGNORE; '+' key is illeagl for state ;FIX or RGFIX, ignore it. HL, (ADSAVE) ; Increase the address bedng ;displayed. now (i.n ADSAVE) ;by 1. HL (ADSAVB),HL MEMOP2 ;Display the address and data, ;then set the STATE to 2.

; lAD:

IDA:

LO INC UP CALL

23

22DE1F

916 917
918 919 920 921 922 923 924 925 926 928

cnoaos
C9

024A

,
lRT

RET

0248

21E31F

IWT 1RL

927

!MV

LD

HL,STMINOR STMINORcontains parameter count, .1 by one. t

the incre:nent

--------------------------------------------------------------------------

16

MPF-I
LaC OBJ CODE M arar SOURCE STATEM.ENT INC CALL (Ht.)

024E 024F 0252 0254 0255 0258 0251> 025e

34 CD5F04
2004

35 C3BB03 CD3A04 C9 2lE3lF

929 930 931 932 933 934 935 938 937 938 939
940 941

JR
DEC
ISTEP JP CALL RET

LOCBTNA ;Check if the count ;overflowed. NZ, ISTEP ; I f not overil owed, ;at ISTEP. (HL) ;Otherwise, restore ;and ignore tbe '+' STEPDP
IG~ORE

Is conti nue the count key. at

;Display the ;step buffer.

parameter

025F 0260

0262 0263
0265 0267

3EIF BE 3002

34

942 943 944 945 946 947


948 949

IRGAD: IRGDA: LD

HL. Snt INOR ;In

these states, the STMINOR ;contains the register name. ; Increase it by 1. If it ; reaches the last one, reset ;it to the first one (0).

LD
CP

INC

CHL}

A,lFH NC,IRGNA
(HL) ,0 (HL)

3600
CD7704

02SA

C9

956 957
958

953 954 955

950 951 952

IRGNA

JR LD

CALL

REGDP9

;Display the register ;set STATE to 9.

and

, .•**********************************************************
;The following routines ;D???? are the service ; '-' key corresponding ;They are all branched ;and STATE. with name routines for to each state. by table DTAB

RET

959 960 961 962 963


026B C3BB03 964 965

OF IX;

ORGFIX:

JP

IGNORE

966 967 2ADEIF


2B 968 969

;these

; '-'

key is ill states.

egal for Ignore it. tbe address being now (in ADSAVE)

026E

0271 0272
0275 0278

22DEIF CDOB04 C9

970 971 972 973 974


975 976

DAD: DDA:

LD
DEC

HL, (ADSAVE) ;Decrease ;displayed ;by one.


HI..

LD

CALL

(ADSAVE},RL MEMDP2 .Display tbe address and data. ;set STATE to 2 (DA).

977 97B 979


980 981 9S2 983

DRT DWT

RET

DRL

0279

21E31F

DMV

LD

HL,STMINOR

;In these ;conta1.ns ;Decrease

984 985
986

states, STMINOR the parameter count. it by one. If overflow ;OCCUl'S, restore S'IMINORand ;igllQre the '-' key. Otherwise ;continue at DSTEP.

__________________________________________________________________

17

MPF-I

LOC
027C 027D 0280 0282 0283 02B6 0289

OBJ CODEM STMTSOURCE STATEMENT


35 987 988 989 990 991 992 993 995

CD5F04 2004 C3BB03 CD3A04 C9 21E31F


34

DSTEP

DEC CALL JR INC JP

(8L) LOCSTNA liZ J DSTEP (RL) STEPDP

IGNORE

994 996

RET
LD

CALL

;Display

the

parameter.

02BA

DRGAD: DRGDA:

HL, SN I NOR; I n these

997 998 999 1000

states, STY INOR ;coctains th.e register name. ;Decrease it by one.' If it ;goes below zero, set i't to ;the highest value (IF).

02BD 028E 0290

35

0291
0293 0295 0298

3EIF BE
3002 361F

1001 1002
1003 1004

DEC LD CP

(HL)

A.OlFH
(HL)

C07704 C9

1006 1007 1008 1009 1010 1011 1012

1005

JR

DRGNA

LO

NC,DRGNA

CALL

(HL),1FH REGDP9 ;Display the register ;set STATE to 9.

and

,
;

RET

1013
1014

1015
1016 1017 1018 1019 1020 1021 1023 1024 1025 1026

;The follOwing routines witb n1llDe ;G???? are tbe serVice routines for ; 'GO' key corresponding to eaeh ;state. They are all bnDched by ;table GTAB and STATE.
GPIX:

0299

C3BB03

GRGFIX: GRGAD:
GRGDA:

1022

029C 029F

2AE01F
36EF

GAD: GDA.:

JP

IGNORE ;'GO'

;these

key Is illegal for states. Ignore it.

LO LO

HL, (BRAD) ;Get

1027

02A1
02A3

3EFF 32EAIF

1028 1029 1030 1031 1032 1033 1034 1035 1037 1038 1039 1040

LD
PREODT LD LD

02A6

3AD21F

1036

1041 02A9 CB47


1042 1043 1044 BIT

the address of break ;point. (HL),OEFH ; Instructioll RST 2811. ;The cout ent of break ac2dress lis changed to RST 28H before ;the control is transfered to ; user's pr-og ram. Tbi s ;will cause a trap .ben user's ;PC passes this point. A,OFFH ;Save FF into TEMP. This data ;will be output to po rt B 1. te.r. ;PP Is used to disable break point. (TEMP).! ;Store A into TEMP. A, (USERIP) ;Save two instructions into ;TEMP and TEMP+1. Tbese two ;instructlons will be executed ;later. If the user's IPF ;(interrupt flip-flop) is 1, ;the InstructIons are 'BI RET'. ;Otherwise, they are '01 RET'.
O,A

____________________________________________________________

18

MPF-I

LOC
02AB 02AE 0280' 0282 02B5

OBJ CODE M STMT SOURCE


21FBC9 2002 2EF3 22EB1F 31BC1F 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074

STATEMENT LD JR LD
HL, OC9FBH ; •E I ' , , RET' NZ, EIoI L,OF3H ;'01' (TEMP+1), HL SP.,REGBF ;Restore user's registers by ;setting SP to REGBF (register ; buff er) and conti nuo usl y poppi ng ;the stack.

EIDI

LO
LD

0288 02B9 02BA 02BB 02BC 0280 028E ·028F 02CO 02Cl 02C2 02C3 02C4 02C6 02C8 02CC 02CF

F1 C1 Dl E1 08

pop pop

pop

pop

AF 'BC DE AF,AF'

EX

HL

F1
08 D9 Cl

pop

EX

EX!
pop pop pop

AF AF,AF'
BC
DE

0202 0204

Dl E1 09 DOEl FDE1 ED7BD01F 32BD1F 3A031F


E047 E5

EXX
pop pop

HL

LO LD LO LO

SP, (USERSP) ;Restore user's SP. (USERAF+l) ,A ;Tenporarily save A A,(USERIF+l) :Restore user'a I HL

IX IY

PUSH

I,A

1075
0205 0208 02D9

2AOE1F

E3 3AEA1F

1076 1077 1078 1079 1080

LD LD
EX

(SP), HL A, (TEMP)

HL,(ADSAVE)

.i The next 3 i ns t rue tiona iPush the address being ;diaplayed now (in ADSAVE) ;oo.to stack without changing ;HL register. This address ;treated as user's new PC. ;Output

will

be

lOBI

1083
1084 10B5 1086 1087 1088 1089 1090 1091

1082

the data stored in port B of 8255. ;This data is prepared by i routine KSTEP or GAD or ;GDA. In first case, it is ;10111111 and will enable ;break. po t n t , In other ;cases, it is FF and will ;disable break point. ;If break is enabled, non;maskable interrupt will occur ;5 MI's after the OUT instruction.

;TEMP to

020C 02DE 02E1

0302

3ABDIF
C3EB1F

OUT

1092

1093 1094 1095 1096 1097

LD JP

A,(USERAF+1)

(DIGIT) ,A

TEMP+1

;2nd

;Execute ;storErl

HI

;1st MI, ;Restore


I

A register. instructions They are:

1098
1099 1100 1101 1102

"RET

the two in RAM. EI (or DI)

;The starting address of user's ;program has b een pushed onto ; t he top of the stack. RET pops ,out this address and transfers

;3rd Ml ;4th Idl

____________________________________

19

LaC

MPF-.I OBJ CODEM ~TMT SOURCE STATEMENT ; control to it.. The fi rst Ml ;of user's program will be the ;5th M1 after OUT. If break point ;i s enabl ed, Nt! I wi 11 ace ur a r tar ;this instruction is completed._ ;This is the mechani.sm of single ;step.

1103 1104 1105 1106

1107
1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118

02E4 02E7

21AF1F

CD3D05

GMV

, , .***************.*******************************************
LD CALL

02EA 02EC 02FO D2F2 02F4 02F5 o2F6 02F7 02F8 o2FB o2FD o2FE 0300 0301 0303 0304 0306 D3DA

3867 ED5BB31F ED52 300C

1119 1120 1121 1122


1123 1125

JR
LD SSC
JR

1124
1126 1127 1128 1129
1130 1131 1132 1133 1134 1135

EB

09 28 EB 2ABUF EDB8 13 181C 19 EDBO 1B 1816


ED5BAFIF 13

EX ADD

DEC
LD LDDR INC JR MVUP: ADD LDIR DEC

EX

1136 1137
1138 1140 1141 1142 1143 1144 1145

1139

JR

HL,STEPBF GETP ;Load parameters from ;step buffer into registers. ;Also check if the parameters ;are legal. After GETP, ;HL = start address of source ;BC .~ length to MOVE. C,ERROR;Jump to ERROR if the ;parameters are illegal. (I.e.,. Ending ;address < starting add res s , ) DE,(STEPBF+4) ;Load desti.naUon ;address into DE. HL, DE ; Compare HL and DE to ;determine move up or down.. NC,MVUP ;Move down: DE,HL ;HL destination add.ress HL,Be ;HL ~ dest. address + lengtll HL ;HL = end address of d est, DE ElL ·DE = end address of dest. HL; (STEPBF+2) ;HL= end address of source ;block transfer instruction DE ;DE = last address moved ENDFUN ;Continue at EMDFUN. ;Move up: HL,DE ;HL is destroyed by ;SSC HL,DE. Restore HL. ;block transfer DE ;DE '" last address moved ENDFUN ;Co.ntinue at ENDFUN. DE:, STEPBF) ;Load starting ( address ;1 ato DE. DE ;Increase this address by ;Relative address is used ;instruction JR or DJNZ. ;The codes for then are 2 ;The PC is .t nc r-ea.s ed by 2 ;opcode is fetched. DE HL, (STEPBF+2) ;Load destionaUon ;address into HL.
A

ORL

.•*****.********.***********************.*******************
LD INC 2. in bytes. after

1146 1147 1149

1148 1150 1151 1152 1153 1155 1156 1158 1159

030B 030C
D30F

13

2AB11F B7 8D52 7D

1154 1157

INC LD OR

0310 0312

SBe
LD

A,

HLLDE

1160

difference. the offset is between +127 (007FH) and -128 (FFaOH). lfthe offset is posi.tive, both and bit 7 of L must be zero; if

Calculate Check if

H it

__________________________________________________________________________ 20

LOC

MPF-I OBJ CODEM STMT SOURCESTATEMENT 1161 1162 1163 is negative, H and bit 7 of L must be FF and 1. In both cases, adding H wi th bi t 7 of L results in O. Rertate bi t 7 of L into carry flag.

0313 0314 0315 0317 0319 031A 031B

17 7C CEOO 203A 70 1B 12

1164

031C 0320 0323

ED53DEIF COOB04 C9

0324

CD2005

0327 0329 032C 032F 0332

382A 32B51F 21AOOF COOEOS 21AF1F

0335 0338 033B

010700 COA70S 21AOOF

033E 0341

COE205 C03A05 COA705 21AOOF CDE205 ED5BB31F

0344 0347 034A 0340

1165 1166 1167 1168 1169 1170 1171 1172 1173 117.4 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 119S1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218

RLA LD ADC

JR

LO OEC LO

ENDFON:

;ADO a and bit 7 of L. NZ.ERROR ;Branch to ERRORif ;the result is nonzero. A,L DE (DE),A ;Save the offset into ;the next byte of opcode. ; (OJNZ or JR)

A,H A,O

LD CALL RET

(AOSAVE),DE ;Save DE into ADSAVE. MEMDP2 ;Display this address and tits data. Set STATE to 2.

GWT:

;***********************************************************
CALL SUM1;Load parameters from ;step buffer into registers. ;Check if the parameters ;are legal. If Legal, calculate ;the sun of all data to be output ito tape. C,ERROR ;Brancb to ERRORif the ;parameters are illegal. (lenght is ;negative) (STEPBF+6) ,A ;Store the ch ecks un into ;STEPBF+6. HL,4000 ;Output lk Hz square ;wave for 4000 cycles. ;Leading sync. signal. TONE1K HL, STEPBF ; Output 7 byt es sta rti ng ;at STEPBF. (Include: ; fil enam e, sta rt i ng, endi ng ;address and checksum) BC,7 TAPEOUT HL,4000 ;Output 2k Hz square ;wave for 4000 cycles. ;Middle sync. The file name of the ;file being read will be displayed ;io this intervaL TONE2K GETPTR ;Load parameters into ; registers. (Starting, ending and ;length). TAPEOUT ;Output user's data. HL,4000 ;Outp ut 4000 c yc l es of ; 2k Hz squire wave. ; (Tail sync , ) TONE2K OE, (STEPBF+4) ;DE = last address

JR LD
LO

CALL LD

LD CALL

LO

CALL CALL CALL LD CALL ENDTAPELD

____________________________________________________

21

LOC 0351 0353 0357

MPF-I OBJ CODE M STMT SOURCE STATEMENT laC9 D021A907 C3DOOO 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276

ERROR

JR
LO

ENDFUN IX,ERR 8ET8TO-

;Continue

at

ENOFUN. '-Err 0 by SETSTO.

JP ,

j IX poi nts to ;S'et STATE to ; branching to

GRT:

;*.****.****************************** ••••**.*••••••••••• ***


LO LO LO OUT HL, (STEPBP) ; Tempora.rlly save filenll.lll.e. (TEMP), HL A,01000000B po tn t ;deciDlal (SEG7),A j!Vhen s earcb.i ng fo r f11 ename, ;the display Inl tially. is blank ;If the data read from MIC is ;acceptable 0 or 1, the display ...... , ,becomes HL,1000 of PERIOD PERIOD ;The return ;1 s 1n ·:flag: tape input Ne is lk Hz; C -- ot nerwi se. leading sync. C,LBAD ;Loop until ; Ls d et ect eel. HL by one when HL ;Decrease is detected. ;one period

035A 0350 0360 0362

2AAF1F 22EA1F 3£40 D301

LEAD

0364 0367

21E803 CD8C05

LEAD1

LD CALL

--

036A 036C 0360 036E 036F

38F4 2B 7C B5 20F6

JR DEC LD

OR

A,H

JR

0371 0374
0376 0379 037C 037F 0381 0385 0388 03SA 038F 0392 0393 .0395

CD8C05 30FB 21AnF 010700 CD4D05 38DF ED5BAF1F CD6506 0696 CD2406 10FB 2AEAlF B7 ED52 .20C9

LEAD2

JR

CALL

Hand O. L ; Check if both L·are NZ,LEAD1 ;Wait for 1000 periods. ;The leading sync. is accepted 1000 than ;if it is longer ;cycles (1 second). PERIOD sync. Ne,LEAD2 i.WlI.it all leading to ;pass over. HL,STEPBF BC,7 TAPE IN C,LEAD iLoad ;tape from 7 bytes STEPBF. into

LD LD CALL JR LD CALL FILEDP LD CALL OJNZ LD

0380

OR

sac
JR.

; Jump to LEAD if input ; is not successful. ;Get DE, (STEPBF) fil ename from ;step b ur r e r , to display ADDRDP ,Convert it ;formll.t. ;Display B,150 it for 1.5 sec. SCAN1 FILEDP HL, (TEMP) ;Check if tile input to the ;fil ename equals filename. ;specified A HL,DE the 1 ead1 ng NZ, LEAD ,If not, find ;sync. of next file. ; If A,00000010B filename is found. ,segat.lent '-'

0397

3E02

LD

_____________________________________________________________________ 22

MPP-I
LOC 0399 0398 OBS CODEM STMTSOURCE STATEMENT 0301 CD3A05 1277 1278 1279 1282 OUT CALL (SEG7),A ;Display ,------'. GETPTR ;T.he parameters (start1 ng ;~nding address and check; s un) have been load into ;STEPBF. Load then into ; registers, calculate the block ;lengtb and check if they are ; legal. C,ERROR;Jump to ERROR if the ;parameters are illegal. TAPE IN ;Input user's data. C, ERROR; Jump to ERROR if i nput ;is not su::cessful. SUM1 ;Calculate the sum of all ;input data. HL, STEPBF+6 (HL) ;Compare it wi th the ;checksllD calculated by and stored ; 'WRtape'. NZ,ERROR;Jump to ERROR if not ;matched. ENDTAPE;Continue at ENDTAPE.

1280 1281 1283 1284


1285 1286

039E 03AO 03A3 03A5 03Aa

38B3

JR CALL JR CALL LD

CD4005
38AE CD2D05 21B51F BE

1287
1288 1289

03AB
03AC 03AE

1290 1291 1292 1293


1294 1295 1296 1297 1298

CP

20A5
1890

JR

1299 1300 1301

JR

1302 1303 1304 1305 1306 1307 1308 1309 1310

BRANCH: ;Branch table byte 1,2 byte byte byte 3 4 5

;***~**.**********.** ••*•• ******.*.*************.***********


format: address of the 1st routine in each group. difference between the address of 1st and 1st routine, which is of course O. difference between the address of 2nd and 1st routine difference between the address of 3 rd and 1st ro uti ne

1311 1312 1313


1314 1315

1316
1317 1319 1320

;A

HL

Sue

1318
03BO 5E 23 56

(25

add ress of branch tabl e the routine number in its group branch table can save table Leng t h and avoid bytes) boundary problem. LD E,(flL) HL D, (HL) HL A,L L,A L,(HL) R,O RL,DE (HL) ;Load the address of 1st ;routine in the group into ;DE register. ;Locate ;table. the pointer

page

1321
1322

03Bl
03B2

1323
1324 1325

LD

INC INC

03B3
03B4 0386

23
85 6F 6E

Of difference

1326

03B5
03B7 03B9 03BA

2600
19 E9

1327 1328 1329 1330 1331 1334

ADD LD LD LD ADD JP

;Load the address ,difference into L. ,Get rout'!. o'e' s real ;Junp to 1t , address

1332 1333

____________________________________ ~

23

Loe

OBJ CODE M STMT SOURCE 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376
1377

MPF-I STATEMENT

03BB 03BE

21E61F CBFE

IGNORE:

, .***********************************************************
LD SET Ht,TEST
7, (HL)

;Routine SCAN will check bit ;7 of TEST. If it is set, ;all LEDs will be disabled. ;This is a warning message to ;tbe user when a illegal key ;is entered.

03CO

C9

RET

IN! :

;********************.**.***
Power-up initialization. LD IX,BLANK

•••• ****************************
;BLANK is the initial pattern

03C1

DD21A507

:Display the following ;patterns sequence, each 0.16 ;seco'nds: ,

, uPF--' 'uPF--l' LD
INIl
I

uPF' uPF-'

u' uP'

03C5 03C7 03C9 03CC 03CE 03DO 03Dl 03D3 03D5 0308 03DB

OE07 0610 CD2406 lOFB DD2B 00 20F4 3EA5 C3B306 216600 22EE1F

INI2

LD

DJNZ DEC DEC JR LD JP LD


LD

CALL

C,7 B,10H

;pattern ;Display
j

SCAN! INI2

couot 0.16 second.

IX

n ex't pattern

NZ, INIl A, PWCODE IN"r3 HL, NM I

INI4

(IM1AD),HL :Set tbe service routine ;of RST 38H to NMI, wbich is the ;nonmaskable interrupt service ;routine for break poiot and ;si.ngle step.

1378 1379 1380 1381

1382 1383

CLRBR: Clear break point by setting the break point add r es s to FFFF. This is a non-existant address, so break can nev ezhappen. LD LD RET HL,OFFFFR (BRAD),HL

03DE 03E1 03E4

21FFFF 22EOIF C9

1384 1385 1386 1387


1388 1391 1392

1389 1390

TESTM : Check if the display is of "add r-es s+da t a.' ; f o rm, 1.e. STATE1 or 2. ; The r-es ul t is stored in zero flag.

__________________________________________________________________

24

LOC

MPF-I OBJ CODE M STMT SOURCE STATEMENT 1393 Z:

03E5 03B8 03EA 03EB 03ED

3AE4lF FEOI C8 FE02

C9

1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
1405

NZ:

yes no LO CP RET CP RET A, (STATE)


1

Z
2

1406
1407 03EE

PRECLl; Pre-clear 1 byte. If bit 0 of TEST is not 0, load TEST is cleare:l after check. Only AF register are destroyed. LO OR RET LD LD LD RET A,(TEST) A ;Is bit

0 into

(RL).

Bit

0 of

03F1
03F2 03F3 03F5 03F9

03F6

3AE61F B7 C8 3EOO 17 32E61F

1408 1410
1411 1409

0 of

TEST zero?

Z
A,O (BL),A (TEST),A ;Clear ;Clear (HL) TEST too.

1412 1414
1415 1413

C9

1416 1418 1419 1420 1421


03FA 03FD 03FE 03FF COEE03 C8 1422 1423 1417

PRECL2: Pre-clear 2 bytes. If hi t 0 of TEST is nonzero, clear and (RL+1). Only AF register are destroyed. CALL RET INC LD PRECL1 Z HL (HL) ,A

(RL)

0400
0401

23 77
2B

1424 1425
1426

DEC ,
RET Memory display

HL

C9

1427 1428
1429

1430
1431

.**********.************************************************ ,
f o rma t : (address-data) D D -i)

1432
1433 1434

A.A.A.A.

1435
1436

it)

AAAA

D.D.--

1437 1438 1439 1440


1441 1442 0402 3EO! 0604 21B81F 1807

iii)

A.A.A.A.

D.D.--

State is AD. four decimal points under the address field indicate that .t he numeric key entere:l will be interprete:l. as memory address. State is DA. Two dec i ma I points under the data field indicate the moni tor is expecting user to enter memory .data. Six decimal points indicate the address being displayed is set as a break point.

0404
.0406 0409

1443 1444 1445 1446 1447 1448 1449 1450

MEMDP1:

LD LD LD JR

A,I

8,4

;Next STATE =1 ;4 decimal po1.nts active HL,DISPB.F+2 iThe .Urst active decimal ;point is in DISPBF+2, the ;last in DESPBF+5. SAVl2 ;Continue at SAV12.

___________________________________________________________

25

LaC

OBJ CODEM STMTSOURCESTATEMENT 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470. 1471 1472 1473 1474 1475 1476
MEMDP2 :

MPF-I

o.4DB o.4DD D40.F 0412

3EDa

21B61F 32E41F D9 ED5BDE1F

0.60.2

LD Lo. SAV12 Lo. LD

LD

0.415

EXX

0.416

DilA 041D 041E

CD65D6 lA CD7lDa

CALL LD CALL

0.421 0.424

2AE0.1F

7E

0.425 0.428 0.429


D42B D42D D42F

32E2H B7 ED52

1477

BRTEST: Tbe next 3 instructions serve to refresh the data at break address every time memory is displayed. HL,(BRAD) ;Get break point address. LD A,(EIL) ;Get t he data of this LD ;address I nto A register. (BRDA),A ;Store it into BRDA(break LO
OR

;Next STATE = 2 B,2 ;2 active decimal points HL,DISPBF ; 1st decimal poi nt is in ;DISPBF, 2nd in DISPBF+l. (STATE),A ;Update STATE ; Save regi st er HL, BC,DE. DE, (ADSAVE) ;The address to be ;displayed is stored 1n ; (Ao.SAVE). Load it into ;DE register. ADDRDP ;Convert this address to ;displa.y format and store it ;into DISPBF+2 9 DISPBF+5. A, (DE) ;Load the data of tllis ;address into A register. DATADP;Convert t hi s data to ;display format and store it ;into DISPBF 9 OISPBF+1.

A,a

20.0.6 0.60.6
D9 D9 qBF6 23 1DFS

21B61F

0.432 0.433 0.434 0.436 0.437


0439

1478 1479 1480. 1481 1482 1483 1484 1485 1486

data).

SBe

JR

tD LO 8ETPTl SETPT
EXX SET

EXX

;Check if tile address to ;be displayed is break point. NZ, SETPT1 ; If not, j lIDp to SRTFT!. B,6 ;6 active decimal points. HL,DISPBF ;lst decimal point is 1n ;DISPBF, 6th 1n o.ISPBF+5. ,Restore BL,SC,DE. 6., (RL) ,Set decimal points. ,Count in B, first address ;in HL register. SETPT
HL

HL,DE

1487 1488 1489


1490. 1491 1492 1493 1494

INC
OJNZ

C9

RET

1495
1496

, Step display format: (this fOIlDat is used when user is entering parameters for Move, Rela, WRtape, RDta.pe.) P. P. P. P. - N
I pI is tbe dd g Lt indicate P's are the parameter: S i) Move E

!*••••• *.****.**********************************.**

•••***.**

1497
1498 1499

150.0
150.1 1502

of parameter. being modified

Four decimal points now. N is tbe mnemonic of

150.3
1504

150.5
150.8

150.6

1507

11) Rela

--nS --

iii ) WRtape F --

starting address ending address destination address source address destination address file Dame

__________________________________________________________________ 26

LOC

OSJ

MPP-I CODE M S'DIT SOURCE STATBMENT

1509 1510 1511


1512

iv) STEPDP: ;Display ;Input: ; ; register

RDtape

S E P

sta rti ng add rass endi ng address file name name.

1513 1514
1515 1516

043A 0430 043E 043F 0440

CD5504 56 C06506
5E 23

0443 0446 0448 0448 044E 044F 0451 0454

21B81F

1525 1526 1527 1530

1517 1518 1519 1520 1521 1522 1523 1524

step buffer and its parameter STATE· S'DIIONR (parameter count) destroyed: AF.BC,DE,HL CALL LD LOCSTBF ;Get parameter E,(HL) ;Load parameter D,(HL) AOOROP

lNC

LO CALL

HL

address into DE

0604 C03404 CD5F04


6F 2602

1528 1529 1531


1532

LD

;Convert tbis parameter to ;display format (4 digits) ;and store it into OISPBP+2 ; I! D.ISPBP+5. HL,DISP8P+2 ;Set 4 decimal points. ;Prom DISPBF+2 to DISPBF+5.

LD
CALL CALL

LD

22B61F C9

1533 1534 1535 1536 1537 1538 1539 1540 1541


1542

LO LO RET LOCSTBF: ;Get tbe ; address ;register

SETPT LOCSTNA ;Get parameter L,A H,2 ;Pattern. ,_, ;digit.

8,4

name. fol," 2nd rigbtmost

(OISPBF) ,HL

..

location of parameter. = STEPBP + S'lUINOR"'2 destroyed: AF,HL

0455 0458 0459 045C 0450 045E

3AE31F

21AFIF
85
6F C.9

87

1543 1544 1545 1546 1547 1548 1549


1550

LO

ADD LD ADD LD RET

A, (S'l1UNOR) A,A

RL,STBPBF A,L L,A

;Get parameter count. ;Each- parameter has 2 bytes. ;Get base address.

1551
1552 1553

LOCSTNA: ;Get parameter name. ; Input: STATE., STM.INOR ;Output: parameter .oame in ;register LD

A, and

Z flag.

045F

3AE41F

1554 1555 1556 1557


1558

0462

D604
87 87

1559
1560

0464 04.65 0466 0469 046A

llBC07
83
5F

1561 1562 1563 1564


1565

d est royed i AF,DE A, (STATE) ;Get STATE. ;Posslble states are: ;4,5,6,7. (Move. ReI, ;WRtape. RDtape) SUB 4 ;Cbange 4,5,6,7 to ;0,1,2,3. ADD A,A ;Eacb state bas 4 bytes

for

names ,

ADD ADD
LD LD

A,A

1566

DE, STt:PTAB A,E E, A ;Now,

DE contalns

th.e

_____________________________________________________________________

.27

LOC

MPF-I OBJ CODE M S'l'MT SOURCE STATEMENT 1567 1568 1569 1570 1571 15~~(l 1573 1574 1575 1576 457:7:,~, ',157·8 ,.... "1' lu.• '" r r~<,"!"JN
.'.J

T "~Jh"J'I; i-.

i:;
, ~ li)?'

._1'"1

1~ ,''',0

.f

046B 046E 046F 0471

3AE31F 83 5F

LD,Br "; ADD

•.!l.lbl''''

0410

1A B7

LD
1"t "'JF-'O~R~ ,. ,,'
,t
1"

rs , u
cq
J!

<";

dO '<Fl"

:;':cr

,)"', I

15079 0412 C9
u.

1580 ']";5,8.1 ...· i,

RET
1·1.1".;

'.,'., :,1583.1"; Regi.steJ;;'~~IjI~l?lay format: ~'~I' 1584 c: 'H"·IU J "c • •i' , , .15,35, , ,;. 'J h Ji); ~ IX X~~."1 XuY -- Sta.te is REGAD;.,~ :'l1be nume~'f '9.a ta .a "l''ll'1fr;t5,86~ ',!J," j 1 " ~,. eat er-ed is inte;;:pr,eted as 1587 ? ,il regP.ster name. ,tt· , " r ·,"1 1588 'M'.t':1F l'¥ ,i\s the regi ~lf:el:l name ; :t:h~ lS,S.f;l,.l,'; -s- .!H',';',·U'''· ,'.,;1 ~Wr~)l J d?);i\ of tb.at regk"Slter pa,;i;l'j,;,!!_, ~,,~t v 1590 ~,J XXlI;J(. ""',' ~ 'J;I" ' "( . 8n!ll'id~.1·: 1\~11 , "I. 1592 o.r < .' _ -- St;!Lte is REGDA~. /rbe unl;t;,.Pt: 1593 t .. I'1'!gister modi f;Lcart;ion 1.5 byte) 1594 '~ The numer-Lc da t;a. .erit ez-ed will 1595 cbangliHtb,?:,byte .¢,tb decimal 1596 1597 io 1l0(L~int'!"Jundv: it>,,_," Decimal po1nt.s c ' keys. 1598 ~ ~·J.I(,.,~iI h:~:.1 , ~ ,:0', ~T... an;Jle-:ll!.qy~ed;by, j.. +,. of 'I -' 1599 ~~ 1~~'1 I,~·.. •Jh: ~ 1f. ,t~tl"'"l Jr.' r 1600 RIDOP8: '''';:; t f.,J:.;!J It.l t_::; "'Ll!301,.',;);AA~-P).~ll~~tH'rtH~"'r~9gtiset STAllE to 8.

(,'

l,R~2,

;r*~*l'i't"**' ~*,*~'"** '"**'" ** '"'"'"'""'''''"***'" '"*** '""'l"'","'t't+' '" '" '" *'"'"'"'"** '"** '" ~i'!i!

,'L,'lcD::'

;a.ddress of 1st napl',~' . , ;for each state. ( i" I 4,~S'l\!Itj'Ql(\)i ;'Get .pa rame t e r .eount A,E ;DE<--DE +'A,-;!L E,A IJrH,' .:1,', iA,.(I?EhJ~G!.t~jPal':~~"!;~rJ, n~E!·:.l A ;C~"PS~ zepo flag~ Ic·Lf the .' j .,.' ) are1:urned pattern (\1\ A) is J • (".j ~eI'9,' tb,e '+", o:t; must ;have been pressed' ;beyond legal '1<.1') f,. '" ; p!Pr!iUD,eter bounda~Z;Y'l (Cheq~ :1,-£, (J'), ;parameter name go't,i~rom STEPTIYJ. l' ;is 'zoero) ["':l'~ (JiO.,··J. sr;:" t ." <l'lfiHI' • r "f fS;i'1 "l(;i""K',
:,
"J

re,'

• J ~,

..

0413 0415

3E08

,8~'-1"\\u

1802

" l:60~ . '. Jl/; "Hi rb~;'·'. 160~ :101; -'?'S'[ ,1;.0
1604 1605 1607 1608 JR

. , II

(t

''1',,1\ ,~,;

'-RGST.!~:
,!{

i"

;Next

n\'~
,'">i

~'S:tate eLl

'" 8

_<

'Ii J S

~-e;

,J.

1606

REGDP9:

Display

register LD

0477

3E09

1609

; Dis,play Us~~'.s_·reg.:I,;a.tle~\,,(couo.t, ~ hi:;'" 1614 ;co:;n:t!1;1,'n ed QI; n 'IY.JN;q~)'• '.. :.t:fU~",";.·.JJ;'egd.s:tr~:rcd(~stroyed: AF, BC, DE, BL

161.0 1611 ,~JltGS~INl:IJ> ,~!' 1612 ; Update STATE

STATE' to 9. ~:. -:"0,' A, ih'l1.llJl 1~elE,t... ta.t e ,;>".9 s }i[~'VII if!'? ".ljl ..~( l< J~~ I set
J', ...

and

i'I 'J

~d.(-:.l , 1-1

'.1~'.'11·'

1 ,t )I'r',(,[

by

1613

register

A.

t .•

''I

.. ,

..C( .. ~,

,s.

.. ~Il .:
(){! '~

0419 047C
047F

32E41F
3AE31F CB87
;J~R,

0481
0482

47 CDAE04

l_61.6,,}' ~ "~i' ,iiI,i;.·; 1617( '1."l(l; ,~.~I)qi 16:l.8'i "J," !.1.:;D'II:J; 1619 r !RES-J, ,'~i ,d.6,aOt' .JI,rl i'J ,:,; rl:J';:iii 1621 16.22 f!1 1623 LD lm'2A ,onr.Gtn'J}) £JU.L."ll,
I

(STATE),! ;Update STATE. J :r A, (STlHNOR) ;-cG,et register (.Cqll.llt. O,A ;R.eg:isters are dis,pt'!lfed ,,;patl1.J.~F1.nd the courrt • lot PA1t._r 1 ead.er. f(ADUnt "":'~'\" ,u ;the l1Q-wer one) '·f.,L

'.:'cc.r '. r

H1-:lJ'

,.,1

'

by

of

B,A" ;Tem,mlra.rily sa.ve .il.,,; RGNAJ;lJi':;; ;Findnl,-eg1ster eourrt u

',,'

LOC

MPF-I OBJ CODEM S'IMT SOURCESTATEMENT


1.625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 '1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659

0485 0486 0489 048A 0488 048C 0490 0493 0496 0498 0499 049C 049F

78 CDBE04 5E 23 56 ED53DEIF CD6506 3AE41F FE09

LD

CALL LD INC LD CALL LD CP


RET

A,B LOCRG E,(RL)

LD

HL

;Store then into DISPBF ;and DISPBF+l. ;Restore A (register pair leader). ;Get the address of ; user's register. ;Get register data. (2 bytes) ;Convert then to display ;format and store into ;display buffer.

D.(ElL)
(ADSAVE) ,DE

ADDRDP
A, (STATE)

;If STATE equals to 9 (RGDA.), ;.set 2 decimal pod nt s , ;Otherwi se ret urn here.

CO 21B81F 3AE31F
CB47

LD LD BIT

NZ

RL,DISPBF+2 A, (S'DUNOR) ;Get register name. D,A ;If this register is ;group leader, set decimal ipoints of two central digits. ;Otherwi.se set two left digits.
Z,LOC.VI'

04Al 04A5

04A3 04A4 04A7


04A8

2802 23 23 CBF6 23

JR INC INC
LOCVI' SET

HL
ElL 6, (HL) ElL 6,(HL) FCONY

;Set
i CUL)

04AA

CBF6 CDC4D4
C9

INC
SET

decimal points and (HL+l)

of

CALL

OUD

;Convert user's flag (F,P') ;to binary displ.ay format.

RGNADP:

RET

1660

04AE 04Bl 0482 04B3 04B4 0485 04B6 048A

21D007 85 6F 5E 23 56 ED53B61F C9

1661 1662 1663 1664 1665' 1666 1667 1668 1669

Get tbe patterns of register names and store than into DISPBF and DISPBF+l. Input: A contains register count of pai r 1eader. reg! st er d est royed: AF, DE, HL LD ADD LD LD INC LD LD HL,RGTAB A,L L,A E, (ElL)
ElL

;Get. address ;table. ;Get first

of pattern

1670

pattern.

1679
04BB 04BE 3AE31F 21DC1P

1671 1672 1673 1674 1675 1676 1677 1678

D, (OL) ;Get 2nd pattern. (DISPBF) ,DE

LOCRGBF' : Get the address of user's register. ; Reg'ister name contained in SntINOR. ; Destroys HL, !F. LOCRG LO LD A,(S'iKINOR) HL,RffiBF

RET

1680 16·81 1682

__________________________________________________________________

~29

LOC

OBJ 85 SF

CODE

M BTMT 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693

SO!lRCE

MPF-I STATEMENT

04Cl 04C2 04C3

C9

FCONY:

Encode or decode STMINOR contains


being displayed

user'S-',flag register. the name of tbe flag


now, ~~.

register

destroyed:

AF,BC,HL. name.

04C4 04C7 04C8

3AE31F B7

IF

1694 1695 1696


1697

LD

OR RRA

A, {STMINOR} ;Get register A ;Clear carry flag. ;name of I register: 17H, ;name of IFF: I6H.

;Rotate

right

one bit,

both

04C9 04CB

FEOB 2809
4F

1698
1701 1702 1703 1704 1706

1699.

CP

OBH

; b ecOID e OBH.

1700

JR

Z.FLAGX ;Jump to
;I or

04CD

LO

C,A

1705

1707 1708 1709 1710


1711 1712 1713

04CE 04D1 04D2 0404


04D5 0406

E601
77 79

21D21F 7E

1714 1715 1716 1717


1718 1719

if is being ;displayed now. ;Otberwise, mask out bit ;1 to bit 7 of user's IFF. ;IFF is only 1 bit, monitor ; use one byte to store it, ;masking out bit l~7 is to ;ignore the useless bits. ;Tbis is done only wben the ; user is not modl.fyl.ng IFF. ;I! user is modifying IF.F, ;monitor will display whatever ;be enters, even if bit IIl-7 ;are not all zero. ;A register is nat cha.ng ed ;after doing tbis.
FLAGX IFF

LD LO LO LD

9L, USERIF A,(HL) (HL) ,A

AND CP

OOOOOOOIB
OCR ;.! STY INOR contai ns I ;thename of S.ZXH, XPNC, ;SZXH' or XPNC', after irotating rigbt one bit ;i t will be greater than ;01' eq ua I to OCEI. ;Decode user's flag if it ;is not being modified: now, i encode it otherwi se.

FEOC

1720 1721 1722 1723 1724 1725 1726 1727


1728 1729

FLAGK

A,C

0408 0400

04DA 04EO 04E3 04E6


(l4E9

30lF 3ABC1F CD180S


22D41F

1730 1731 1733


1734

17,32

FroNV1

JR
LD

CD1805
22D61F

04EC 04EF 04F2

3AC41F
CD1805 .22D81F

1735 1736 1737


1738

LO
L.D LD LD

CALL CALL

NC,FCONV2 A, (USERA.F) ;Get user's F register. D.EroDE ;Decode upper 4 bi ts.

DECODE ;Decode lower 4 bits. A, (UAFP) ;Get user's


DEroOE (FLAGHP),

(FLAGH)

,m.

(FLAGL.),BL

CD1805

1739 1740

CALL CALL

F'

reg! st,er.

DECODE

m..

------------

~30

LaC 04F5 04F8 04F9 04FC 04FF


0502

OBJ CODE M STMT SOURCE 22DA1F C9 2AD41F CD2305 2AD61F CD2305 32BCIF 2AD81F CD2305 2ADA1F CD2305 32C41F C9 1741 1742 1743 1744
1745

MPF-I

STATEMENT

F CONY2

LD

LD RET

(FI..AGLP)

• HL

0505 0508 050B


050E 0511

0514 0517

0518
051A

0604 29 29 29 07

1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1169
1770 1771

LD LD LD LO

CALL CALL

CALL CALL

HL,(FLAGH) ;Get the binary fOI1ll ;of " upper: bi ts of ;user's F register. ;Encode it. ENCODE ;Encode 4 lower bits. HL, (FI..AGL) ENCODE (USERAF)A ;Save the encoded , ; r esul t i nt,o US ERAF. HL,(FLAGHP) ;Encode F' register. ENCODE

HL,(FLAGLP)
ENCODE (UAFP),A

DECODE: Decode bi t 7114 of A register. Each bit is extented to 4 bits.

LD RET

The output is stora:l in HL, which is 16 bits in length. Also, after execution, bit 7~" of A register are bi t 390 of A before execution. Register AF ,B,HL are destroyed. ORL4

b econes

0000,

1 beccmes

0001.

LD ADD
ADD

B,4

sr., HL
flL,HL

;Loop 4 times. ;Clear rightmost obi ts of HL.

0518 051C
0510

051E

ED6A

1772 1773
1774 1775 1776 1777 1779

ADD
RLCA

HL,HL HL,HL ;The 4th. bit of HL ;i6 detennined by carry ;flag, which is the MSB ;of A register.

ADC

0520
0522

10F8 C9

1778

DJNZ

0523
0525

0604 29 29 29 29 17

0.526
0527

0528 0529

, 1780 1781· ENCODE: Encode HL register. Each 4 bits of HL 1782 a r e encoded to 1 bi t , 0000 become 0, 1783 0001 become 1. The resul t is stored 1784 in bi t 3110Of A register:.. Also, after 1785 execution, bi t 794 of A are bi t 390 1786 before execution. 1787 Registers AF,B,RL are destroyed. 1788 1789 ;Loop 4 times. B,4 LD 1790 ;Shift HL left 4 btt s , HL,HL ADD ERL4 1791 ;Bit 12 of HL will be 1792 ;shifted into carry flag. 1793 flL,HL ADD 1794 HL,HL ADD 1795 HL,HL ADO 1796 ;Rotate carry flag into RLA 1797 ;A register. 1798

RET

DRL4

____________________________________________________________

---31

LOC 052A 052C

MPF-I OBJ CODEM STMT SOURCESTATEMENT


10F9 1799

C9

1800

1801 1802 1803

1804 1805
1B06 1807

SUM1: Calcula te th.e s I.lII of the data ina manory block. The starting and ending address of this block are stored in STEPBF+2 Sl- STEPBF+4. Registers AF,BC, DE,HL are destroyed. CALL RET
GE TPT R C ; G et pa ramet ers from ;step buffer. ;Return if the parameters ;are illegal.

, ;•••••••••••••• ******************* ••************.**.********

DJNZ RET

ERL4

0520 0530

CD3A05 D8

1808
1809 IBI0 1811 1812 1814 1815

1813 1816
1817 1818 0531

0532 0533 0535 0538 0539

AF

1819
1820 18.21

SUM: Calculate the sun of a raeno ry block. HL contains the starting address of this block, BC contains the length. The result is stored 1n A. Registers AF.BC,HL are destroyed. SUM.CALADD CPI JP OR RET
XOR

EOAt EA3205
B7.

86

A,{HL)
A

;Clear ;Add

A.

1822 1823
1824 1825 1826 1827 1828 1829 1830

PE,8UMCAL ;Clear

flags.

C9

1831 1832 1833


1834

1835 1836
1837 1838 1839· 1840 1842 1843

GETPTR: Get parameters from step buffer. Input: (STEPBF+2) and (STEPBF+3) contain starting address. (STEPBF+4) and (STEPBF+5) contain ending address. Output: HL register contains t'he starting address. Be register contains the length. Carry flay o -- BC positive 1 -- BC negative reg.: AF,BC,DE,IlL. Destroyed GETP

053A 0530 053E 053F 0540


0541 0542

21BllF 5E 56 23 4E
23 2.3

1841

LO
1:.D

1844
1845 1846 1847 1849

INC LD INC LD INC LD LD


OR

sr., STEPBF+2 E, (HL) ;Load starting ;into DE.


HL D, (HL) HL

address

c, (RL)
HL

0543 0544 0545


0546 0548

B7

66 69 ED52 40
44 03

1848 1850
1851 1852 1853

H.(HL) L,e
A

;Load end1 ng add ress ;i nto HL. ;Clear carry flag. ;Find differe.nc·e. ; Carry fl ag is changed ;Now BC contains the

SBC LO LD INC

HL,DE

0549 054A

1854 1855 1856

B,H
BC

e,L

here.

___________________________________________________________________ 32

LOC 054B

MPF-I OBJ COOE M S'ndT: SOURCESTATEMENT EB C9


1857 1858· 1859 1860 1861 1862 1863 1864 1865 1866

EX

DE,HL

length. NowHLcontai ns the start! ng add rese.,

054C

1861
1868 1869

TAPE IN: Load a manory block from tape. Input: HL -- starting address of the block BC -- l~ogth of the block Output: Carry flag ,1 -- rea.di.og error . 0 -- D.O error Destroyed reg. -- AF,BC,OE,HL,AF' ,BC',DE',HL.'

RET

0540 054E 054F 0552 0553 0555 0558 0559

AF 08 CD5A05
73 EDA1

1810
1811 1813

XOR EX

1812 1874 1875 1876 1877


1878 1880 1881 1862

TLOQP

LD

CALL CPI JP

AF,AF' GETBYTE ;Read 1 byte from tape. (UL),E ;Store it ioto manory,.
PE, TLOOP ;Loop until ;:1.s zero.

;Clear carry flag. ;At beginning,tbe ;no error.

reading

is

EA4F05 08 C9

length

1879

1883
1884 1885 1886 1888

GETBYTE: ; Read one byte from. tape, ;, Output: E -- data read, Carry of F' ,1 -;. Destroy reg .• -Byte fonnat: start bit bit 0 bit 1

1l.ET

EX

AF,AP'

1887 1889 1890 1891


1892

reading error no error AF,DE,AP' ,BC' ,DE' ,UL'

o --

bit 2 0,8
E D

bit 3

bit 4

bit 5

bit 6

bit 7

stop bit

OSSA

0550 055F 0562 0564 0565

CD6B05
1808

1893
1894 1895 1896 1897 1898 1899

CD6S0S CB1B 15 C9

BLOOP

to

CALL
CALL
DEC CALL RET

GETBIT GETBIT

-RR

;Get start bi t. ;Loop 8 times. ;.Get one data. bi t , :Resul t i 0 ca. rry flag. ; Rota te :1t i oto E. ;Get stopb! t,

0567 056A

2aFS CD6a05

1900 1901 1902


1903 1904 1905 1906

JR

NZ ,BLOOP
GETBIT

GETBIT: Read one bi t f rom tape. Output: Carry of F,.O tbis bit is 0 1 -- th1 s bi tis 1 1907 Carry of F",l -- reading error 1908 a -- no ar ro r 1901:1' Des t royed reg. -- AF,AF' ,BC' • DE' ,HL I' 1910 61 t fo 110ft t: 1911
1912

1913
1914

a
1

2K Hz 8 cycles + lK Hz 2 cycles. 2K Hz 4 cycles'" lK Hz 4 cycles.

~----------------------------~-----------~

LOC

OBJ

CODE II! S'ItdT 1915 1916 1917 1918

SOURCE

MPF~I STATEMENT

0568

09

EXX

; Save. HL"BC"DBregisters

1919 1920 1921 1924 1925


1928 1929 1930 1931 1932 1933

192,2 1923

1926

1927

The tape-bi t fOllD.at of both. 0 and 1 are of the same form: high freq part.., low fr61 part. The difference between 0 and 1 Is the nlllDber high fr61 cycles and low freq cycles. 'Thus, a high freq period may has two meanings: i) It Is used to count the number of high freq cycles of the current tape-bit; 11) If a high freq period is de,tected immed.1a tel y after a low f req period, then this period is the first cycle of next tape-bi t and is used as a terminator of the last tape-bi,t. Bl t 0 of R register is used to Lndf ca t e the usage of a hlgb fr€q period. If this bi t is zero, high freq perlod causes counter t nc r-enerrt for the current tape-bIt. If tbe high freq part bas passed, bit 0 of His set and the next high freq period wIll be used as a tenninator. L register t s used to up/down co uut the number of periods. when a high freq period is read, L is 1.ncreased by 1; when a low fr61 period is read, L is decreased by 2. (The time duration for each count Ls 0.5 ms.) At the end of a tape-b1 t, positive and negat1ve L stand for 0 and 1 .respectively.
LD

1934 1935
1936 1937 1938 1939 1942

]940 1941 1943


1944 1945 1946

056C 056F 0572

210000 CD8C05 14

0573 15 0574 ' 2011

1948 1949 1950 1951 1952 1953 1954 1955 1957

1947

COUN'i'

CALL

INC

;Clear bit 0 of H, lSet L to O. PERIOD ;Reidone period. o ;The next 2 'instructions ;chsck if 0 is zero. Carry ;flag is not affected.
HL,O If 0 is not zero, j unp to error routine TERR. (Because the pertod ts too mmh longer' than that of lK Hz C,SHORTP ; If the period is short ; (2K Hz), j lIIIP to SHORTP. L The period Is '11( Hz, decrease L by 2. And set bi t 0 of H to indicate this tape-!:)! t has passed high freq part and reaches :its 1,ow freq part.
s)

DEC JR

D NZ. TERR

0576 0578

3806
2D

1956 1958
1959 1960 1961 1962 1963 1964 1966 1967 1969 1970 1971 1972

JR

DEC

0579 057A 057C 057E 057F

20 CBC4 18F1 2C CB44

D,EC
SRORTP

1965 1968

JR

SET INC

L O,H L

COUNT

BIT

O,H

0581

28EC

JR

The period is 2 I( Hz, i.ncrease L by 1. If t he tape-hi t has pa.ssed its high freq par-t , b1.gh frq uency means this bi t is allover and next bi t has start'ed.

Z,COUNT

-,-

.__ . _34

lOC
0583

OBJ CODG M STIlT

SOUnCE

MPF I STA'rJ\i.1ENT Rl
;1 1 (#

CB15

1973 1074

of 2K period)

- 2.(# of

lK period)

1975 1976
1977 1976

1980 1982 1963

1979

1981 0585 0586


0587 0588 0589

09 C9 08 08. C9
09 37

1984 1985 1986

EXX TERR
RET SCF

; 0 --- NCarry ; 1 --Carry ;The positivo ;L corresponds ; 'Rl L' will ;l into carry ;instruction. ;contains the ;Restore BC',OE',Hl'
AF,A!'"

(L positive) (1 negative) or nCRotive sign of to the tape-bit data. shift the sign bit of flag. After this the carry flag tape-bit.

EX

058A
058D

1987 1968 1991 1992 1993

1989 1990

EX EXX
RET

;Set carry AF,AF'

flag of F' to indicate

error.

058C 058F

oBOO 17· 38FA

110000 13

0591 0592 0593


0595 0597

1994 1995 1996 1997 1998 1999 2000 2001


2002

PERIOD: Wait the tape to pass one period. The time duration is stored in DE. The unit is loop count. Typical value for 2K Hz is 28. for lK Hz is 56. Use (56+28) /2 as threshold. The ret ur ued result is in carry flag. (IK -- NC, 2K -- C) Register AF and DE are destroyed. LOOPH 10
IN

3EFF 0302
oBOO 13 3E7F

0599
059B

ossc
0590 059F 05A1

17 30FA

05A3 05A4 05A6

0302 78
FE2!

2003 2004 2005 2006 2007 200B 2009 2010 2011 2012 2013 2014 2016 2017 2018 2019 2020
2015

INC RlA LD

DE,O A,(KIN) DE

;Bit 7 of port A is Tapein.

JR

LOOPl

OUT INC RlA. LO

IN

C.lOOPH ;Loop un t I.I input goes low. A,11111111B ;Echo the tape input to ;speaker on MPF-I. (DIGIT) ,A
A. (K IN)

DE NC,lOOPl ;loop unti 1 input goes high. A,Ol111111B ;Echo the tape input to ;speaker on MPF-I., (DIGIT}.A A,E ;Compare the result with ;the threshold. MPERIOD

JR

OUT LD CP RET
I

C9

; •••••••••••••••••••••••••••••••••••••••••••••
TAPEOUT: Output a memory block to tape. Input: H1 -- starting address of the block . BC -- length of the block Destroye~ reg. -- A',BC,DE,Hl,BC',DE',HL' LD CALL E, (Hl) OUTBYTE ;Get the data. ;Output to tape. ;loop until

**** ••••••••••

2021 2022 2023

051\7 05118

SF.:

OSh!} OSAO

CDBI0S

EOAI 8AI\705

2024 2025 2026 2027 2028 2029


2030

cpr
JP

PE.TAP~OUT

finished.

__________________________________________________________________ 35

MPF-I
LOC 0580 OBJ CODE M S'I\lT 2031 2032 2033 2034 2035 2036 2037 2038 SOURCE STATEMENT

C9

,
OUTBYTE:

RET

Output one byte to tape. For tape-byte :format, see comments on GETBYTE. Input: E -- data Destroyed reg. -- AP,DE,BC' ,DE' ,HL' LD
OR 0,8 A E

05Bl 05B3 0584 05B7

05B9
05BC

05BO 05BF 05CO 05C3

1608 B7 CDC405 CBIB CDC405 15 20F8 CDC405 C9


37

2039
2040

2041
2042 2043 2045 2046 2047 2048

CALL

OUTBIT OUTBIT
D NZ,OLOOP

OLOOP

.RR

2044

CALL DEC

;Loop 8 tim es, ;Clear carry flag. ;Output start bi t. ;Rotate data. into carry ;Output the carry ;Set carry fl ag. ;Output stop bit

JR

SCF

2049
2050

,
OUTBIT:

RET

CALL

OOTBIT

2051 05C4 05C5


05C7 D9 2052 2053 2054 2055 2056 2057

Output one bit to tape .• flag. Input: data in carry Dest royed reg. -- AP,BC',DE',HL' LD

2600 3809 2E08 CDE205 2E02


1807

EXX

;Save

nC,DE, HL. output 1.

OUTO:

05C9 05CB
05CE

2058 2059
2060 2061 2062 2063

C,OUT1 ;If data~l. JR 1K 2 cycles. ;2K 8 cycles,


LD

H,O

L,ZERO 2K
TONE2KBITEND-

0500

CALL LO

OUT1:

0502 0504
0507

0500

0509 05DC

2E04 COE205 2E04 CDDE05 09 C9

2064
2065 2066 2067 2068 2069 2072 2073 2074

·
;

JR

L,ZERO 1K
11{ 4 cycles.

LD CALL LD·

;2K 4 cycle.s,

BITEND

CALL
RET

EXX

L,ONE 2K TONE21 L,ONE lK TONEIK

;Restore

registers.

2070 2071

"'
UTILITY SUBROUTINE

.
*••••

2075·
2076 2077

· ·

.••••••••• *•••••••••••••••• "'••••••••• "'•••••••••••••••••


I~unction: Generate square _ve to the MIC .. speaker . on liP F- -1 . Input: C -- period - 2"'(44+13.C) clock states. HL -nunber of periods. Output: none. Dest royed reg.: AF. B( C}, DE, IlL. Ca.11: none.

2078 2079 2080 2081 2082


2083 2084 2085 2086 2087

TONE1K: TONE2K:

05DE

05ED

OE41

1802

JR

LD

C,FIKBZ
TONE

2088

__________________________________________________________

36

LaC

OBJ CODE M srar OE1F 20.90 2091 2092 2093 2094 2095 2096 20.97 2098

SOURCE STATEMENT

MPF-I LD

05.E:2 05E4 05E5 05E8


05£A 05ED 05EF OSF1

2089

C,F2KHZ HL;HL DE,1

TONE:

29 UOllOO
3EFF 030::1 lOFE EE80 ED52 20F5

ADD LD LD
SQWAVE OUT XOR

;Hdfperiod: ;DoubI e for ; Bi t-7

44+13*C states half -cyel e count

A,OFFH

05EC

41

LD DJNZ SBC JR
RET

(DIGIT) ,A B,C $ 80H

hpeout

OSF3 OSFS

C9

2099
2100 2101 2103

NZ,SQWAVE

HL,DE

;Half period delay ;Toggle output :Deeranent one count

2102 2104 2105


2106

;***********************************************************
Function: check if a manory address is in RAM. Input: HL -- address to be check. Output: Zero flag -- 0, ROM or nonexistant; I, RAM. Destroyed reg.: AF. Call: none
LD CPL LD A,(HL)

2i07 2108 2109

OSF6
05F7

2110 7E 2F 77 7.8 2F 77 C9

2111
211.2

RAMCHK:

OSF8
OSF9
OSF! 05FB

05FC 05FD

BE

2113 2114 2115 2U6 2U7 2118 2120 2121 2122 2123
2124 2119

LO

A, (HL)

(RL) ,A

CPL

LD ,

CP RET

(HL) ,A
(RL)

, .*************************.*********************************
Scan the keyboard and display.. Loop un t i.I a key is detected. If the some key is a l ready pressed when this routine starts execution, return when next key 1.8 entered. Input: IX points to th,e butfer contains display patterns. ,6 LEDs require 6 byte data. (IX) contains tfle pa.tt.ern for r1ghtmost LED, (IX+5) contains the pattern for leftmost LED. Output: internal code of the key pressed. Destroyed reg. : AF. B, IlL, AF', BC', DE' .• All other registers except IY are also changed during execution, but they are restored before return. Call: SCANl
PUSH

Function:

2125 2126 2127 2128 2129


2130

05FE 0600 0603

DOES

2131 2132 2133 2134 2135 2136 2138 2139 2140 2141 2142
2143 2144 2137

SCAN:

21E61F CB7E

LD BIT

IX ;Save IX. HL,TEST


7, (HL)

0605 0607

2804 DD21A507

2145
2146

JR LD

Z,SCPR.E IX, BLANK

This bl tis s ezt if the use has entered illegal key. The display will be disabled as a warning to the user. This is done by replacing the display buffer pointer IX by BLANK.

--------------------

~.37

MPF-I

LOC

OaJ CODE M STMT SOURCE STATEMENT


2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 IVait un til all (The execution 40 = 10 * 4.) SCPRE SCNX LD CALL keys are rel eased fo r 40 ms. t Ime of SCANI ts 10 ms, 8,4 SCANI NC,SCPRE SCNX 7, (HL)

060B 0600 0610 0612 0614 0616

0604 CD2406

30F9 10F9 Ca8E

JR
DJNZ RES pop

;If any key is pressed, ;the debounce counter ; Cl ear error-flag. ; Resto re 0 rigi nal IX.

re-load B by 4.

DDE1

IX

; Loop SCLOOP

until CALL

any

key

is

pressed.

0618 0618

CD2406

38FB

2162 2163 2164


2165 2167

JR

SCAN! C,SCLOOP returne:l by SCAN1 to done by table-lookup.

2166
0610 0620 0621 0622 0623 217807

Convert the key-posi tion-code key-internal-code. This is Tile table used is KEYTAB. KEYMAP LO ADD LD LO HL, KEYTAB A,L L,A A, (HL)

2168 2169
2170 2171 2172 2173 2174 2177 2178

85

6.F 7E C9

2175 2176 2179 2180

RET
keyboard and display one cycle. execution time is about 10 ms (exactly ms, 17812 clock states @ 1.79 MHz). Input: SCAN. Output: key during one scan Carry flay -- 1 ii) key pressed during one scan Carry flag -- 0, A -po s t t t o n code of the' key pressed. If more than one key is pressed, A contains the largest po s i.'t.don+c ode(This key is the last key ac a nn ed , ) Destroyed reg: AF, AF', BC', D~'. (see comments on SCAN) Call: no ne, Function: Scan Total 9.95 Same as i) no

;***********************************************************

2181 2182 2183

2184
2185 2187

2186 2188
2189 2190 2191 2193 2194 2195 2197 2198

2192

SCAN1:

2196 2199 2200 2201 2202


2203 2204

; In hardware, the display and keyboard are ;arranged as a 6 by 6 matrix. Each cloumn ;corresponds to one LED and six key buttons. ;In normal operation, at most one column is ;active. The pattern of the active LED is the ;data output on port C of 8255 1. The data input ;from bit 00;5 of port A are the status of key ;buttons in the active column. All sigDals on ; I/O port are active low. SCF

0624 0625 0626

37 08 09

EX EXX

; Set AP,AP'

carry

flag.

________________________________________________________________

38

MPF
lOC OBJ CODE M S'l\IT

SOURCE S:rA'l'EMENT

2205 2206 2207 2208


2209

2210 2211 2212


2.213 2215

2214 2216 2217


2218 2219

0627 0629

OEOO
2606 78 0302

062E

lECl

0620
062(;;

2220 2221 2222 2223 2224 2225 2226


222'7

;Carry flag of F' is used to return the status of ;the keyboard. If any key is pressed during one ;scan, the flag is reset; otherwise, it is set. ;Initially, this flag is set. A' register is used ito store the posi tion-code of the key pr essed , ;In this routine, 36 key positions are checked one ;by one. C register contains the code of the key ;being checked. The value of C is 0 at the beginning, ;and is increased by 1 after each check. So the code ;ranges from 0 to 23H (total 36 positions). On each ;check, if the t npn t bit is 0 (key pressed), C register ;is copied 1nto A' The carry flag of pI is set also. ;When some key is detected, the key positions after ;this key will still be checked. So If mo~e than ;on8 key are pressed during one scan, the code of the ;la5t one will be returned. 1.D LD C,O ;Inltial position code E,llOOOOOl8 ;~can from rightmost digit.

LO KCOL

H,6

0630 0633 0635 0637

D07EOO 0301
06C9

0639 OS3A

AF

10FE

2228 2229 2230 2231


2232 2233

to
1.0

OUT
1.D

OUT O;:rNZ
XOR OUT

OS3e 0630 '063E 0640 0642 0644 0646


0647

0301 7B

2F 0302 0606 DBOO


57 F6CO

2234 2235 2236 2239 2240 2241 2242


2243 2237 2238

tD
CPL

;to the active colunm. A,E (DIGIT) ,A' :Activate one colunm. A,(IX) (SEG7),A B,COLDEl $ ;Oelay 1.5 ms per digit. A ;Oeactivate all display segments (SEG7) ,A A,E 11000000B
(DIGIT) ,A

OR OUT lD IN LD RR

B,6

A, (KIN)

CBIA
3802

2244 2245
2246

D,!
D

KROW

0649

2247
2248

JR

C,NOKEY

2249 2250
2251 2252

0648 064C 0640 061E 0650


0652 0655

79

08
DC

2253 2254
2255 2256 2257 2258 2259

lD

10F7 713

NOKEY

EX

A,e

INC OJNZ
INC

AF,AF' C ){ROW
IX

;Each column has 6 keys. ;Now, bit 005 of A contain ;the status of the 6 keys ;In the active column. ;Store A into D. ;Rotate D 1 bit right, bit 0 • of D will be rotated into ;carry flag. ;Skip next 2 instructions ;If the key is not pressed. ;The next 2 instructions ;store the current position-code ;1nto A' and reset carry flag ;0£ F' register. ;Key-in. get key position. ;Save A & Carry in AF'. ;Increase current key-code by 1. ;loop until 6 keys in the ;active colums are all checked.

OD23

0653 0657

CR07 F6CO

B63F

2260 2261 2262

LD AND
OR

Rle

A,E 00111111B

11000000B

______________________________________________________________

39

MPF-I
LOC OBJ SF CODE M S'DtT SOURCE STATEldENT

0659 06SA 065B


0650

25
2000 0019 09

0660 0662 0663 0664

UFAFF

08 C9

2263 2264 2265 2266 2261 2268 2269 2270


2271 2272

LD LD

E,A
H NZ ,KeOL

OBC JR
ADD EXX

DE,-6
IX,DE ;Get

original

IX.

2273 2274 2275


2276

•, .•••••••••••••••••••••••••••••••••••••••••
Function:

EX RET

AF,AF'

*•• * •• *•••••••••••

2277 2278 2279


2280

Oest royed Call: HEX7SG


AODRDP:

Convert tb.e 2 byte data sto r ed in DE to 7-segament display format. The output is stored in the address field of DISPBF (display buffer), most significiant digit io DISPBF+5. This routine Is usually used by monitor only. reg; AF, HL. .

0665 0668 0669

21881F 7B

OB6e
0660 0670

CD7806 7A CD7806 C9

2281 2282 2283 2284 2285


2286 2287

LD

LD

CALL LD

A,E A,D

HL, DISPBF+2
HEX7SG HEX7SG

CALL

2288 2289 2290 2291 2292


2293 2295 2297

RET

;
Function: Convert the da til. stored i 0 A to 7-segam ent display fonnat. 1 byte is converted to 2 dig1 ts. The result is stored in the data field of display buffer (DISPBF). This .routine is usually used. by mon.itor only. reg: AF. BL.

2294 2296
0671 0677 Dest rayed

Call:

HEX7SG

0674

21B61F C07806 C9

2298
2299

DATADP:

2300 2301
2302 2303 2305 2306

LD CALL

HL,DISPBF
BEX7SG

RET

2304 2307 2308 2309 2310

:*.**••••••••••••••*.**.*.**.*•••••••••**.**••*•••••••*•••••
, Function: Input: Output: Convert bi nary data to 1-segament display fo mil. t. 1 byte in A register. HL po I nts to the res ul t buff er. Pattern for 2 digits. Low order digit in (HLL high order digit in (BL+l). HL becomes HL+2. reg: AF, HL.

2311 2312

Destory Call: HEX7

0678 0679 067C 0670 067E 067F

F5
23 Fl OF
11

2313 2314
2315
2317

BEX7SG:
PUSH

CDB906

2316
'2318 2319 2320

CALL LD INC pop

AF
HEX.?

HL

(HL),A

AF

RRCA

_____________________________________________________________________ 40

MPF-I
LOC 0680 0681 0682 0683 0686 06B7 OBJ CODE M STMT SOURCE STATEMENT

0688

C9

CD8906 77 23

OF OF OF

2321 2322 2325


2326 2327 2323 2324

RRCA RRCA RRCA CALL LO INC

HEX7 m..

(HL),A

2328 2329
2330 2331 2333

RET Function:

;*••••••••••••••••••••••••• **••••••••••• *•••**••••••••• *••••


Convert binary data to 7-segament display fo mill. t. Input: A -- LSB 4 bits contains tbe binary data Output: A -- display pattern for 1 digit. Destroyed reg: AF Call: none POSH
LD HL HL,SEGTAB

2332 2334 2335


0689 068A E5 .21F007

2337
2338 2341 2344

2336

HEX7:

0680
06aF 0690 0691 0693

EOOF
85 6F 7E

2339 2340 2342 2343 2345 2347 2348 2349


2350 2351 2354 2346

0692

E1 C9

AND ADD LO LO

A,L HL

OFa

RB:T

POP

L,A A, (UL)

,
j* •••••••••••••••••••••••••••••••••••••

2352 2353 2355


2356 2358

Function: RAM 1800-IFFF self-check. Input: none Output: non.e Destroyed. reg: AF, BC, HL Call: RAMCHK
RAMTEST: RAMT LD CALL

*••••• *••••••••••••••

0694 0697 069A 0690 069F 06AQ 06A2 06A5

210018 010008 CDF605 2801 76 EDA1 EA9A06 C7

2357
2360 2361 2362 2363

LO

BC,800H RAMCHK

RL,1800H

2359 TNEXT

JR HALT

Z,TNEXT
PE,RAMT

err

; If

error.

2364 2365
2366

2367 2370

2368 2369

RCl\! self~check. Add the da ta of add ress ;0000 I! 0800. If tbe SUII equals to O. Reset the monitor. ;and display • uPF~-l'. If the SUII 1s not 0, wh1cb ; indicates error, HALT.
j

;••••*.*•••••••••••••••••••••• *••••••••••
Monitor

JP RST

;Display'uPF--l'.

** •••••••••••

* •••• *

2371" 2372

2373 2374
2375 2376

;Input: Done. ;Output: none. ;Destroyed registers: ; Call : SUM. LD

AF, BC, HL.

06A6 06A9 06AC

210000 010008 C03105

ROMTEST:

2377 2378

LO CALL

Be,800R SUM

HL,O

____ ------------

41

LaC 06AF 06B1 06B2 06B3

MPF-I OBJ CODE M STMT SOURCESTATEMENT 2801

76 C7 32E51F

2383

2379 2380 2381 2382

SUMOK INI3

JR HALT RST LD

Z,SUMOK ; If error. ;Display 'uPF--1'. (POWERUP);A ;Load power-code into ; (POW.ERUP). The monitor ; uses the location to decide ;whether a reset signal is .o n power-up. A,55H (BEEPSET) ,A

2384 2385
2386 06B6 0688 06BB 06BD 06CO 06C3

3E55 32F01F 3E44


32FllF

06es OSCS
06CS 06CB 06CC 06eF

21F21F 362F 23 3600 C3D803 F5 21FllF 4E 2AF21F 3AFOIF


FE55 2003

0600 0603
0606

2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403
2404 2406 2407

LO LD LO LD LO LD INC LD JP BEEP PUSH LD LO LD LD CP JR CALL NOTONE: pop JP

A,44H

(FBEEP),A

;Beep frequency ;pressed. ;Time duration ikey is of

when key beep

is

HL, TBEEP (HL),2FH HL (HL), 0 INI4

when

pressed,

0608 06DA
06DD 06DE

2405 2408 2409 2410

CDE405 Fl

AF HL,FBEEP C, (!IL) HL, (TBEEP) A, (BEEPSET) 55H NZ,NOTONE ;There is no beep sound when ;the key is pressed if data ;of (BEEPSET) is not 55H TONE

C3E9DD

2411 2412

2413 2414 2415 2416 2417


2418 2420 2422

2419 2421

AF KEYEXEC ;After a key is detected ,detenni De ;what action should the monitor take. ;KEYEXEC uses the next 3 factors ;to get the entry point of proper ;service routine :key-code, STATE ;and STMINOR (Minor-State). Below are the branch t ab l es for eacb key and sta.te. The first entry of each table is a base address, other entrys a.re the offset to this address. Offset is only one byte long, wbich is mu::h shorter t ha n the 2-byte address. This can save the moni tor code space. KINC -KINC+KINC -KINC+KDEC -KINC+E{GO -KINC+KSTEP -K INC +KDA TA -KINC+KSBR -KINC+KINS -KINC+KDEL
KPC

0737 0737 0739


073A 073B

00 05

IBOI
OA

2423 2424 2425


2426

073C 073D
073E 073F

OF lA

2C 7B

2427 2428 2429 2430


2431

0740 0741 0743 0744

42 C201 . 00
1C

2432 2433 2434 2435


2436

KSUBFUNORG DEFW DEFB DEFB DEFB OEFB DEFB OEFB OKFB DEFB

0737H

KFUN

DEFB DEFB

DEFW

-KPC+KPC -KPC+KAODR

_____________________________________________________________________

42

LOC 0745 0746 0747 0748 0749 074A 074B 0740 074£ 074F 0750 0751 0752 0753 0754 0755 0756 0757 0759 075A 075B 075C 0750 075E 075F 0760 0761 0762 0763 0765 0766 0767 0768 0769 076A 076B 076C 0760 076E 076F 0771 0772 0773 0774 0775 0776· 0777 0778 0779 077A

OBJ CODE M STMT SOURCE OA 14 20 20 26 26 EC01 00 16 03 26 34 34 34 34 26 44 3002 00 03 03 00 OE DE DE OE 1F 1F 6B02 00 03 03 00 DE DE OE OE 1F IF 9902 00 03 03 00 4B 60 8B C1 00 00 2437 2438. 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464· 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494

MPF-I STATEMENT DEFB DEFB OEFB OEFB OEFB OEFB OEFW OEFB OEFB OE.FB OEPS OEFB DEFB OEFB OEFB OEFB DEFB D.EFW DEFB OEFB OEFB OEFB OEPB DEFB DEFB OEFB DEFB DEFB DEFW DEFB DEFB DEFB DEFB DEFB DEFB DEFB DEFB OEFB DEFB DEFW OEFB OEFB DEFB OEFB OEFB OEFB OEFB OEFB OEFB DEFB -KPCi-KCBR -KPCi-KREG -KPC+KMY -KPC+KRL. -KPC+KWT -KPC+KRT HFIX -IfF IXi-HFIX -HFIX+HAO -HF rX+HOA -HFIX+HRGFIX -HFIX+HMV -HFIX+HllL -HFIX+HWT -HFIX+HRT -HFIX+HRGAO -HFIX+HRGOA IF IX -IF IX+IF IX -IF IX+IAD -IF IX+IDA -IF IXi-IRGFIX -IFIXHMV -IF IXHRL -IF IXHWT -IF IXHRT -IFIX+IRGAO -IF IX+IRGDA DFIX -OF lX+DF IX -OF IX+DAD -OF IX+DDA -DF IX+DRGFIX -OF IX+OMV -DFIX+ORL -DFIX+DWT -OF IX+DRT -DFIX+DRGAD -DFIX+DRGDA GFIX -GFIX+GFIX -GFIX+GAD -GFIX+<JDA -GFIX+GRGFIX -GFIX+GIdV -GFIX+GRL -GFIX+GWT -GFIX+GRT -GF IX+G.RGAD -GF IX +GRGDA conversion table.

ETAB

ITAB

DTAB

GTAB

Key+po f ti en-cod e to key-i nternal-code s KEYTAB: KO K1 K2 K3 DEFB DEFB DEFB 03R 07H OBH OFH HEX 3 HEX-7 HEX-B HEX-F

0778 077e 077D 077E

03 07 DB OF

DEFB

____________________________________________________________ 3 4

LOC

OSJ

CODE

1/1 STMT

SOURCE K4 K5 K6 K7 K8 K9 KOA KOB KOC KOO KOB

MPF-I STATEMENT DEF.B OEFB DEFS DEFB DEFB DEFB DEFS DEFS DEFB DEFB PEFB OEFB DEFS DEFB DEFB OEFB DEFB DEFS OEFS DEFB OEFS DEFB DEFB DEFB DEFB OEFB DEFB OEFB DEFB DEFB DEFB DEFB
20B:

077F 0780 0781 0782 0783 0784 0785 0786 0787 0788 078.9 078A 078B 078C 07BD 07BE 078F 0790 0791 0792 0793 0794 0795 0796 0797 0798 0799
OT9A

20 21 02 06 OA DE 22 23 01 05 09 00 13 IF 00 04 08 12 IE
lA

OC

IB IB 19 17 10 15
11

079B 079C 0790 079E

14 10 16 1C

079P 07Aa 07Al D7A2 07A3 07M 07A5 07AS 07A7 07AB 07A9 07AA a7AB 07AC 07AD 07AE 07AF 07BO 07B1 07B2 07B3 07B4

1F Ai
00 00 00 00 00 00 03 03 8F 02 IF AE 02 AE B6

30 02 02 OF

2495 2496 2497 249B 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537
2538

KOF
KID K11 K12 K13 K14

2lR 02H 06H OAH OEH 22H 23H OlH 05H 09H ODH 13H

K16 K17 K18 K19 KIA KIB KIC KiD K1E

US

DOH 04H 08H OCH 12H 1EH lAH ISH IBH 19H 17K 10K 11K 14H lOR 16H lCK

IFH

;NOT US.ED ;NOT USED ;HEX_2 ';HEX_a :HEX A ;HEX-E ;.NOT-USED :NOT USED ;HEX 1 ;HEX-S ;HEX-9 :HEXD ;.STEP ;TAPERD ;.HEX 0 ;HE}C4 :HEX-B ;HEX:::::C ;GO :TAPEWR ;CBR ;REG ;ADDR ;DEL :RELA ;S.BR ;;DATA ;+ ;IN8 ;MOVE

;PC

!C20 .K21 K22 K23

KIF

ISH

, MPF

BLANK

AE

2539 2540 2541 2542 2543 2544 2545 2546 2541 2548 2549 2550 2551 .a552

ERR

BYS

SP

DEFB DEFB OEFB DEFB OEFB OEFB OEFB DEFB OEFB DEFB DEFB DEFB DEFB DEFB DEFB DEFB OEFB DEi'B DEFB DEFB DEFB DEFB

030R 002H 002H OFH IFK OA1H 0 0 0 a a

· ·
;

1:;

• I_I'

~ I ..... I

;_ IF' ; "u'

; .p"

3 3 BFB

'R' ·'R' ·'E'


'! .... ,

lFK OAEH 02R OAES OB6H OAEBi

'P'

'·8'

1'_'

'B' 'Y' 's'

________ ~~

44

LOC 07B5 07B6 07B7 07B8 07B9 07BA 07BB 07Be 07BD 07BE 07BF 07CO 07Cl 07C2 D7C3 07C4 07C5 07C6 07C7 07ca 07C9 07CA 07CS 07ce 07CO 07CE 07CF 0700 0702 0704 0706 0708 070A 070C 070E 07EO 07E2 07E4 07E6 07E8 07EA 07EC 07EE 07FO 07.Fl 07F2 07F3 07F4 07F5 07FS 07P7 07F8 07P9 07FA 07F8 07FC 07FD, 07FE

MPr-I OBJ CODE M STMT SOURCE STATEMENT IF AE 02 03 03 8F 00 AE 8F B3 00 AE B3 00 DO OF AE BF 00 OF 00 00 00 02 BE 8F 03 OF3F BOA7 8FB3 8537 4F3F CDA7 crB3 C537 0730 B630 IFAE OF30 370F 850P 7,70F ~~DP 30 9B BA 36 AE AP 38 BF 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2514 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 25,90 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2S02 2603 2604 2605 2606 2601 2608 2609
2610

BE<

3F' A7 80 B3 8F

OEFB OEFB DErB OEFB DEFB DEFB OEFB STEPTAB OErB DEFB DEFB DEFB OErB DEFB OEFB DEFB DEFB OEFS nEFB oEFB DEFB OErB RED DEFB DEFS DEFB DEFB DEFB DEFB DEFW RGTAB .DEFW OEFW DEFW OEFW OEFW DEFW DEFW OEFW OEFW OEFW OEFW OEFW OEFW DEFW OEFW DEFB SEGUB DEFB DEFB DEFB DEFB DEFB DEFB OErB DEFB OEFB OErB OEFB DEFB OEPB OEFB

ERR SP

IFH OABH 02 03 03 8FB 0 OAEH 08F!! OB3R 0

; "~pI

;,'S'·
; '-' i'R-

i'R'

; 'EI

: 's' ; 'E'
: 'D" ; 'S' ;'0'
I'

DAEH
OB3H

0 ; IF OFR : 1St OAEH 08FH ; 'E' 0 OFR ;'F' 0 0 0 · '_I 028 ; la-I OBEH ; 'EI 08FH ; tRI 03R 3FDF!! ;'AF' OA78o~ j 'BC' OB38FIj: ; 'DE' 3785H ' ;'RL" 3F4FH ;'AF.' OA7CDH ;'.BC.' OB3crH ;'DE.' ; 'HL", 37C5H 3007H ·'IX' 30B61{ :'IY' OAE!F!! ; 'SP' 300FH ;' IF' OF37H ;'PH' ;'PL' OP8SH OF77H ;'FH.' OFCSH ;'PL.' OBDH ; '0' ; 'II 30H ; '2'r 098H ; '3 r OBAH ; '4' 36H ; '5' OAES OAFH ;'6' ; '7' 38H ; T8 OBFS DBES ; '9r 3FH ;'A' ; 'B' OA7H 08DH ; 'e' OB3H ;'D' i IE' 08FEI
I

45

LOC 07FF

OBJ OF

CODE M S'IMT SOURCE STATEMENT

M.PF-I

1F9F lF9F 1FAF 1FAF 1FB6

I'FBE IFCO IFe2


IFC4 1FC6

IFBC

2611 2'612 2613 2614 2615 2616 2617 2618 2619 2620 26.21 2622 2623 2624
2625 2628

DEFB

OFR

; IF'

IFe8 IFCA IFCC IFCE


lFDD 1FD2 IFD4 IFD6

2626 2627 2629 2630 2631 2632 2633 2634 2635 2636 2637
2638

IFD8 IFDA
lFDE

!FDC

; SYSTEM RAM AREA: USERSTK ORG lF9FH DEFS 16 lFAFH SYSSTK: ORG DEFS 7 STEPBF DEFS 6 DISPBF REGSF: 2 USERAF DEFS 2 DEFS USERBC 2 USERD.E DEFS 2 DEFS USEaHL 2 DEFS UAFP 2 DEFS UBCP 2 DEFS UDEP 2 DEFS UHLP 2 USERIX DEFS 2 USERIY DEFS 2 USERSP DEFS 2 USERIF DEFS DEFS 2 FLAGH DEFS 2 FLAGL 2 FLAGHP DEFS 2 DEFS FLAGLP DEFS 2 USERPC ADSA'lE BRAD DEFS 2 2 1 1 1 1 1

.**************************** , .

••••••• ************************

IFEO IFE3 IFE4 IFE5


IFE6 iF.E2

2639 2640 2641 2642


2643

BRDA

DEFS

IFE7 IFEA IF.EE IFFO IFFI


IFF2 IFE8

2644 2645 2646 2647 2648 2649


2650 2651

S'Ild.INOR DEFS STATE DEFS POWERUP DEFS

DEFS

TEST

DEFS

2654

2652 2653

ATEMP HLTEMP TEMP

DEFS DEFS DEFS

IMlAD

DEFS

1 2 4
2

2655 2656 BEEPSET DEFS DEFS 2657 FBEEP DEFS 2,658 TBEE'P END 2659

1 1 2

Contains the address being displayed now. Break po I nt add ress Data of break: point address Minor state State Power-up initialization Flag, bi t 0 -- set when function or subfunction key i s hit. bi t 7 -- set when illegal key is entered. Tanporary storage Tanporary storage See comments on routi.ne GOA. Con.tains the address of Opcode 'FF' service routine. (RST 38H, mode 1 interrupt. etc.) Defaul t val ue is 55H Beep f req uency Time duration of beep

________________________________________________________________

46

CROSS REFERENCE SYMBOL VAL M DEFN REFS ADDRDP 0665 ADSAVE IFDE ATEMP BEEP BEEPSE BITEND BLANK BLOOP BRI BRAD BRANCH BRDA BRRSTO BRTEST CLRBR COLDEL CONT28 COUNT DAD DATADP DDA DECODE DFIX IPE7 06CB lFFO 05D9 07A5 055F 0115 IFEO 03BO 1FE2 00D4 0421 03DE 00C9 003E 056F 026E 0671
026E

MPF-I 1523 1636 618 681 699 732 745 793 1458 1633 969 973 1077 .1.176 274 280

0518 026B

DIGIT 0002 DISPBF 1FB6 DMV DOMV DRGAD DRGDA DRGFIX DRGNA DRL DRL4 DRT DSTEP DTAB DWT 0279 0187 028A 028A 026B 0295 U279 051A 0279 0286 0763 0279 BIOI 02B2 ENCODE 0523 ENDFUN 031C ENOTAP 0340 ERL4 0525 ERROR 0353 ERR 07A9 ERR-SP 07B5 F1KHz 0041 F2KHZ OOlF FBEEP IFFl FCONV 04C4 FCONV1 04DA FCONV2 04F9 FILEDP 038A FLAGH 1F04 FLAGHP 1PD8 FLAGL 1FD6

2281 1262 1462 2639 283 596 914 918 2650 221 238 2399 384 2656 2388 2403 2067 2061 2537 1349 2146 1895 1899 514 525 535 2641 229 364 1301 431 455 2642 230 362 362 351 1470 1378 742 27 2231 217 163 1947 1965 1972 968 2467 2298 1467 969 2468 1758 1733 1735 963 2465 2466 2474 2475 16 115 237 2619 348 441 2282 2299 981 2470 672 724 995 2474 996 2475 964 2469 1006 1004 980 2471 1769 1778 978 2473 992 989 2465 53'4 979 2472 1048 1046 1781 1746 1748 1175 1135 1141 1218 1298 1791 1799 1221 1119 1167 2541 1221 2553 32a 29 2086 31 2089 2657 2390 2400 1687 756 1655 1732 1743 1731 1265 1266 2633 .1734 1743 2635 1739 1751 2634'1736 1747

822

839

545 602 1024 1386 1474 515 1477

1738 1740 2466 246.7 2468 2469 2470 2't712472 2473 279 1091 2007 2014 2094 2230 2238 858 1447 1454 1483 1527 1535 1642 1673

1752 1754 1219 1189 1285 1288 1296

____________________________________________________________________ 47

CROSS REFERENCE SYMBOL VAL M DEFti REFS FLAGLP 1FDA FLAGK 04D6 029C GAD 029C GOA GETS·IT 056B GETBYT OSSA 0530 GETP GETP'1'R 053A 0299 GFIX
OMV

MPF-I

GRGAD GRGDA GRGFU: GRL GRT GTAB GWT HAD HOA HEX7 HEX7SG HFIX
HMV

02E4 0299 0299 0299 0306 035A 076F 0324 0202 01EF 0689 0678 01EC

HLTEMP 1FE8 0220 HRGAO 0212 HRGDA 0230 HRGFIX 0212 HRL 0220 HRT 0220 HTAB 074B 0220 HWT 0240 lAD 0240 IDA IFIX 0230 IGNORE 03BB 024B 03C1 INI 03C7 INIl INI2 03C9 06B3 INI3 03DB INI4 IROAD 025C IRGDA 025C IRGFIX 0230 IRGNA 02p1 024B IRL 024B rRT ISTEP 0258 IT'AB 0757 024B IWT 077B KO 0785 KOA KOB 0786
IMV

IMUD

IFEE

2636 1741 1753 1722 1700 1023 2478 1024 2479 1904 1893 1895 1900 1882 1874 1841 1113 1827 1210 1278 1809 1017 2476 2477 2477 2478 2.479 2480 2481 2482 2483 2484 2485 2486 1112 672 2481 1019 2485 1020 2486 1018 2480 1144 2482 12.26 2484 2476 544 1182 2483 839 2445 822 2446 2337 2316 2324 2314 2284 2286 2300 816 2443 2444 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2851 162 239 281 287 871 2448 855 2452 888 2453 856 2447 B70 2449 B68 2451 2443 513 869 2450 913 2456 914 2457 908 2454 2455 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 1336 557 580 594 600 616 630 643 692 70B 719 816 825 910 936 965 991 1020 2653 207 1313 926 2459 1347 123 1363 1368 1364 1365 2382 1371 1312 2397 941 2463 942 2464 909 2458 952 950 925 2460 923 2462 937 932 2454 524 924 24.61 2491 2501 2502

__________________________________________________________

,48

L:ROSS SYMBOL

REFERENCE VAL M DEFN REFS 0787 0788 0789 07BA 017C 078B 078C 078D 078E 078F 0790 0791
0792

MPF-I

KOC KOD KOE KOF Kll


K12

KID

Kl

K13 K14 K15 K16 X17

KlS
K19

0793
0794

KIA KlB KlC


KlD

KlE KIF
K2 K20

K2l
K22

0795 0796 0797 0798 0799 079A 0770 079B


079C

K23 K3
K4
K5

K6

K7

K8 K9
KADDR

0790 079E 077E 077F 0780 0781 0782 0783


0784

KeBR KeOL
JCDATA

01DE alec 062D


0135

KDEC KDEL

0120 0196 KEYEXE 00E9 KEYMAP 061D KEYTAB 077B KFUN 0741 T{GO 0125 KHEX 0111 KIN 0000 KINC OllB KINS 0150 KMV 01E2 !{REG KRL
KROW KRT KPC 01e2

KSBR. KSTEP
KSUBFU

KiT

0106 01E2 0647 01E8 0147 012A 0737 01E8

2503 2504 2505 2506 2492 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2493 252,3 2524 2525 2526 2494 2495 2496 2491 2498 2499 2500 764 2436 738 2437 2227 2265 565 2430 528 2427 686 2433 392 2411 2169 2490 2169 2434 453 538 2428 507 403 18 2001 2008 2240 51S 2425 24262426 2427 2428 2429 2430 2431 2432 2433 610 2432 787 2439 727 2434 2435 2435 2436 2437 2438 2439 2440 2441 2442 750 2438 790 2440 2244 2256 801 2442 587·2431 548 2429 2424 430 797 2441

49

CROSS REFERENCE SYMBOL VAL M DE'PN REFS LEAD LEAD1 LEAD2 LOCPT LOCRG LOCRGB LOCSTB LOCSTN LOOPH LOOPL MAIN MEMDP1
MEMElP2 0367 0371

MPF-I

0360

MPERIO MPF I MVUP NMI NOKEY NOTONE OLOOP ONE 1K ONE-2K OUTO OUTI OOTB1T OUTBYT P8255 PERIOD POWERU PRECL1 PRECL2 PREOUT PREPC PWCODE RAMCHK RAMT RAMTES REGBF REGDP8 REGDP9 REG RESET1 RESET2 RGNADP RGSAVE RGSTIN RGTAB ROOTES R3T28 H3T30 RST38 SAV12
SCAN

SCAN1 SCLOOP SCNX BCPRE SEG7

04A5 04BE 04BB 0455 045F 058P 0599 OODE 04·02 040B 002A 079F 0300 0066 0640 0600 05B7 0004 0004 05C9 05D2 05C4 0581 0003 058C 1FES 03EE OSFA 02A3 0021 00A5 05P6 069A 0694 1FBC 0473 0477 07CA 0032 0054 04AE 0074 0479 0700 06A6 0028 0030 0038 0412 05FE 0624 0618 0600 060B 0001

1229 1236 1250 1651 1682 1676 1538 1550 2001 2008
379

1444 1451 33 2531 1136 266 2255 2409 2042 47 48 2057 2063 2050 2033 15 1991 2645 1402 1416 1036 133 19 2110 2358 2355 2620 1600 1606 2574 181 248 1659 281 1611 2580 2375
1"43

1240 1258 1272 .1246 1.251 1648 1628 888 871 1519 930 988 1531 ,2004 2011 387 768 851 371 574 604 2017 258 1126 174 1372 2247 2405 2066 2064 2056 2041 2028 107 1236 121 827 840 562 131 122 130 2362 2043 2047 276 1250 1947 2382 890 1422 875 1370 331
2045

682

733

746

835

919

974 1177

334

598

628

707

824 2358

1049 1682 864 582 897 753 140 183 1624 1604 1666

952 1006

166

194 1456 2136 2191 2162 2153 2152 17

1450 381 1265 1364 2153 2162 2163 2156 2145 2154 1230 1277 2228 2234

---------------

50

CROSS REFERENCE SYMBOL VAL M DEFN REFS SEGTAB SETIF SETPT SETPT1 SETSTO SHORTP
SKI PHI

MPF-I

SKIPH2 SQWAVE STATE STEPBF

07FO 00A4 0434 0433 0000 057E 0183 01B8 05EA 1FE4 1FAF

STEPDP 043A STEPTA 07BC Snt INO IFE3 SUM SUMl SUMCAL SUMOK SYSSTK SYS SP TAPEIN TAPEOU TBEEP TEMP TERR TEST TESTId ·TESTRG TLOOp TNEXT ·TONE TONE1K TONE2K UAFP UBCP UDEP UHLP USERAF USERBC USEROE USERHL USERIF USERIX UBERIY USERPC USERSP USERST ZERO 1 ZERO-2 0531 0520 0532 06B2 1FAF 07AF 0540 05A7 1FF2 1FEA 0587 IFE6 03E5 013E 054F 06AO 05E4 050E 05E2 IPC4 IFC6 IFC8 IFCA lFBC IFBE IFCD IFC2 IFD2 1FCC IFCE !FDC
!FDO

zsmC

IF9F 0002 0008 0071

2596 2339 320 318 1487 1491 1530 1486 1481 263 332 353 1966 1956 645 641 721 717 2094 2099 2644 361 443 2618 623 627 1132 1144 1545 1840 1513 805 885 2560 1564 2643 451 859 1681 1693 1813 2378 1803 1183 1?90 1821 1823 2381 2379 2617 116 322 2547 341 1862 1257 1287 2021 1203 1213 2658 2392 2402 2652 1036 1048 1985 1952 2646 252 413 1389 552 569 578 571 1874 1877 2361 2359 2090 2087 2408 2085 1197 2067 2088 1209 1217 2625 1737 1755 2626 2627 2628 2621 1068 1092 2622 2623 2624 312 2632 181 2629 2630 289 2637 133 285 2631 250 288 2615 249 345 49 2060 50 2058 20 191

335

347 1222

514 1396 1456 1556 1617 1637 645 680 706 721 723 796 1112 1122 1153 1192 1198 1218 1227 1254 1260 1292 937 926 992 942 981 996 1543 1569 1618 1643

380 2030 1079 1094 1228 1267 1337 1408 1413 2138 592 614 690

2059 2065

1732 1749

320 1037 1069 1717 731 328 1067

______________________________________________________________

51

DOC. No.:MIOO2-8

MONITOR PROGRAM' SO:URCE LISTING

hlPF-1

Copyright© 1981 by Multitech Industrial Corp. No part of this publication may be reproduced, stored in a retrieval system. or transmitted, in any form or by any means. electronic, mechanical, photocopying, recording, or otherwise, , without the prior written permlsslcn of the publisher. Sixth Edition

COPYRIGHT Copyright © 1981 by MULTITECH INDUSTRIAL CORP. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of MUL TITECH INDUSTRIAL CORP.

DISCLA.lMER MUL TITECH INDUSTR IAL CORP. makes no representations or warranties, either express or implied, with respect to the contents hereof and specifically disclaims any warranties or merchantability or fitness for any particular purpose. MU LTITECH INDUSTRIAL CORP. software described in 'this manual is sold or licensed "as is". Should the programs prove defective following their purchase, the buyer (and not MUL TITECH INDUSTRIAL CORP., its distributor, or its dealer) assumes the entire cost of all necessary servicing, repair, and any incidental or consequentiai damages resulting from any defect in the software. Further. MULTITECH INDUSTRIAL CORP. reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of MU LTITECH INDUSTRIAL CORP. to notify any person of such revision or chanqes,

AA. '\:.I

hlultitech
INDUSTRIAL
OFFICE!

CORP,

16F'l. 135 CH~EN tWO 'N. ROAD. sec. 2, TAlp'E' 10479. TAIWAN. R,O.C. TEl: 102)505.5533 TElEX: 19162 MULTIIC FAX: 102)505-4451

FACTORY! 1 )NDUSTRVE. ROAD. III. HSINCHU SCIENCE-BASED INDUSTRIAL HSINCHU. TAIWAN 300. R,O_C,

PARK

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy