Proste przerwanie
ORG 0
LJMP START
;=========
ORG 0BH
LJMP PROCEDURA
;=========
START:
MOV TMOD, #0001B
SETB TR0
MOV DPTR, #-10000D
MOV TL0, DPL
MOV TH0, DPH
MOV IE, #10000010B
AAA:
LJMP AAA
PROCEDURA:
SETB P1.6
RETI
END
Kolejny program
STOS EQU 5FH
RAMW EQU 20H
RAMP EQU 0
PTWY EQU 8008H
L8 BIT P1.6
DSEG AT RAMW
L100: DS 1
KPTWY: DS 1
CSEG AT RAMP
LJMP INIC
DS 0BH - $
LJMP IRT
INIC: MOV SP,#STOS
MOV TMOD,#01
MOV TCON,#10H
MOV IE,#02
MOV L100,#0
MOV KPTWY,#0
MOV DPTR,#5000
MOV TL0,DPL
MOV TH0,DPH
SETB IE.7
PETL:
LJMP PETL
IRT:
MOV DPTR,#-5000
MOV TL0,DPL
MOV TH0,DPH
INC L100
MOV A,L100
CJNE A,#100,IRT1
MOV L100,#0
CPL L8
JNB L8,IRT1
MOV A,KPTWY
MOV DPTR,#TK7SG
MOVC A,@A+DPTR
MOV DPTR,#PTWY
MOVX @DPTR,A
INC KPTWY
IRT1: RETI
TK7SG:
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
DB 10000000B,00000001B,01000000B,00000010B
DB 00100000B,00000100B,00010000B,00001000B
END