📄 shuangshandeng1.dt
字号:
r6==0x06
r5==0x05
ioc6==0x06
ioc5==0x05
ioce==0x0e
flag==0x20
bit_flag0==0
iocf==0x0f
rf == 0x0f
status==0x03
pc==0x02
time_counter1==0x21
time_counter2==0x22
lp_cnt0==0x10
lp_cnt1==0x11
org 000h
jmp main
org 008h
jmp time_int
org 00ah
main: mov a, @0x00 ; 定义P5口为输出口
iow ioc5
mov a, @0x01 ; 定义P6口为输出口
iow ioc6
mov a, @0x00 ; 关闭看门狗
iow ioce
bs r5, 0
bc r5, 0
bs r5, 1
bc r5, 1
mov flag, a
mov 0x23, a
mov time_counter1, a
mov a, @0x15
mov time_counter2, a
loop_600: bc flag, 1
bc flag, bit_flag0
mov a, @0x05
contw
eni
mov a, @00
mov r5, a
mov r6, a
mov a, @0x02
mov r5, a
loop_601: jbs flag, bit_flag0
jmp wait_601
jmp wait_602
wait_601: call wait_for
jbs flag, 1
jmp loop_601
jmp loop_700
wait_602: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_602: jbs flag, bit_flag0
jmp wait_603
jmp wait_604
wait_603: call wait_for
jbs flag, 1
jmp loop_602
jmp loop_700
wait_604: bc flag, bit_flag0
mov a, @0x02
mov r5, a
loop_603: jbs flag, bit_flag0
jmp wait_605
jmp wait_606
wait_605: call wait_for
jbs flag, 1
jmp loop_603
jmp loop_700
wait_606: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_604: jbs flag, bit_flag0
jmp loop_604
bc flag, bit_flag0
mov a, @0x02
mov r5, a
loop_605: jbs flag, bit_flag0
jmp wait_607
jmp wait_608
wait_607:call wait_for
jbs flag, 1
jmp loop_605
jmp loop_700
wait_608: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_606: jbs flag, bit_flag0
jmp wait_650
jmp wait_651
wait_650: call wait_for
jbs flag, 1
jmp loop_606
jmp loop_700
wait_651: bc flag, bit_flag0
mov a, @0x04
mov r5, a
loop_607: jbs flag, bit_flag0
jmp wait_609
jmp wait_610
wait_609: call wait_for
jbs flag, 1
jmp loop_607
jmp loop_700
wait_610: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_608: jbs flag, bit_flag0
jmp loop_608
bc flag, bit_flag0
mov a, @0x04
mov r5, a
loop_609: jbs flag, bit_flag0
jmp wait_611
jmp wait_612
wait_611: call wait_for
jbs flag, 1
jmp loop_609
jmp loop_700
wait_612: bc flag, bit_flag0
mov a, @00
mov r5, a
loop_800: jbs flag, bit_flag0
jmp loop_700
bc flag, bit_flag0
mov a, @0x04
mov r5, a
loop_610: jbs flag, bit_flag0
jmp wait_613
jmp wait_614
wait_613: call wait_for
jbs flag, 1
jmp loop_610
jmp loop_700
wait_614: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_611: jbs flag, bit_flag0
jmp wait_615
jmp wait_616
wait_615: call wait_for
jbs flag, 1
jmp loop_611
jmp loop_700
wait_616: bc flag, bit_flag0
jmp loop_600
loop_700: mov a, @0x06
contw
bc flag, 1
bc flag, bit_flag0
mov a, @00
mov r5, a
mov r6, a
mov a, @0x06
mov r5, a
loop_701: jbs flag, bit_flag0
jmp wait_701
jmp wait_702
wait_701: call wait_for
jbs flag, 1
jmp loop_701
jmp loop_900
wait_702: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_702: jbs flag, bit_flag0
jmp wait_703
jmp wait_704
wait_703: call wait_for
jbs flag, 1
jmp loop_702
jmp loop_700
wait_704: bc flag, bit_flag0
mov a, @0x06
mov r5, a
loop_703: jbs flag, bit_flag0
jmp wait_705
jmp wait_706
wait_705: call wait_for
jbs flag, 1
jmp loop_703
jmp loop_700
wait_706: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_704: jbs flag, bit_flag0
jmp loop_704
bc flag, bit_flag0
mov a, @0x06
mov r5, a
loop_705: jbs flag, bit_flag0
jmp wait_707
jmp wait_708
wait_707:call wait_for
jbs flag, 1
jmp loop_705
jmp loop_900
wait_708: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_706: jbs flag, bit_flag0
jmp wait_750
jmp wait_751
wait_750: call wait_for
jbs flag, 1
jmp loop_706
jmp loop_900
wait_751: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_707: jbs flag, bit_flag0
jmp wait_709
jmp wait_710
wait_709: call wait_for
jbs flag, 1
jmp loop_707
jmp loop_900
wait_710: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_708: jbs flag, bit_flag0
jmp loop_708
bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_709: jbs flag, bit_flag0
jmp wait_711
jmp wait_712
wait_711: call wait_for
jbs flag, 1
jmp loop_709
jmp loop_900
wait_712: bc flag, bit_flag0
mov a, @00
mov r5, a
loop_8000: jbs flag, bit_flag0
jmp loop_900
bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_710: jbs flag, bit_flag0
jmp wait_713
jmp wait_714
wait_713: call wait_for
jbs flag, 1
jmp loop_710
jmp loop_900
wait_714: bc flag, bit_flag0
mov a, @0x00
mov r5, a
loop_711: jbs flag, bit_flag0
jmp wait_715
jmp wait_716
wait_715: call wait_for
jbs flag, 1
jmp loop_711
jmp loop_900
wait_716: bc flag, bit_flag0
jmp loop_800
loop_900: bc flag, 1
mov a, @00
mov r5, a
mov r6, a
loop_201: jbs flag, bit_flag0
jmp wait_200
bc flag, bit_flag0
jmp loop_201
wait_200: call wait_for
jbs flag, 1
jmp loop_201
bc flag, 1
disi
jmp loop_600
nop
nop
nop
nop
nop
jmp main
nop
nop
nop
nop
nop
jmp main
time_int: disi
clr rf
inc time_counter1
mov a, time_counter1
bc status, 2
xor a, time_counter2
jbs status, 2
jmp loop_50
bs flag, bit_flag0
mov a, @00
mov time_counter1, a
loop_50: reti
delay10ms: mov a, @20
mov lp_cnt0, a
p0_dly: nop
mov a, @200
mov lp_cnt1, a
p0_lp: nop
nop
nop
djz lp_cnt1
jmp p0_lp
djz lp_cnt0
jmp p0_dly
ret
wait_for: disi
jbs r6, 0
jmp wait_1
jmp wait_2
wait_1: call delay10ms
jbc r6, 0
jmp wait_2
wait_4: jbs r6, 0 ; 等待按键松开
jmp wait_4
bs flag, 1
wait_2: eni
ret
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -