; FILENAME      J31E23.ASM
; DESCRIPTION   SERIAL INTERRUPT (SOUND,FLASH-LED)
; HARDWARE      JAZZ31 V2.0
; ASSEMBLER     SXA51
; START-DATE    14/04/38
; COMPANY       SILA RESEARCH CO.,LTD.

         ORG    8100H

CONB     EQU    0F801H            ;LED (BIT 4)
ENDVEC   EQU    0036H             ;END VECTOR
SOUND    EQU    00A2H             ;SOUND SYSTEM CALL

; ********** MAIN **********

EXAM:    CLR    TI                ;DISABLE TXD
         SETB   REN               ;ENABLE RXD
         SETB   ES                ;ENABLE TXD INTERRUPT
         SETB   EA                ;ENABLE ALL INTERRUPT
         JMP    ENDVEC            ;GOTO MONITOR

         DB     00H,00H,00H,00H   ;ORIGIN RELATIVE
         DB     00H,00H,00H,00H
         DB     00H,00H,00H,00H
         DB     00H,00H,00H,00H
         DB     00H,00H,00H,00H
         DB     00H,00H,00H,00H

                                  ;**** 8123H ADDRESS ****
EXAMS:   PUSH   PSW               ;RXD INTERRUPT ROUTINE
         PUSH   ACC
         PUSH   DPH
         PUSH   DPL
         SETB   RS0               ;SET REGISTOR BANK-1
         CLR    RS1

EXAMS1:  JNB    RI,EXAMS9         ;CHECK NOT RXD
         CLR    RI
         MOV    A,SBUF
         MOV    R2,A              ;MEMORY TO R2

         MOV    DPTR,#CONB        ;LED ON
         MOVX   A,@DPTR
         SETB   ACC.4
         MOVX   @DPTR,A
         MOV    R3,#8             ;SOUND (DELAY)
         CALL   SOUND
         MOV    DPTR,#CONB        ;LED OFF
         MOVX   A,@DPTR
         CLR    ACC.4
         MOVX   @DPTR,A

EXAMS9:  POP    DPL
         POP    DPH
         POP    ACC
         POP    PSW               ;(RETUEN OLD REGISTOR BANK)
         RETI

         END

