fred
Dec 11 2003, 07:41 AM
I have about 150 counters that I would like to reset simultaneously with a single reset bit. In the past I have used 150 counter reset (RES) instructions keyed off the same reset bit (B3/0). Does anyone know of a better way to perform the reset? I tried using a file move to move zeroes into the accumulated (ACC) values, but this doesn't work because the file move doesn't recognize the starting address (C16:0.ACC) as a valid address. The counters are in a single, contiguous data file (C16:0 thru 149).
Guest
Dec 11 2003, 08:14 AM
You can do it with indirect addressing. First a start condition bit (B3:0/0) then using a Mov 0 into C16:[N7:0].ACC. You then add a 1 to N7:0 ADD N7:0, 1,N7:0, Finally a EQU block N7:0 = 146. You then reset N7:0 back to 0 and disable the start bit (B3:0/0). This logic here will take 146 scans to reset the counters or about 3 seconds.