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

MOV AL, 0FFH	; send all ones to Port-C
OUT PPIC, AL

COLUMN:
	MOV AL, 7FH	; enable column zero (C0)
SHOW: 
	OUT PPIB, AL; sending the value to Port-C

CALL TIMER		; making some delay
CLC				; clear the carry flag if the shift 

ROR AL, 1		; moving the '0' to the next row
JC SHOW			; still there are column to light
JMP COLUMN		; start again from row 0

INT 3

PROC TIMER
	MOV CX, 0FFFFH	; this is a 16 bit counter
TIME: 
	NOP
	NOP	
	NOP
	NOP
LOOP TIME
RET

CODE ENDS
END 