Machine language improvement of program for Clock Calendar interface CLK-1000 (QZX July 1987).(Recovery and display option only, not put into)
The machine language routine in this program provides the speed necessary for no interference with the main program work.
Make use of a ML loader program.
Place holder in 1 REM with at least 106 arbitrary characters.
Enter machine code (decimal) from assembler List 2.
MLI-CLK/1000 – ASSEMBLER (LIST 2)
16514 30 LD E,N
16515 0
16516 46 LD L,N
16517 235
16518 22 LD D,N
16519 12
16520 123 LD A,E
16521 28 INC E
16522 211 OUT N,A
16523 247
16524 6 LD B,N
16525 63
16526 77 LD C,L
16527 44 INC L
16528 219 IN A,F6
16529 246
16530 230 AND 0F
16531 15
16532 2 LD(BC),A
16533 21 DEC D
16534 175 XOR A
16535 122 LD A,D
16536 254 CP N
16537 0
16538 32 JR NZ, DIS
16539 236
16540 0 NOP
16541 6 LD B,N
16542 23
16543 14 LD C,N
16544 10
16545 205 CALL P.AT
16546 245 08F5
16547 8
16548 30 LD E,N
16549 240
16550 46 LD L,N
16551 3
16552 38 LD H,N
16553 2
16554 22 LD D,N
16555 63
16556 26 LD A,(DE)
16557 205 CALL
16558 194 16578
16559 64
16560 37 DEC H
16561 175 XOR A
16562 29 DEC E
16563 124 LD A,H
16564 254 CP N
16565 0
16566 32 JP NZ,DIS
16567 242
16568 205 CALL
16569 223 16607
16570 64
16571 45 DEC L
16572 125 LD A,L
16573 254 CP N
16574 0
16575 32 JP NZ,DIS
16576 231
16577 201 RET
16578 6 LD B,N
16579 28
16580 128 ADD A,B
16581 50 LD(NN),A
16582 234 16618
16583 64
16584 123 LD A,E
16585 254 CP N
16586 240
16587 40 JR Z, DIS
16588 2
16589 24 JR DIS
16590 9
16591 58 LD A, (NN)
16592 234 16618
16593 64
16594 214 SUB N
16595 8
16596 205 CALL PRINT-A
16597 16 0010 (P-CHR)
16598 0
16599 201 RET
16600 58 LD A,(NN)
16601 234 16618
16602 64
16603 205 CALL
16604 16 0010 (P-CHR)
16605 0
16606 201 RET
16607 125 LD A,L
16608 254 CP N
16609 1
16610 200 RET Z
16611 62 LD A,N
16612 14 :
16613 205 CALL
16614 16 0010 (P-CHR)
16615 0
16616 201 RET
16617 0
16618 0 DATA
POKE 16418,0
RAND USR 16514
This ML work into 1 REM statement.
If you want to put ML into BBRAM, then the following changes of address are necessary, with the ML now into 1 REM ;
POKE 16558, 146 } 16274 POKE 16592, 186 } 16314 POKE 16559, 63 } POKE 16593, 63 } POKE 16569, 175 } 16303 POKE 16601, 186 } 16314 POKE 16570, 63 } POKE 16602, 63 } POKE 16582, 186 } 16314 POKE 16583, 63 }
Once you type all above POKE’s, you can type the next BASIC program, follow the 1 REM
5 LET C = 16210
10 FOR A = 16514 TO 16618
20 POKE C, (PEEK A)
30 LET C = C + 1
40 NEXT A
This DUMPER program copy the ML from 1 REM into BBRAM after address fixed on line 5 (the address can easily be changed)
With a few additional POKES to the program, I will be able to print the time on line 23 of the screen with ML ( to make unnecessary POKE 16418,0 ).
POKE 16200, 62 LD A,N POKE 16204, 64 POKE 16201, 0 POKE 16205, 195 JP NN POKE 16202, 50 LD(NN),A POKE 16206, 82 } 16210 POKE 16203, 34 (16418) POKE 16207, 63 }
If you want another print position for the retrieve time, you must change some statements in the program.
In assembler List 2 (before dump) change byte of address 16542 (Line of screen) with desired number of line (0 to 23). Also change byte of address 16544 (column of screen) with desired column number.
Now, If you want to add time display into any program, the only instruction necessary is RAND USR 16200 (with number of line) and you can see the time rapidly, at speed of machine language( Don’t forget to put ML-CIK/1000 into BBRAM..! ).
Also if you type into main program conventional PEEK’s into address 16363 to 16375 (see page 7 of QZX July 1987), you can set date and time values exactly if POKE 16236, 201 and RAND USR 16210 is prior to the PEEK’s, but time is not displayed for ML at line 23.
SUMMARILY
If ML resided in 1 REM { POKE 16418,0 { Print At 23,10;
{ RAND USR 16514 { HH:MM:SS (only)
If ML resided into BBRAM { RAND USR 16200 { " " " "
For another use of infor- { POKE 16236,201 { PEEK's 16363 to
mation (not displayed) { RAND USR 16210 { 16375 (Date & time)
73’s from LU8MAD, Guillermo
Note to MLI-CLK/1000
This program reads the register contents only. For loading the register (for the first time) use Line 1 to line 190 (less line 5 ) and line 9000 to line 9050 of BASIC program in QZX July 1987, page 6.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.