; Drawing Z On The Dot Matrix
CODE SEGMENT
ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE

PPICR EQU 1EH	; control register
PPIC  EQU 1CH	; port C
PPIB  EQU 1AH	; port B
PPIA  EQU 18H	; port A

ORG 1000H

MOV AL,	80H 	; control word for all output 
OUT PPICR, AL

MOV AL, 0FFH	; send all ones to Port-A
OUT	PPIA, AL

DO:
    MOV AL, 42H    ; enabling all the column in the specified rows
    OUT PPIC, AL
    MOV AL,0BFH    ; enabling rows R0, R7 
	
    OUT PPIB, AL
 CALL TIMER
    MOV AL, 46H     ; enabling the first point on the Z
    OUT PPIC, AL 
    MOV AL, 0DFH
    
	OUT PPIB, AL
    CALL TIMER
    MOV AL, 4AH     ; enabling the second point on Z
    OUT PPIC, AL 
    MOV AL, 0EFH
    
	OUT PPIB, AL
CALL TIMER
    MOV AL, 52H     ; enabling the third point on Z
    OUT PPIC, AL 
    MOV AL, 0F7H
    
	OUT PPIB, AL
    CALL TIMER            
    MOV AL, 62H     ; enabling the fourth point on Z
    OUT PPIC, AL 
    MOV AL, 0FBH
    
	OUT PPIB, AL
    CALL TIMER
    MOV AL, 42H     ; enabling the fifth point on Z
    OUT PPIC, AL 
    MOV AL, 0FDH
    
	OUT PPIB, AL
   
   
          
    CALL TIMER
    JMP DO    
        
INT 3

PROC TIMER
	MOV CX, 0FFH	; this is a 16 bit counter
TIME: 
	NOP
	NOP	
	NOP
	NOP
LOOP TIME
RET

CODE ENDS
END