;FILENAME:   STLAB103.ASM
;DATE:       March 16, 1996
;TITLE:      LED matrix pattern shifts
;HARDWARE:   MLAB-121

; JAZZ-31 utilities subroutines
DTSEC   EQU     0042H   ;delay 1/10 routine

; MAX7219 Interface declaration
DATAI   EQU     P1.4    ;DATA IN pin
LOADX   EQU     P1.5    ;LOAD pin
CLOCK   EQU     P1.6    ;CLOCK pin
;
        ORG     8100H
START:
        CLR     CLOCK
        CLR     LOADX
        LCALL   INIT_7219
        LCALL   OFF_LEDS         ;clear all LEDs
        LCALL   SHFT_LEDS        ;shift LEDs pattern
        LJMP    0036H
;
; Command pattern to LEDs of 8 digits
;
SHFT_LEDS:
        MOV     DPTR,#PATTERN
        MOV     R0,#08H         ;row
PTRN_LED0:
        MOV     R1,#00H         ;column
PTRN_LED1:
        MOV     07H,00H
        MOV     A,R1
        MOVC    A,@A+DPTR
        MOV     R6,A
        LCALL   SEND_AD
        LCALL   DELAY
        INC     R1
        CJNE    R1,#09H,PTRN_LED1       ;end of column?
        DJNZ    R0,PTRN_LED0            ;end of row?
        RET
; characters pattern
PATTERN:
        DB       40H, 20H, 10H, 08H, 04H, 02H, 01H, 80H, 00H

        $INCLUDE  "STLAB10H.ASM"
        END

