;EXAM12.ASM
;LEDMATRIX 4x4
;
	ORG	0000H		;LOAD IN 8000H
;

MAIN:	MOV	R5,#4		;LOAD COUNT OFF BYTE
	MOV	DPTR,#TABLE1	;LOAD TABLE POINTER
LOOP:	CLR	A
	MOVC	A,@A+DPTR
	MOV	P1,A
	LCALL	DELAY
	INC	DPTR		;INC POINTER
	DJNZ	R5,LOOP		;DEC COUNTER R3


	SJMP	MAIN

DELAY: 	MOV	R2,#05		;Delay for diaplay
	LCALL	DMSEC
	RET


;********** DMSEC SUB **********
;DELAY 1/1000 SECOND
;IN  = R2
;REG = R2,R3

DMSEC:   MOV    R3,#230         ;1 MSEC LOOP
DMSEC1:  NOP
	 NOP
	 DJNZ   R3,DMSEC1
	 DJNZ   R2,DMSEC
	 RET

TABLE1: DB     01110010B
	DB     10110111B
	DB     11010010B
	DB     11100010B

END

