发布于 2015-02-03 19:51:53
20楼
非常高兴我不经意间看到的程序引起大家很大的兴趣,虽然我对它的应用理解的还是很肤浅。但是各位大侠只是通过这几句语句就推测出怎么用,实在令人佩服。这个我所说的M27.5,的确是用在定时器里的,可以做1秒级的定时器。
A #START // If the Command Bit is OFF, force the
JC TIMI // time accumulator to 32767
CLR // and exit with boolean status = OFF.
SAVE
L 32767
T #ACCUM
BEU
TIMI: AN M 27.5 // If the 1-second ONS pulse flag
JC AFTD // is not ON, skip the count-down
L #ACCUM // If the Accumulator is > Preset,
L #PRESET // force it to the Preset Value
>I
JCN DECR
T #ACCUM // Then decrease the Accumulator
DECR: L #ACCUM // by one (once at a second)
L 1
-I
T #ACCUM
AFTD: L #ACCUM // If the accumulated count is <=0,
L 0 // then the boolean status is set ON
<=I // and the accumulator is forced to
= L 0.0 // ZERO to prevent further negative
JCN OUTP // accumulation that could result in
T #ACCUM // rollover of the 16-bit accumulator
OUTP: A L 0.0 // and consequent wrong timer output.
SAVE
跟大家分享,再次感谢各位大神的回复,让我们这些小虾学到很多。
学习快乐 快乐学习