Micro­power

  

Volume 2 · Number 2 · April 1982

Page 15 of 37
522RET
523ADD37AADD A, 37H; CONVERT TO ASCII A – F
524JP PRTH1
525ADD37BADD A, 37H
526JP PRTH2
527; * * * * * * * * * * * * * * * * * * * * * * * * * * * *
528; GENERAL SUBROUTINES
532; * * * * * * * * * * * * * * * * * * * * * * * * * * * *
533ENABLELD A, 00; ENABLE CHIP
534OUT (BDATA), A; CONTROL PORT B
535LD A, 20H
536STABLEDEC A; WAIT FOR CHIP
537JR NZ STABLE
538RET
539; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
542; SCROLL TO CLEAR CRT, CURSOR TO BOTTOM
543; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
544CLRCRTLD B, 0FH; SCROLL 15 TIMES
545CLR1DEFB SCAL, CRLF; TO CLEAR SCREEN AND
546DJNZ CLR1; LEAVE TOP LINE INTACT
547RET
548;
549RESETLD A, 2AH; 12V, RESET, WE, OE BITS SET
550JR RESET2
551RESET1LD A, 0AH; RESET, WE, OE BITS SET
552RESET2OUT (BDATA), A
553LD B, 10H
554WAIT6DJNZ WAIT6
555RES 3, A; END OF RESET
556OUT (BDATA), A
557RET
558; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
559; O/P SHORT PULSE TO INC. ADDR. COUNTER
560; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
561COUNTLD A, 6; COUNT PULSE ON
562OUT (BDATA), A
563LD B, 10H
564WASIT7DJNZ WAIT7
565LD A, 2
566OUT (BDATA), A; TURN COUNT PULSE OFF
567RET
568; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
569; SET PIO PORT A – INPUT, B – OUTPUT
570; BOTH PORTS TO MODE 3
571; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
572STPIO1LD A, 0FFH
573OUT (BCTRL), A; MODE 3
574LD A, 00
575OUT (BCTRL), A; OUTPUT
576STPIO2LD A, 0FFH
577OUT (ACTRL), A; MODE 3
578OUT (ACTRL), A; INPUT
579RET
580; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
582; SET PIO PORT A TO MODE 3, OUTPUT
583; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
584STPIO3LD A, 0FFH
585OUT (ACTRL), A; MODE 3
Page 15 of 37