; FILENAME      J31E22.ASM
; DESCRIPTION   10 SECOND SOFT TIMER
; HARDWARE      JAZZ31 V2.0
; ASSEMBLER     SXA51
; START-DATE    12/04/38
; COMPANY       SILA RESEARCH CO.,LTD.

         ORG    8100H

CONA     EQU    0F800H            ;SEGMENT
CONB     EQU    0F801H            ;DIGIT & LED
DTSEC    EQU    0042H             ;DELAY SYSTEM CALL
UBEEP    EQU    00A5H             ;USER BEEP SYSTEM CALL
ENDVEC   EQU    0036H             ;END VECTOR

; ********** MAIN **********

EXAM:    MOV    R7,#10            ;10 SECOND LOOP
         MOV    DPTR,#EXAMTB

EXAM1:   CLR    A                 ;LOAD FROM TABLE
         MOVC   A,@A+DPTR
         MOV    R2,A              ;MEMORY TO R2

         PUSH   DPH               ;--\
         PUSH   DPL
         MOV    DPTR,#CONB        ;SET DIGIT=0
         MOVX   A,@DPTR
         ANL    A,#11111000B      ;B0-B2=0
         MOVX   @DPTR,A
         MOV    DPTR,#CONA        ;SET SEGMENT
         MOV    A,R2
         MOVX   @DPTR,A
         MOV    DPTR,#CONB        ;FLASH LED
         MOVX   A,@DPTR
         SETB   ACC.4             ;LED ON (1)
         MOVX   @DPTR,A
         MOV    R2,#5             ;DELAY 0.5 SECOND
         CALL   DTSEC
         CLR    ACC.4             ;LED OFF (0)
         MOVX   @DPTR,A
         MOV    R2,#5             ;DELAY 0.5 SECOND
         CALL   DTSEC
         POP    DPL
         POP    DPH               ;--/

         INC    DPTR              ;NEXT TABLE
         DJNZ   R7,EXAM1          ;NEXT LOOP
         CALL   UBEEP
         JMP    ENDVEC            ;TO MONITOR

EXAMTB:  DB     6FH,7FH,07H,7DH   ;9876
         DB     6DH,66H,4FH,5BH   ;5432
         DB     06H,3FH           ;10

         END

