PAGE 01 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 002 ORG :EE09 003 * 004 * 005 * 006 ********************************** 007 * LIST EXPRESSION AFTER 'IF' (1) * 008 ********************************** 009 * 010 * Lists ' THEN '. 011 * 012 EE09 CDFCEF SCN21 CALL :EFFC List ; print space 013 EE0C CD78CE CALL :CE78 Print 'THEN' 014 EE0F 15EE MPT17 DBL :EE15 015 EE11 03 INX B 016 EE12 C3CCEC JMP :ECCC List statement 017 * 018 * DATA : 019 * 020 EE15 04 L0E350 DATA :04 021 EE16 54 DATA :54 T 022 EE17 48 DATA :48 H 023 EE18 45 DATA :45 E 024 EE19 4E DATA :4E N 025 * 026 ********************************** 027 * LIST EXPRESSION AFTER 'IF' (2) * 028 ********************************** 029 * 030 * Lists ' GOTO '. 031 * 032 EE1A CDFCEF SCN22 CALL :EFFC List ; print space 033 EE1D CD78CE CALL :CE78 Print 'GOTO' 034 EE20 F9CB DBL :CBF9 035 EE22 C3AEEF JMP :EFAE List linenr 036 * 037 ********************************** 038 * LIST EXPRESSION AFTER 'IF' (3) * 039 ********************************** 040 * 041 * Lists ' THEN '. 042 * 043 EE25 CDFCEF SC22A CALL :EFFC List ; print space 044 EE28 CD78CE CALL :CE78 Print 'THEN' 045 EE2B 15EE DBL :EE15 046 EE2D C3AEEF JMP :EFAE List linenr 047 * 048 ******************************* 049 * LIST EXPRESSION AFTER 'FOR' * 050 ******************************* 051 * 052 * Lists ' TO (STEP )'. 053 * 054 EE30 CDFFED SCN23 CALL :EDFF List expr of LET statement 055 EE33 CD6BCE CALL :CE6B Print space 056 EE36 CD78CE CALL :CE78 Print 'TO' 057 EE39 4CEE DBL :EE4C 058 EE3B CDA2EE CALL :EEA2 List 059 EE3E 0A LDAX B Get next byte 060 EE3F 03 INX B 061 EE40 FEFF CPI :FF Terminator? 062 EE42 C8 RZ Then abort 063 EE43 0B DCX B Else: PAGE 02 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 064 EE44 CD75CE CALL :CE75 Print 'STEP' 065 EE47 3DCD DBL :CD3D 066 EE49 C3A2EE JMP :EEA2 List 067 * 068 * DATA: 069 * 070 EE4C 02 RLA20 DATA :02 071 EE4D 54 DATA :54 T 072 EE4E 4F DATA :4F O 073 * 074 ******************************** 075 * LIST EXPRESSION AFTER 'NEXT' * 076 ******************************** 077 * 078 EE4F C3FCEE SCN24 JMP :EEFC List var.ref. 079 * 080 ********************************** 081 * LIST EXPRESSIONS AFTER 'PRINT' * 082 ********************************** 083 * 084 EE52 0A SCN25 LDAX B Get nr of expr 085 EE53 03 INX B 086 EE54 57 MOV D,A into D 087 EE55 15 S2510 DCR D 088 EE56 F8 RM Abort if ready 089 EE57 03 INX B 090 EE58 CDA2EE CALL :EEA2 List 091 EE5B 0A LDAX B Get next byte 092 EE5C 03 INX B 093 EE5D FEFF CPI :FF Terminator? 094 EE5F C8 RZ Then abort 095 EE60 CD60DD CALL :DD60 Else: print this byte 096 EE63 C355EE JMP :EE55 List next expr 097 * 098 ********************************** 099 * LIST EXPRESSION AFTER 'ON' (1) * 100 ********************************** 101 * 102 * Lists ' GOTO '. 103 * 104 EE66 CDFCEF SCN26 CALL :EFFC List ; print space 105 EE69 CD78CE CALL :CE78 Print 'GOTO' 106 EE6C F9CB DBL :CBF9 107 EE6E C379EE JMP :EE79 List linenrs 108 * 109 ********************************** 110 * LIST EXPRESSION AFTER 'ON' (2) * 111 ********************************** 112 * 113 * Lists ' GOSUB '. 114 * 115 EE71 CDFCEF SCN27 CALL :EFFC List ; print space 116 EE74 CD78CE CALL :CE78 Print 'GOSUB' 117 EE77 01CC DBL :CC01 118 EE79 0A S2710 LDAX B Get nr of linenrs 119 EE7A 03 INX B 120 EE7B 57 MOV D,A into D 121 EE7C CDAEEF S2720 CALL :EFAE List linenr 122 EE7F 15 DCR D 123 EE80 C8 RZ Abort if ready 124 EE81 CD70CE CALL :CE70 Print ',' 125 EE84 C37CEE JMP :EE7C List next linenr PAGE 03 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 126 * 127 ********************************* 128 * LIST EXPRESSION AFTER 'CALLM' * 129 ********************************* 130 * 131 EE87 CDA2EE SCN28 CALL :EEA2 List 132 EE8A C36EED JMP :ED6E Print ','; List next expr 133 * 134 ********************* 135 * SET I/O DIRECTION * 136 ********************* 137 * 138 * Part of RESET (C719). Only used for A = 0. 139 * Depending on A, the input switch #0296 and 140 * the output switch #0131 are set. 141 * Default DINC is RS232. 142 * 143 * INSW: OTSW: 144 * A=0: keyboard screen/RS232 145 * A=1: DINC screen 146 * A=2: DINC editbuffer 147 * A=3: DINC DOUTC 148 * 149 EE8D 329602 MPT02 STA :0296 Select keyb or DINC 150 EE90 323101 STA :0131 Select screen/RS232/edit/ 151 DOUTC 152 EE93 C9 RET 153 * 154 *************** 155 * SET VOLUMES * 156 *************** 157 * 158 * Part of RUN TALK (CD64). 159 * 160 * Entry: A: Parameter code. 161 * HL: Pointer to volume byte. 162 * 163 EE94 E5 RTK40 PUSH H Save pntr to volume 164 EE95 6E MOV L,M Volume in L 165 EE96 260F MVI H,:0F 166 EE98 1F RAR Check parameter code 167 EE99 D27CE6 JNC :E67C Jump if channel 0/2 168 * 169 * If channel 1/N: 170 * 171 EE9C 29 DAD H 172 EE9D 29 DAD H 173 EE9E 29 DAD H 174 EE9F C37BE6 JMP :E67B Continu 175 * 176 ********************** 177 * LIST AN EXPRESSION * 178 ********************** 179 * 180 * Entry: BC: Points to expression in program. 181 * (BC): 1.... Expr starts with operator. 182 * 01... Variable reference. 183 * 001.. Function call. 184 * Else Constant. 185 * Exit: BC points after expression. 186 * DE preserved, AFHL corrupted. 187 * PAGE 04 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 188 EEA2 D5 SCEXP PUSH D 189 EEA3 0A LDAX B Get opcode 190 EEA4 B7 ORA A 191 EEA5 F2DFEE JP :EEDF If no starting operator 192 193 * If starting with operator: 194 195 EEA8 03 INX B 196 EEA9 E61F ANI :1F Only 5 bits of opcode 197 EEAB FE1A CPI :1A '(' ? 198 EEAD F5 PUSH PSW Save opcode 199 EEAE DCA2EE CC :EEA2 List expr if binary 200 operation 201 EEB1 2186CF LXI H,:CF86 Addr table opcode strings 202 EEB4 54 L0E300 MOV D,H ) in DE 203 EEB5 5D MOV E,L ) 204 EEB6 CD39DE CALL :DE39 HL points after table 205 EEB9 F1 POP PSW Get opcode 206 EEBA F5 PUSH PSW 207 EEBB AE XRA M Comp it with table 208 EEBC 23 INX H 209 EEBD E61F ANI :1F 210 EEBF C2B4EE JNZ :EEB4 Check next opcode if not 211 found 212 EEC2 EB XCHG If found: addr string in HL 213 EEC3 23 INX H 214 EEC4 7E MOV A,M Get 1st char 215 EEC5 2B DCX H Pnts to length 216 EEC6 CD02DE CALL :DE02 Check if upper case char 217 EEC9 F5 PUSH PSW 218 EECA DC6BCE CC :CE6B Print space if 1st char is 219 a letter 220 EECD CD32DB CALL :DB32 Print string from table 221 EED0 F1 POP PSW 222 EED1 DC6BCE CC :CE6B Print space if 1st char was 223 a letter 224 EED4 CDA2EE CALL :EEA2 List remaining operand 225 EED7 F1 POP PSW Get orig. opcode 226 EED8 FE1A CPI :1A Was it '(' ? 227 EEDA CC55EF CZ :EF55 Then print ')' 228 EEDD D1 POP D 229 EEDE C9 RET 230 231 * Not starting with operator: 232 233 EEDF 07 L0E301 RLC 234 EEE0 07 RLC 235 EEE1 DAF2EE JC :EEF2 Jump if var.ref 236 EEE4 07 RLC 237 EEE5 DAEDEE JC :EEED Jump if function call 238 239 * If constant: 240 241 EEE8 CD84EF CALL :EF84 List constant 242 EEEB D1 POP D 243 EEEC C9 RET 244 245 * If function call: 246 247 EEED CD5AEF L0E302 CALL :EF5A List function reference 248 EEF0 D1 POP D 249 EEF1 C9 RET PAGE 05 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 250 251 * If variable reference: 252 253 EEF2 CDFCEE L0E303 CALL :EEFC List a var.reference 254 (array with arguments) 255 EEF5 D1 POP D 256 EEF6 C9 RET 257 * 258 ***************************** 259 * LIST A VARIABLE REFERENCE * 260 ***************************** 261 * 262 * SCARN: Entry for arrays without arguments (name 263 * only). 264 * L0E305: Entry for arrays with arguments. 265 * 266 * Entry: BC points to variable reference in program. 267 * 268 EEF7 16BF SCARN MVI D,:BF Set mask 'no arg' 269 EEF9 C3FEEE JMP :EEFE 270 * 271 EEFC 16FF L0E305 MVI D,:FF Set mask 'with arg' 272 EEFE D5 L0E306 PUSH D Save mask 273 EEFF 0A LDAX B Get byte 274 EF00 03 INX B 275 EF01 E63F ANI :3F Skip bit 6,7 276 EF03 57 MOV D,A Rest in D 277 EF04 0A LDAX B Get next byte 278 EF05 03 INX B 279 EF06 5F MOV E,A in E (Now DE is offset 280 of start of symtab) 281 EF07 2AA102 LHLD :02A1 Get start symtab 282 EF0A 19 DAD D Add offset from start 283 EF0B D1 POP D Get mask 284 EF0C E5 PUSH H Save var.addr in symtab 285 EF0D CD95CA CALL :CA95 Find name in symtab 286 EF10 7E MOV A,M Get T/L byte 287 EF11 A2 ANA D AND with mask 288 EF12 F5 PUSH PSW 289 EF13 23 INX H 290 EF14 E60F ANI :0F Get length 291 EF16 5E MOV E,M Get 1st byte of name in E 292 EF17 CD44DB CALL :DB44 List name; addr in HL, 293 length in A 294 EF1A 1600 MVI D,:00 295 EF1C 213402 LXI H,:0234 Startaddr for IMPTAB 296 EF1F 19 DAD D Addr var.type in IMPTAB 297 EF20 F1 POP PSW Get mask 298 EF21 F5 PUSH PSW 299 EF22 E630 ANI :30 Bits 4,5 only 300 EF24 BE CMP M Comp with IMPTAB 301 EF25 CA3CEF JZ :EF3C Jump if identical 302 EF28 FE00 CPI :00 FPT ? 303 EF2A 1621 MVI D,:21 Then D: '!' 304 EF2C CA38EF JZ :EF38 305 EF2F FE10 CPI :10 INT ? 306 EF31 1625 MVI D,:25 Then D: '%' 307 EF33 CA38EF JZ :EF38 308 EF36 1624 MVI D,:24 Else: D: '$' 309 EF38 7A L0E307 MOV A,D 310 EF39 CD60DD CALL :DD60 Print type sign 311 EF3C F1 L0E308 POP PSW Get mask PAGE 06 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 312 EF3D E640 ANI :40 Bit 6 only 313 EF3F E1 POP H Get addr of string 314 EF40 C8 RZ 315 316 * Bit 6=1 (array with arguments): 317 318 EF41 0A LDAX B Get nr of expressions 319 EF42 03 INX B 320 EF43 57 MOV D,A in D 321 EF44 CDF5EF CALL :EFF5 Print '(' 322 EF47 28 DATA :28 323 EF48 03 L0E309 INX B 324 EF49 D5 PUSH D 325 EF4A CDA2EE CALL :EEA2 List expression 326 EF4D D1 POP D 327 EF4E 15 DCR D Ready ? 328 EF4F C470CE CNZ :CE70 If not: print ',' 329 EF52 C248EF JNZ :EF48 and list next expr 330 EF55 CDF5EF L0E310 CALL :EFF5 If ready: Print ')' 331 EF58 29 DATA :29 332 EF59 C9 RET 333 * 334 ***************************** 335 * LIST A FUNCTION REFERENCE * 336 ***************************** 337 * 338 * Finds functionname in table with startaddress 339 * #CFE6 and prints it. Eventual arguments are 340 * printed between brackets. 341 * 342 * Entry: BC points to function code (#20). 343 * Exit: BC updated, AFEHL preserved, D=0. 344 * 345 EF5A 03 SFUN INX B 346 EF5B 0A LDAX B 347 EF5C 03 INX B 348 EF5D 57 MOV D,A 349 EF5E 21E6CF LXI H,:CFE6 Startaddr function table 350 EF61 15 L0E312 DCR D 351 EF62 FA6BEF JM :EF6B If found 352 EF65 CDAECA CALL :CAAE Calc addr next string in tab 353 EF68 C361EF JMP :EF61 Test next function name 354 EF6B CD32DB L0E313 CALL :DB32 List function name 355 EF6E 7E MOV A,M Get byte after string 356 EF6F E60F ANI :0F Only nr of following args 357 EF71 57 MOV D,A in D 358 EF72 C8 RZ Abort if no arguments 359 EF73 CDF5EF CALL :EFF5 Print '(' 360 EF76 28 DATA :28 361 EF77 CDA2EE L0E314 CALL :EEA2 List expression 362 EF7A 15 DCR D Decr nr of arg 363 EF7B C470CE CNZ :CE70 If <>0, print ',' 364 EF7E C277EF JNZ :EF77 and list next expr 365 EF81 C355EF JMP :EF55 If ready: print ')' 366 * 367 ******************* 368 * LIST A CONSTANT * 369 ******************* 370 * 371 * The constant is decoded to ASCII, prettied and 372 * printed. 373 * PAGE 07 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 374 * Codes: #10: FPT #18: Quoted string 375 * #14: INT #19: Unquoted string 376 * #15: HEX 377 * 378 * Entry: BC: Points to constant in program. 379 * Exit: BC updated, DE preserved, AF corrupted. 380 * HL: points after end of printed string. 381 * 382 EF84 0A SCON LDAX B Get type of constant 383 EF85 03 INX B 384 EF86 60 MOV H,B ) Addr constant in HL 385 EF87 69 MOV L,C ) 386 387 * If string: 388 389 EF88 FE18 CPI :18 Quoted string ? 390 EF8A CAE1EF JZ :EFE1 Then list it 391 EF8D FE19 CPI :19 Unquoted string ? 392 EF8F CAEDEF JZ :EFED Then list it 393 394 * If number: 395 396 EF92 E7 RST 4 Copy constant value to MACC 397 EF93 0C DATA :0C 398 EF94 FE10 CPI :10 FPT ? 399 EF96 CAA8EF JZ :EFA8 Then list FPT value 400 EF99 FE14 CPI :14 INT ? 401 EF9B F5 PUSH PSW 402 EF9C CCBDEF CZ :EFBD List INT value 403 EF9F F1 POP PSW 404 EFA0 C4DAEF CNZ :EFDA Else: list HEX value 405 EFA3 03 SC010 INX B 406 EFA4 03 INX B 407 EFA5 03 INX B 408 EFA6 03 INX B BC points after constant 409 EFA7 C9 RET 410 EFA8 CDD4EF SC020 CALL :EFD4 List FPT value 411 EFAB C3A3EF JMP :EFA3 412 * 413 ********************* 414 * LIST A LINENUMBER * 415 ********************* 416 * 417 * Entry: BC: Points to linenumber. 418 * Exit: BC updated, DE preserved, AFHL corrupted. 419 * 420 EFAE 0A L0E318 LDAX B Get hibyte linenr 421 EFAF 03 INX B 422 EFB0 67 MOV H,A in H 423 EFB1 0A LDAX B Get lobyte linenr 424 EFB2 03 INX B 425 EFB3 6F MOV L,A in L 426 EFB4 CD46EB SLN10 CALL :EB46 Linenr into MACC 427 EFB7 7C MOV A,H 428 EFB8 B5 ORA L Linenr <>0 ? 429 EFB9 C4BDEF CNZ :EFBD Then list linenr 430 EFBC C9 RET 431 * 432 ************************************* 433 * LIST A INT VALUE OF MACC CONTENTS * 434 ************************************* 435 * PAGE 08 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 436 * The value is the contents of the MACC, prepared 437 * for output, and moved into the outputbuffer 438 * DECBUF (#00E3). A Leading space is omitted. 439 * 440 * Exit: BCDE preserved. A corrupted. 441 * HL: Points after string in DECBUF. 442 * 443 EFBD CD5FDB SCINT CALL :DB5F Convert MACC for INT 444 output into DECBUF 445 EFC0 2A33C0 SSSPC LHLD :C033 Get addr DECBUF 446 EFC3 D5 PUSH D 447 EFC4 56 MOV D,M String length in D 448 EFC5 23 INX H 449 EFC6 7E MOV A,M 1st char in A 450 EFC7 FE20 CPI :20 Space ? 451 EFC9 C2CEEF JNZ :EFCE Jump if no leading space 452 EFCC 23 INX H ) Omit leading space 453 EFCD 15 DCR D ) 454 EFCE 7A SSS10 MOV A,D Get nr of char in A 455 EFCF D1 POP D 456 EFD0 CD44DB CALL :DB44 Print contents DECBUF 457 EFD3 C9 RET 458 * 459 *********************************** 460 * LIST FPT VALUE OF CONTENTS MACC * 461 *********************************** 462 * 463 * Exit: BCDE preserved. AF corrupted. 464 * HL points after string in DECBUF. 465 * 466 EFD4 CD9BCE SCFPT CALL :CE9B Convert MACC for FPT output 467 EFD7 C3C0EF JMP :EFC0 List its contents 468 * 469 *********************************** 470 * LIST HEX VALUE OF CONTENTS MACC * 471 *********************************** 472 * 473 * Exit: BCDE preserved. AF corrupted. 474 * HL points after string in DECBUF. 475 * 476 EFDA CDF5EF SCHEX CALL :EFF5 Print '#' 477 EFDD 23 DATA :23 478 EFDE C34ADB JMP :DB4A List in hex 479 * 480 ************************ 481 * LIST A QUOTED STRING * 482 ************************ 483 * 484 * Entry: BC: Points to string. 485 * Exit: BC and HL point after string. 486 * AF corrupted. DE preserved. 487 * 488 EFE1 CDF5EF SQTS CALL :EFF5 Print " 489 EFE4 22 DATA :22 490 EFE5 CDEDEF CALL :EFED List string 491 EFE8 CDF5EF CALL :EFF5 Print " 492 EFEB 22 DATA :22 493 EFEC C9 RET 494 * 495 ************************ 496 * LIST UNQUOTED STRING * 497 ************************ PAGE 09 DAI FIRMWARE 0EE09-0EFFF V1.0 Rev.1 498 * 499 * Entry: BC points to string. 500 * Exit: BC and HL point after string. 501 * AFDE preserved. 502 * 503 EFED 60 SUQTS MOV H,B ) Stringaddr in HL 504 EFEE 69 MOV L,C ) 505 EFEF CD32DB CALL :DB32 List string 506 EFF2 44 MOV B,H ) 507 EFF3 4D MOV C,L ) Addr after string in BC 508 EFF4 C9 RET 509 * 510 ****************** 511 * LIST CHARACTER * 512 ****************** 513 * 514 * Entry: On stack: The address of the character to 515 * be printed. 516 * Exit: BCDEHL preserved. F corrupted. 517 * A: Character printed. 518 * 519 EFF5 E3 SCHRI XTHL Get addr from stack 520 EFF6 7E MOV A,M Get char 521 EFF7 23 INX H HL pnts after char 522 EFF8 E3 XTHL Returnaddr on stack 523 EFF9 C360DD JMP :DD60 List char. 524 * 525 ******************************** 526 * LIST EXPRESSION; PRINT SPACE * 527 ******************************** 528 * 529 EFFC C368CE SEXPS JMP :CE68 List expr, print space 530 * 531 EFFF 3E DATA :3E 532 * 533 * 534 * 535 F000 END *************************** * S Y M B O L T A B L E * *************************** L0E300 EEB4 L0E301 EEDF L0E302 EEED L0E303 EEF2 L0E305 EEFC L0E306 EEFE L0E307 EF38 L0E308 EF3C L0E309 EF48 L0E310 EF55 L0E312 EF61 L0E313 EF6B L0E314 EF77 L0E318 EFAE L0E350 EE15 MPT02 EE8D MPT17 EE0F RLA20 EE4C RTK40 EE94 S2510 EE55 S2710 EE79 S2720 EE7C SC010 EFA3 SC020 EFA8 SC22A EE25 SCARN EEF7 SCEXP EEA2 SCFPT EFD4 SCHEX EFDA SCHRI EFF5 SCINT EFBD SCN21 EE09 SCN22 EE1A SCN23 EE30 SCN24 EE4F SCN25 EE52 SCN26 EE66 SCN27 EE71 SCN28 EE87 SCON EF84 SEXPS EFFC SFUN EF5A SLN10 EFB4 SQTS EFE1 SSS10 EFCE SSSPC EFC0 SUQTS EFED