-
32 bit counter
I use the following assembly routine whenever I need a 16 bit counter
infsnz var
incf var + 1
but now I need a 32 bit counter (in assembly).
Apparently, I'm not smart enough to figure it out for myself.
Can someone please show me how to implement my 32 bit counter?
-
-
It appears that the best routine would be
count32
incfsz var
bra doneproc
incfsz var + 1
bra doneproc
incfsz var + 2
bra doneproc
incf var + 3
bnc doneproc
bsf eflag,0
doneproc
but I can't test it tonight. Can anyone find anything wrong with this?
-
This has to work... hey that was easier than you thought right?
EDIT it runs smooth on MPSIM... :eek: well for that i may trust MPSIM ;)
-
I tried it this morning. It works. The technique works with any number of bits.