uPF1 Monitor Program Listing (Original Scan)
uPF1 Monitor Program Listing (Original Scan)
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
1 2
. 3 4 5 6 7 8
9
;* ;*
10 11 12 13 14 16
15
P8255 DIGIT
SEG7
17
18 20
19
21
22
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
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)
57 58
54 55 56
keyboard, matrix
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.
LD DJNZ
B,O
A input,
port
Band
0004 0006
SE90 0:'103
106 107
108 109 110
0008
OOOA
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.
to
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.
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
~.***********.**************************.****.*.************
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
LD
JR
EX
HL
(SP),
HL
HL
165
166 168 169 170
167
171
174
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
*"''''**
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
, .*** •• ***********.****
RET
•• *****.********************.****
service routine. It
•• ***
cout i nues
003E
32E71F
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
2AEOIF
3AE'21F 77
----------------------------------
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
235
236 237 238 239 240' 241 242 243 244
5th
M1's.
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
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
005E
DD219F07
260
0062 C30000
OJO!
0068
006S__,FF
264
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
;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
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
SETIF
;PO
,A ;set check to a
---,
P/V
SP to SP. n.ot
system
stack
user's location
DOAA
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
IX,SYS_SP
LD ADD LO
OOCS
JR
_______________________________________________________________ 6
LOC
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
BRRsm
LD LD LD
0008
DCOB04
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
OODB
OOEI
00E4 00E7
3lAFlF
CDFE05
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.
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
(HL) ,A
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
----------------------------------~------------~8
LOC
OBJ CODEiii S'l1IT SOURCE STATEMENT 465 466 467 468 469 470
471
MPF-I
8=RGAD 9=RGDA
,;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
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.
510
0115 0118
0112
LD
BRI LO
C.A
HL,RTAB
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
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
JR
CALL
C9
FE08 DASB03
579
TBSTRG
RET CP dP
key and
_________________________________________________________________________ 10
"
MPF-I
LOC OBJ CODE M S1IIT SOURCE STATEMENT
0143
CD7704 C9
583 586
.CALL
RST
R. ron P9
send out a warning message. If yes, display register aDd set status to 9 (RGDA).
0146
KSBR: ;Branched by table KSUBFOH. Executed ;w.hen 'SOr' key (set break. point) is ;pressed. CALL JP LD
CALL
CDE503 C2BB03
2ADBIF
COFS05 C2BB03 22EOl.F CDOB04 C9
600
JP LO
CALL RET
;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
KINS: ;Branched by table KSUBFUN. Executed ;when 'Ins' key (insert) is pressed.
CALL
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
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
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
XOR
CALL
OIBC
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:
0196 0199
CDSS03 C2BB03
688 689
690 691 692 694 696
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
NOP LD
CALL
OlA6
JP
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
OlCB
C9
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.
KCBR: ; Branched by table KFUN. j 'CBr' (clear break point) CALL LD CALL CLRBR
DlCC
OICF 0102 0105
CDDE03
22DEIF CDDB04
744 745
C9
;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
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
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
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
2ADElF
COFS05
C2BBD3 CDEE03
01P8
815 816 817 818 819 820 821 822 823 824 825 826 821 828
829
814
; keys are
HFIX
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
EDSF
CD0204
23 BD6F
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
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
0220
CD5504
0.223
CDFA03
79 ED6F 23 C9
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.
RLD
CDEE03 79
ED6F
HRGOA
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
RET
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
2ADE1F
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
the incre:nent
--------------------------------------------------------------------------
16
MPF-I
LaC OBJ CODE M arar SOURCE STATEM.ENT INC CALL (Ht.)
34 CD5F04
2004
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
parameter
025F 0260
0262 0263
0265 0267
3EIF BE 3002
34
IRGAD: IRGDA: LD
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
IRGNA
JR LD
CALL
REGDP9
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
OF IX;
ORGFIX:
JP
IGNORE
;these
; '-'
egal for Ignore it. tbe address being now (in ADSAVE)
026E
0271 0272
0275 0278
22DEIF CDOB04 C9
DAD: DDA:
LD
DEC
LD
CALL
(ADSAVE},RL MEMDP2 .Display tbe address and data. ;set STATE to 2 (DA).
DRT DWT
RET
DRL
0279
21E31F
DMV
LD
HL,STMINOR
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
DSTEP
IGNORE
994 996
RET
LD
CALL
;Display
the
parameter.
02BA
DRGAD: DRGDA:
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).
35
0291
0293 0295 0298
3EIF BE
3002 361F
1001 1002
1003 1004
DEC LD CP
(HL)
A.OlFH
(HL)
C07704 C9
1005
JR
DRGNA
LO
NC,DRGNA
CALL
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
LO LO
1027
02A1
02A3
3EFF 32EAIF
1028 1029 1030 1031 1032 1033 1034 1035 1037 1038 1039 1040
LD
PREODT LD LD
02A6
3AD21F
1036
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
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
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
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
0302
3ABDIF
C3EB1F
OUT
1092
LD JP
A,(USERAF+1)
(DIGIT) ,A
TEMP+1
;2nd
;Execute ;storErl
HI
1098
1099 1100 1101 1102
"RET
;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
____________________________________
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.
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
JR
LD SSC
JR
1124
1126 1127 1128 1129
1130 1131 1132 1133 1134 1135
EB
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
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.
17 7C CEOO 203A 70 1B 12
1164
ED53DEIF COOB04 C9
0324
CD2005
033E 0341
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
____________________________________________________
21
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
;Continue
at
JP ,
GRT:
LEAD
0364 0367
21E803 CD8C05
LEAD1
LD CALL
--
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
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.
38B3
JR CALL JR CALL LD
CD4005
38AE CD2D05 21B51F BE
1287
1288 1289
03AB
03AC 03AE
CP
20A5
1890
JR
JR
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
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
, 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
CALL
C,7 B,10H
;pattern ;Display
j
SCAN! INI2
IX
n ex't pattern
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.
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
21FFFF 22EOIF C9
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
C9
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
1405
NZ:
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
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
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.--
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
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
3EDa
0.60.2
LD
0.415
EXX
0.416
CD65D6 lA CD7lDa
CALL LD CALL
0.421 0.424
2AE0.1F
7E
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
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
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
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
RDtape
S E P
1513 1514
1515 1516
CD5504 56 C06506
5E 23
21B81F
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
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
8,4
(OISPBF) ,HL
..
3AE31F
21AFIF
85
6F C.9
87
LO
A, (S'l1UNOR) A,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
0462
D604
87 87
1559
1560
llBC07
83
5F
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 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
3AE31F 83 5F
•.!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.
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
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
',,'
LOC
0485 0486 0489 048A 0488 048C 0490 0493 0496 0498 0499 049C 049F
LD
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
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
of
CALL
OUD
RGNADP:
RET
1660
21D007 85 6F 5E 23 56 ED53B61F C9
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
of pattern
1670
pattern.
1679
04BB 04BE 3AE31F 21DC1P
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
__________________________________________________________________
~29
LOC
OBJ 85 SF
CODE
M BTMT 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693
SO!lRCE
MPF-I STATEMENT
C9
FCONY:
register
destroyed:
AF,BC,HL. name.
3AE31F B7
IF
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
E601
77 79
21D21F 7E
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
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
FLAGK
A,C
0408 0400
17,32
FroNV1
JR
LD
CD1805
22D61F
3AC41F
CD1805 .22D81F
LO
L.D LD LD
CALL CALL
(FLAGH)
,m.
(FLAGL.),BL
CD1805
1739 1740
CALL CALL
F'
reg! st,er.
DECODE
m..
------------
~30
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
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
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
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
C9
1800
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
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
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
21BllF 5E 56 23 4E
23 2.3
1841
LO
1:.D
1844
1845 1846 1847 1849
address
c, (RL)
HL
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
B,H
BC
e,L
here.
___________________________________________________________________ 32
LOC 054B
EX
DE,HL
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
AF 08 CD5A05
73 EDA1
1810
1811 1813
XOR EX
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.
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'
o --
bit 2 0,8
E D
bit 3
bit 4
bit 5
bit 6
bit 7
stop bit
OSSA
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
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
~----------------------------~-----------~
LOC
OBJ
SOURCE
MPF~I STATEMENT
0568
09
EXX
; Save. HL"BC"DBregisters
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
210000 CD8C05 14
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
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
SOUnCE
MPF I STA'rJ\i.1ENT Rl
;1 1 (#
CB15
1973 1074
of 2K period)
- 2.(# of
lK period)
1975 1976
1977 1976
1979
09 C9 08 08. C9
09 37
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
1989 1990
EX EXX
RET
error.
058C 058F
110000 13
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
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
JR
LOOPl
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
**** ••••••••••
051\7 05118
SF.:
OSh!} OSAO
CDBI0S
EOAI 8AI\705
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
05B9
05BC
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
Output one bit to tape .• flag. Input: data in carry Dest royed reg. -- AP,BC',DE',HL' LD
EXX
;Save
OUTO:
05C9 05CB
05CE
2058 2059
2060 2061 2062 2063
H,O
L,ZERO 2K
TONE2KBITEND-
0500
CALL LO
OUT1:
0502 0504
0507
0500
0509 05DC
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
;Restore
registers.
2070 2071
"'
UTILITY SUBROUTINE
.
*••••
2075·
2076 2077
· ·
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
2089
TONE:
29 UOllOO
3EFF 030::1 lOFE EE80 ED52 20F5
ADD LD LD
SQWAVE OUT XOR
A,OFFH
05EC
41
LD DJNZ SBC JR
RET
hpeout
OSF3 OSFS
C9
2099
2100 2101 2103
NZ,SQWAVE
HL,DE
;***********************************************************
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)
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:
DOES
2131 2132 2133 2134 2135 2136 2138 2139 2140 2141 2142
2143 2144 2137
SCAN:
21E61F CB7E
LD BIT
0605 0607
2804 DD21A507
2145
2146
JR LD
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
0604 CD2406
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
JR
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
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
;***********************************************************
2184
2185 2187
2186 2188
2189 2190 2191 2193 2194 2195 2197 2198
2192
SCAN1:
; 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
37 08 09
EX EXX
; Set AP,AP'
carry
flag.
________________________________________________________________
38
MPF
lOC OBJ CODE M S'l\IT
SOURCE S:rA'l'EMENT
0627 0629
OEOO
2606 78 0302
062E
lECl
0620
062(;;
;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
D07EOO 0301
06C9
0639 OS3A
AF
10FE
to
1.0
OUT
1.D
OUT O;:rNZ
XOR OUT
0301 7B
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
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
LD AND
OR
Rle
A,E 00111111B
11000000B
______________________________________________________________
39
MPF-I
LOC OBJ SF CODE M S'DtT SOURCE STATEldENT
25
2000 0019 09
UFAFF
08 C9
LD LD
E,A
H NZ ,KeOL
OBC JR
ADD EXX
DE,-6
IX,DE ;Get
original
IX.
•, .•••••••••••••••••••••••••••••••••••••••••
Function:
EX RET
AF,AF'
*•• * •• *•••••••••••
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. .
21881F 7B
OB6e
0660 0670
CD7806 7A CD7806 C9
LD
LD
CALL LD
A,E A,D
HL, DISPBF+2
HEX7SG HEX7SG
CALL
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
:*.**••••••••••••••*.**.*.**.*•••••••••**.**••*•••••••*•••••
, 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
F5
23 Fl OF
11
2313 2314
2315
2317
BEX7SG:
PUSH
CDB906
2316
'2318 2319 2320
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
HEX7 m..
(HL),A
2328 2329
2330 2331 2333
RET Function:
2337
2338 2341 2344
2336
HEX7:
0680
06aF 0690 0691 0693
EOOF
85 6F 7E
0692
E1 C9
AND ADD LO LO
A,L HL
OFa
RB:T
POP
L,A A, (UL)
,
j* •••••••••••••••••••••••••••••••••••••
Function: RAM 1800-IFFF self-check. Input: none Output: non.e Destroyed. reg: AF, BC, HL Call: RAMCHK
RAMTEST: RAMT LD CALL
*••••• *••••••••••••••
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
ROMTEST:
2377 2378
LO CALL
Be,800R SUM
HL,O
____ ------------
41
76 C7 32E51F
2383
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
06es OSCS
06CS 06CB 06CC 06eF
0600 0603
0606
2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403
2404 2406 2407
A,44H
(FBEEP),A
is
when
pressed,
0608 06DA
06DD 06DE
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
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
00 05
IBOI
OA
073C 073D
073E 073F
OF lA
2C 7B
42 C201 . 00
1C
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
03 07 DB OF
DEFB
____________________________________________________________ 3 4
LOC
OSJ
CODE
1/1 STMT
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
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
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
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
· ·
;
1:;
• I_I'
~ I ..... I
;_ IF' ; "u'
; .p"
3 3 BFB
'P'
'·8'
1'_'
________ ~~
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
; "~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
M.PF-I
IFBC
2611 2'612 2613 2614 2615 2616 2617 2618 2619 2620 26.21 2622 2623 2624
2625 2628
DEFB
OFR
; IF'
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
.**************************** , .
••••••• ************************
BRDA
DEFS
DEFS
TEST
DEFS
2654
2652 2653
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
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
____________________________________________________________________ 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
KID
Kl
KlS
K19
0793
0794
KlE KIF
K2 K20
K2l
K22
K23 K3
K4
K5
K6
K7
K8 K9
KADDR
KeBR KeOL
JCDATA
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
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
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
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
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
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
______________________________________________________________
51
DOC. No.:MIOO2-8
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