??? 08/24/08 10:48 Read: times |
#157700 - does this solution make sense Responding to: ???'s previous message |
The random routine is called between waits for a button press
where the number generated is needed for display. A register (33H) is set with a value of #1 upon initial power up. When the random routine is called the value in register 33H is loaded into the Acc and rotated left, tested for over flow, if none return, if so reset to #1 and return. The TIME (not the amount of times) that the register value is a 1 is less than the time it is any other value. Leaving a narrower window for a button press to capture it. So looking at my modified code below (smaller case is the new change) do you think I am closer to a final solution? 8 machine cycles if it is a 1 and 7 cycles if it is 2 thru 6? START:MOV A,33H ;1 MACHINE CYCLE(S) RL A ;1 JB ACC.6,LEAP ;2 MOV 33H,A ;1 RET ;2 ; LEAP: MOV 33H,#1 ;1 nop ;1 RET ;2 Probably the same thing you have already detailed but I have to 'splain this change at a big meeting on Tuesday. |