led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2
led_k0_2: ; nop
ajmp led_jmp_5_end
led_k1_2: ; al1 way off/on
cpl al1_f
jb flash_f ,tw_11
sjmp tw_21
tw_11:
mov c,al1_f
mov a,flash
mov acc.1 ,c
mov flash,a
tw_21:
ajmp led_jmp_5_end
led_k2_2: ;al1 timer
jb flash_f ,set_11
inc al1_min_t
mov a,al1_min_t
cjne a,#60 ,set_12
mov al1_min_t,#00h
set_12:
sjmp set_14
set_11:
inc al1_min
mov a,al1_min
cjne a,#60 ,set_14
mov al1_min,#00h
set_14:
ajmp led_jmp_5_end
led_k3_2: ;al2 way off/on
cpl al2_f
jb flash_f ,tw_12
sjmp tw_22
tw_12:
mov c,al2_f
mov a,flash
mov acc.2 ,c
mov flash,a
tw_22:
ajmp led_jmp_5_end
led_k4_2: ;al2 timer
jb flash_f ,set_21
inc al2_min_t
mov a,al2_min_t
cjne a,#60 ,set_22
mov al2_min_t,#00h
set_22:
sjmp set_24
set_21:
inc al2_min
mov a,al2_min
cjne a,#60 ,set_24
mov al2_min,#00h
set_24:
ajmp led_jmp_5_end
led_k5_2: ; al3 way off/on
cpl al3_f
jb flash_f ,tw_13
sjmp tw_23
tw_13:
mov c,al3_f
mov a,flash
mov acc.3 ,c
mov flash,a
tw_23:
ajmp led_jmp_5_end
led_k6_2: ;al3 timer
jb flash_f ,set_31
inc al3_min_t
mov a,al3_min_t
cjne a,#60 ,set_32
mov al3_min_t,#00h
set_32:
sjmp set_34
set_31:
inc al3_min
mov a,al3_min
cjne a,#60 ,set_34
mov al3_min,#00h
set_34:
ajmp led_jmp_5_end
led_k7_2: ; turn off/on
setb turn_f
led_jmp_5_end:
ret
end
;****************************************
proc key_2
key_2:
mov dptr,#led_ord_3
mov a,key_power ;data
mov b,#02h
mul ab
jmp @a+dptr
led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2
led_k0_2: ; nop
ajmp led_jmp_5_end
led_k1_2: ; al1 way off/on
ajmp led_jmp_5_end
led_k2_2: ;al1 timer
jb flash_f ,set_311
inc al1_hour_t
mov a,al1_hour_t
cjne a,#20d ,set_321
mov al1_hour_t,#00h
set_321:
sjmp set_341
set_311:
inc al1_hour
mov a,al1_hour
cjne a,#20d ,set_341
mov al1_hour,#00h
set_341:
ajmp led_jmp_5_end
led_k3_2: ;al2 way off/on
ajmp led_jmp_5_end
led_k4_2: ;al2 timer
jb flash_f ,set_312
inc al2_hour_t
mov a,al2_hour_t
cjne a,#20d ,set_322
mov al2_hour_t,#00h
set_322:
sjmp set_342
set_312:
inc al2_hour
mov a,al2_hour
cjne a,#20d ,set_342
mov al2_hour,#00h
set_342:
ajmp led_jmp_5_end
led_k5_2: ; al3 way off/on
ajmp led_jmp_5_end
led_k6_2: ;al3 timer
jb flash_f ,set_313
inc al3_hour_t
mov a,al3_hour_t
cjne a,#20d ,set_323
mov al3_hour_t,#00h
set_323:
sjmp set_343
set_313:
inc al3_hour
mov a,al3_hour
cjne a,#20d ,set_343
mov al3_hour,#00h
set_343:
ajmp led_jmp_5_end
led_k7_2: ; turn off/on
led_jmp_5_end:
ret
end
;******************************************** led
proc led_jmp_1
led_jmp_1:
mov dptr,#led_ord_3
mov a,key_power ;data
mov b,#02h
mul ab
jmp @a+dptr
led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2
led_k0_2: ; nop
setb flash_f
mov a,#89d
mov r7,#18d
acall timer_led1
clr flash_f
ajmp led_jmp_5_end
led_k1_2: ; al1 way off/on
mov led1 ,#0bh
jnb al1_f,aal_1
mov a,#0ch
mov led1,a
aal_1:
mov led3,#1d
mov led2,#led_blk
ajmp led_jmp_5_end
led_k2_2: ;al1 timer
jb flash_f ,led_m11
mov a,al1_min_t
mov r7,al1_hour_t
sjmp led_m21
led_m11:
mov a,al1_min
mov r7,al1_hour
led_m21:
acall timer_led1
ajmp led_jmp_5_end
led_k3_2: ;al2 way off/on
mov led1 ,#0bh
jnb al2_f,aal_2
mov a,#0ch
mov led1 ,a
aal_2:
mov led3,#2d
mov led2,#led_blk
ajmp led_jmp_5_end
led_k4_2: ;al2 timer
jb flash_f ,led_m12
mov a,al2_min_t
mov r7,al2_hour_t
sjmp led_m22
led_m12:
mov a,al2_min
mov r7,al2_hour
led_m22:
acall timer_led1
ajmp led_jmp_5_end
led_k5_2: ; al3 way off/on
mov led1 ,#0bh
jnb al3_f,aal_3
mov a,#0ch
mov led1 ,a
aal_3:
mov led3,#3d
mov led2,#led_blk
ajmp led_jmp_5_end
led_k6_2: ;al3 timer
jb flash_f ,led_m13
mov a,al3_min_t
mov r7,al3_hour_t
sjmp led_m23
led_m13:
mov a,al3_min
mov r7,al3_hour
led_m23:
acall timer_led1
ajmp led_jmp_5_end
led_k7_2: ; turn off/on
mov led3,#00h
mov led2,#0bh;led_b
mov led1,#0bh;led_b
led_jmp_5_end:
acall led
ret
end
timer_led1: