;PROGRAM ENVIRONMENT ;RAM locations used for the program 9000-9FFF STACK .EQU 91FFH ;Stack pointer initialised at 91FF PORTA .EQU 08H ;PORT A of 8255 PORTB .EQU 09H ;PORT B of 8255 PORTC .EQU 0AH ;PORT C of 8255 CWR(8255) .EQU 0BH ;Control Word of 8255 CWR(8279) .EQU 01H ;Control Word of 8279 DAT(8279) .EQU 00H ;Data Address of 8279 RDKBD .EQU 0A64H ;Location of KIT keyboard subroutine CLEAR .EQU 0B00H ;Location of display Clear subroutine .ORG 9000H LXI SP,STACK MVI A ,80H ;8255 Control word for Ports A,B and C as output OUT CWR(8255) ; LOOP: CALL MESSAGE ;Call subroutine for message display CALL RDKBD ;An utility subroutine in the kit to Accept hex digit form the keyboard CPI 11H ;Compare with next key code JNZ LOOP CALL CLEAR ;Clear display CHECK: CALL RDKBD ANI 0FH CPI 01H JZ P1 CPI 02H JZ P2 CPI 03H JZ P3 CPI 04H JZ P4 CPI 05H JZ P5 JMP CHECK HLT P1: CALL CLEAR ;Pattern1 subroutine MVI A,20H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A,06H ;7-SEGMENT CODE FOR '1' OUT DAT(8279) ;Display acc content MVI A,73H ;7 SEGMENT CODE FOR 'P' OUT DAT(8279) LXI H,PATTERN1 ;Pattern1 location 9310H MVI C,08H ;No. of data in pattern1 CALL DISPLAY JMP P1 P2: CALL CLEAR ;Pattern2 subroutine MVI A,20H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A,5BH ;7 SEGMENT CODE FOR '2' OUT DAT(8279) ;Display acc content MVI A,73H ;7 SEGMENT CODE FOR 'P' OUT DAT(8279) LXI H,PATTERN2 ;Pattern2 location 9320H MVI C,06H ;No. of data in pattern2 CALL DISPLAY JMP P2 P3: CALL CLEAR ;Pattern3 subroutine MVI A,20H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A,4FH ;7 SEGMENT CODE FOR '3' OUT DAT(8279) ;Display acc content MVI A,73H ;7 SEGMENT CODE FOR 'P' OUT DAT(8279) LXI H,PATTERN3 ;Pattern3 location 9330H MVI C,06H ;No. of data in pattern3 CALL DISPLAY JMP P3 P4: CALL CLEAR ;Pattern4 subroutine MVI A,20H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A,66H ;7 SEGMENT CODE FOR '4' OUT DAT(8279) ;Display acc content MVI A,73H ;7 SEGMENT CODE FOR 'P' OUT DAT(8279) LXI H,PATTERN4 ;Pattern4 location 9340H MVI C,04H ;No. of data in pattern4 CALL DISPLAY JMP P4 P5: CALL CLEAR ;Pattern5 subroutine MVI A,20H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A,6DH ;7 SEGMENT CODE FOR '5' OUT DAT(8279) ;Display acc content MVI A,73H ;7 SEGMENT CODE FOR 'P' OUT DAT(8279) LXI H,PATTERN5 ;Pattern5 location 9350H MVI C,08 ;No. of data in pattern5 CALL DISPLAY JMP P5 DISPLAY: MOV A,M ;Display subroutine OUT PORTA ;acc content in port A OUT PORTB ;acc content in port B OUT PORTC ;acc content in port C CALL DELAY CALL DELAY INX H ;point to next memory location DCR C JNZ DISPLAY RET MESSAGE: MVI A,04H ;mode setting of 8279 OUT CWR(8279) ;control word for 8279 MVI A, 79H ;7 SEGMENT CODE FOR 'E' OUT DAT(8279) ;Display acc content MVI A, 5EH ;7 SEGMENT CODE FOR 'd' OUT DAT(8279) ;Display acc content MVI A, 3FH ;7 SEGMENT CODE FOR 'O' OUT DAT(8279) ;Display acc content MVI A, 39H ;7 SEGMENT CODE FOR 'C' OUT DAT(8279) ;Display acc content RET DELAY: LXI D,0FFFFH ;Delay subroutine L2: DCX D MOV A,E ORA D JNZ L2 RET .ORG 9310H PATTERN1: .DB 80H .DB 50H .DB 20H .DB 10H .DB 08H .DB 05H .DB 02H .DB 01H .ORG 9320H PATTERN2: .DB 55H .DB 0AAH .DB 0CCH .DB 33H .DB 0F0H .DB 0FH .ORG 9330H PATTERN3: .DB 81H .DB 42H .DB 24H .DB 18H .DB 24H .DB 42H .ORG 9340H PATTERN4: .DB 81H .DB 18H .DB 42H .DB 24H .ORG 9350H PATTERN5: .DB 07FH .DB 0BFH .DB 0DFH .DB 0EFH .DB 0F7H .DB 0FBH .DB 0FDH .DB 0FEH .END