/TIMERY/
name prog
cseg AT 00
wp equ 15536
ljmp start
org 0bh
ljmp int_t0
org 50h
start:
orl tmod,#0000$0001b
mov tl0,#low(wp)
mov th0,#high(wp)
orl ie,#1000$0010b
setb tr0
mov a,#1
mov p1,a
mov r0,#0
petla:
cjne r0,#20,petla
mov r0,#0
rl a
mov p1,a
;cjne a,#1000$0000b,petla2
petla2:
cjne r0,#3,petla2
mov r0,#0
rr a
mov p1,a
;cjne a,#0000$0001b,petla
ljmp petla
int_t0:
orl tl0,#low(wp)
mov th0,#high(wp)
inc r0
reti
end
/STER DYN+PET OP/
PROG SEGMENT CODE
RSEG PROG
MOV R0,#254
MOV R1,#0
MOV R2,#0
MOV R3,#0
MOV R4,#0
MOV R5,#50
MOV R6,#50
PETLA: clr P3.5
mov P1,R0
clr P3.3
lcall Delay
setb P3.3
mov P1,R1
setb P3.5
lcall Delay
inc R3
cjne R3,#5,PETLA
mov R3,#0
inc R4
mov A,R0
rl A
mov R0,A
cjne R4,#2,PETLA
mov R4,#0
inc R1
LJMP PETLA
Delay:
djnz R5,Delay
mov R5,#50
djnz R6,Delay
mov R6,#50
ret
END
/STER DYN TIMER/
NAME NOWY
WP EQU 55536
GEN SEGMENT CODE
DANE SEGMENT DATA
BSEG AT 20H
FLAGA: DBIT 1
RSEG DANE
ORG 50H
CZERWONA: DS 1
ZIELONA: DS 1
RSEG GEN
ORG 0H
LJMP START
ORG 0BH
LJMP INT_T0
ORG 100H
START:
ORL TMOD,#0000$0001B
MOV TL0,#LOW(WP)
MOV TH0,#HIGH(WP)
ORL IE,#1000$0010B
SETB TR0
MOV CZERWONA,#1
MOV ZIELONA,#254
PETLA:
CJNE R0,#10,PETLA2
MOV R0,#0
MOV A,ZIELONA
RL A
MOV ZIELONA,A
PETLA2:
CJNE R1,#20,PETLA
MOV R1,#0
MOV A,CZERWONA
INC A
MOV CZERWONA,A
LJMP PETLA
INT_T0:
ORL TL0,#LOW(WP)
MOV TH0,#HIGH(WP)
INC R0
INC R1
JB FLAGA,CZER
ZIEL:
CLR P3.5
MOV P1,ZIELONA
CLR P3.3
LJMP KON
CZER:
SETB P3.3
MOV P1,CZERWONA
SETB P3.5
KON:
CPL FLAGA
RETI
END
/KLAW +ZL BIN/
NAME KLAW
GEN SEGMENT CODE
RSEG GEN
MOV R0,#0
MOV R3,#1
Petla:
JB P3.2, Petla
LCALL Delay(10ms)
JB P3.2, Petla
INC R0
MOV P1,R0
JNB P3.2,$
LJMP Petla
Delay:
INC R0
NOP
CJNE R0,#208,PETLA
MOV R0,#0
INC R1 ,NOP
CJNE R1,#12,PETLA
MOV R1,#0;NOP; LJMP PETLA
N=[(1+2)208+1+1+2]12+1+2+1
/LICZNIK0..9+PETLĄ OP./
NAME WYSW
GEN SEGMENT CODE
RSEG GEN
MOV DPTR,#TAB
MOV R0,#255
CLR P3.3
MOV R3,#9
PETLA:
LCALL DELAY
INC R0
CJNE R0,#10,KON
MOV R0,#0
KON: MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
LJMP PETLA
TAB:
DB 0011$1111B
DB 0000$0110B
DB 0101$1011B
DB 0100$1111B
DB 0110$0110B
DB 0110$1101B
DB 0111$1101B
DB 0000$0111B
DB 0111$1111B
DB 0110$1111B
DELAY:
DJNZ R1,DELAY
DJNZ R2,DELAY
DJNZ R3,DELAY
MOV R3,#9
RET
END
-------------------
/TIMERY/
name prog
cseg AT 00
wp equ 15536
ljmp start
org 0bh
ljmp int_t0
org 50h
start:
orl tmod,#0000$0001b
mov tl0,#low(wp)
mov th0,#high(wp)
orl ie,#1000$0010b
setb tr0
mov a,#1
mov p1,a
mov r0,#0
petla:
cjne r0,#20,petla
mov r0,#0
rl a
mov p1,a
;cjne a,#1000$0000b,petla2
petla2:
cjne r0,#3,petla2
mov r0,#0
rr a
mov p1,a
;cjne a,#0000$0001b,petla
ljmp petla
int_t0:
orl tl0,#low(wp)
mov th0,#high(wp)
inc r0
reti
end
/STER DYN+PET OP/
PROG SEGMENT CODE
RSEG PROG
MOV R0,#254
MOV R1,#0
MOV R2,#0
MOV R3,#0
MOV R4,#0
MOV R5,#50
MOV R6,#50
PETLA: clr P3.5
mov P1,R0
clr P3.3
lcall Delay
setb P3.3
mov P1,R1
setb P3.5
lcall Delay
inc R3
cjne R3,#5,PETLA
mov R3,#0
inc R4
mov A,R0
rl A
mov R0,A
cjne R4,#2,PETLA
mov R4,#0
inc R1
LJMP PETLA
Delay:
djnz R5,Delay
mov R5,#50
djnz R6,Delay
mov R6,#50
ret
END
/STER DYN TIMER/
NAME NOWY
WP EQU 55536
GEN SEGMENT CODE
DANE SEGMENT DATA
BSEG AT 20H
FLAGA: DBIT 1
RSEG DANE
ORG 50H
CZERWONA: DS 1
ZIELONA: DS 1
RSEG GEN
ORG 0H
LJMP START
ORG 0BH
LJMP INT_T0
ORG 100H
START:
ORL TMOD,#0000$0001B
MOV TL0,#LOW(WP)
MOV TH0,#HIGH(WP)
ORL IE,#1000$0010B
SETB TR0
MOV CZERWONA,#1
MOV ZIELONA,#254
PETLA:
CJNE R0,#10,PETLA2
MOV R0,#0
MOV A,ZIELONA
RL A
MOV ZIELONA,A
PETLA2:
CJNE R1,#20,PETLA
MOV R1,#0
MOV A,CZERWONA
INC A
MOV CZERWONA,A
LJMP PETLA
INT_T0:
ORL TL0,#LOW(WP)
MOV TH0,#HIGH(WP)
INC R0
INC R1
JB FLAGA,CZER
ZIEL:
CLR P3.5
MOV P1,ZIELONA
CLR P3.3
LJMP KON
CZER:
SETB P3.3
MOV P1,CZERWONA
SETB P3.5
KON:
CPL FLAGA
RETI
END
/KLAW +ZL BIN/
NAME KLAW
GEN SEGMENT CODE
RSEG GEN
MOV R0,#0
MOV R3,#1
Petla:
JB P3.2, Petla
LCALL Delay(10ms)
JB P3.2, Petla
INC R0
MOV P1,R0
JNB P3.2,$
LJMP Petla
Delay:
INC R0
NOP
CJNE R0,#208,PETLA
MOV R0,#0
INC R1 ,NOP
CJNE R1,#12,PETLA
MOV R1,#0;NOP; LJMP PETLA
N=[(1+2)208+1+1+2]12+1+2+1
/LICZNIK0..9+PETLĄ OP./
NAME WYSW
GEN SEGMENT CODE
RSEG GEN
MOV DPTR,#TAB
MOV R0,#255
CLR P3.3
MOV R3,#9
PETLA:
LCALL DELAY
INC R0
CJNE R0,#10,KON
MOV R0,#0
KON: MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
LJMP PETLA
TAB:
DB 0011$1111B
DB 0000$0110B
DB 0101$1011B
DB 0100$1111B
DB 0110$0110B
DB 0110$1101B
DB 0111$1101B
DB 0000$0111B
DB 0111$1111B
DB 0110$1111B
DELAY:
DJNZ R1,DELAY
DJNZ R2,DELAY
DJNZ R3,DELAY
MOV R3,#9
RET
END