利用正弦波設計的太陽軌道-24小時時鐘
alias riguang.cgq d0
alias led.xianshiqi d1
alias v.jiao r15
alias h.jiaodu r14
alias mianji r13
alias xiaoshi r12
alias fenzhong r11
alias jiaodu r10
start:
yield
l v.jiao riguang.cgq Vertical
l h.jiaodu riguang.cgq Horizontal
bltal h.jiaodu 0 buyaofuzhi
div r0 v.jiao rad2deg
sin r0 r0
div r1 h.jiaodu rad2deg
sin r1 r1
mul mianji r0 r1
asin mianji mianji
mul mianji mianji rad2deg
move jiaodu mianji
blt h.jiaodu 90 shijian.huansuan
sge r0 h.jiaodu 90
slt r1 h.jiaodu 270
and r0 r0 r1
bnez r0 nizhuangA
sge r0 h.jiaodu 270
slt r1 h.jiaodu 360
and r0 r0 r1
bnez r0 nizhuangB
shijian.huansuan:
div r0 jiaodu 15
trunc xiaoshi r0
sub fenzhong r0 xiaoshi
mul fenzhong fenzhong 60
trunc fenzhong fenzhong
div fenzhong fenzhong 100
add r0 xiaoshi fenzhong
s led.xianshiqi Setting r0
j start
buyaofuzhi:
add h.jiaodu h.jiaodu 360
j ra
nizhuangA:
sub jiaodu 180 mianji
j shijian.huansuan
nizhuangB:
add jiaodu 360 mianji
j shijian.huansuan