MULX data resolution?
Posted: Fri Jun 06, 2025 2:03 am
I have two positive counter with bipolar incrementation. The first one "A" works as intended while the other one "B" is stuck at 0Hz (no incrementation). The only difference in the codes is the value stored in 'base'. 1024 works fine while 256 does not. This seems to indicate that MULX doesn't register the 8 (or 9?) LSBs of the multiplication register. Or is there something else going on? My interpretation from the documentation is that MULX does multiplication of all 24bits.
A:
B:
A:
Code: Select all
equ count1 reg0
equ base reg1
or 1024 ; 1024
wrax base, 0 ; store, clr
or $7fffff ; 1
rdax POT0, -2 ; 1 to -1
mulx base ; x base increment
or $800000 ; offset positive increments by -1
rdax count1, 1 ; add counter
and $7fffff ; +1 offset
wrax count1, 1 ; store, keep in accCode: Select all
equ count1 reg0
equ base reg1
or 256 ; 256
wrax base, 0 ; store, clr
or $7fffff ; 1
rdax POT0, -2 ; 1 to -1
mulx base ; x base increment
or $800000 ; offset positive increments by -1
rdax count1, 1 ; add counter
and $7fffff ; +1 offset
wrax count1, 1 ; store, keep in acc