Micro­power

  

Volume 2 · Number 2 · April 1982

Page 17 of 37
648DEC D; REDUCE ENTRY COUNTER
649JR NZ, SCAN2; JUMP IF NOT FINISHED
650JR SCAN7; JUMP TO SCAN7WHEN DONE
651SCAN5CP "A"; IS IT ASCII A – F?
652JP M, SCAN2; IF NOT, REJECT IT
653CP "G"
654JP P, SCAN2
655LD (HL), A; PRINT IT IF O.K.
656SUB 37H; CONVERT TO 10 – 15
657LD (IY), A; STORE IT
658INC HL; NEXT SCREEN LOCATION
659INC IY; NEXT STORE
660DEC D; REDUCE ENTRY COUNTER
661JR NZ SCAN2; JUMP IF NOT DONE
662SCAN7LD HL, 0A4BH; SAVE THIS MESSAGE IN CASE
663LD DE, STORLN; ENTRY IS TO BE CHANGED
664LD BC, 20H
665LDIR
666DEFB SCAL, CRLF; SCROLL CRT
667DEFB SCAL, CRLF; TWICE
668LD HL, TXT11A; CORRECT –Y/N?
669LD DE, 0B0BH
670LD BC, 14H
671LDIR
672XOR A
673SCAN8DEFB SCAL, KBD; GET ANSWER
674JR C, SCAN9
675JR SCAN8
676SCAN9CP "Y"; ANSWER "YES"?
677JR Z SCAN6; IF SO, JUMP TO SCAN6
678CP "N"; ANSWER "NO"?
679JR Z SCAN10; IF SO, JUMP TO SCAN10
680JR SCAN8; REJECT OTHER REPLIES
681SCAN10CALL CLRCRT; CLEAR SCREEN
682LD HL, STORLN; RESTORE SAVED MESSAGE
683LD DE, 0A4BH
684LD BC, 20H
685LDIR
686LD A, (SCNFLG); FIND OUT WHERE TO JUMP
687CP 00
688JP Z, ROMADR; IF ZERO, JUMP TO ROMADR
689JP RAMADR; ELSE WAS FROM RAMADR
690JP SCANT1; BACK TO GET ADDRESS AGAIN
691SCAN6LD IY, STORE; POINT TO FIRST ENTRY
692LD A, (IY); GET FIRST
693RLCA; ROTATE BITS 4 TIMES
694RLCA; TO PUT VALUE INTO
695RLCA; INTO MOST SIGNIFICANT NIBBLE
696RLCA
697ADD A, (IY+1); ADD SECOND VALUE
698LD H, A; SAVE IN H REGISTER
699LD A, (IY+2); GET 3RD ENTRY
700RLCA; PUT INMOST SIGNIFICANT NIBBLE
701RLCA
702RLCA
703RLCA
Page 17 of 37