A switch is pressed every time a motor rotates. When the contacts come together, the switch 'clatters' or bounces, causing an interval when a single press produces multiple closures. This movement can last for less than 3 milliseconds. The switch is linked into a 68000 processor's memory map at bit 0 of address $FFFFF000. It is wired so that the bit reads a '1' when the switch is open and a '0' when the switch is closed and not moving. The bouncing will result in zeros and ones switching. For the sake of simplicity, assume that every instruction, regardless of addressing mode, requires one usec. Write a commented program that continuously counts the number of times the switch is pushed. It must ignore the bouncing of the switch. This is all your program needs to do; don’t worry about other functions that the 68000 may have to perform at this point.
A switch is pressed every time a motor rotates. When the contacts come together, the switch 'clatters' or bounces, causing an interval when a single press produces multiple closures. This movement can last for less than 3 milliseconds.
The switch is linked into a 68000 processor's memory map at bit 0 of address $FFFFF000. It is wired so that the bit reads a '1' when the switch is open and a '0' when the switch is closed and not moving. The bouncing will result in zeros and ones switching.
For the sake of simplicity, assume that every instruction, regardless of addressing mode, requires one usec.
Write a commented program that continuously counts the number of times the switch is pushed. It must ignore the bouncing of the switch. This is all your program needs to do; don’t worry about other functions that the 68000 may have to perform at this point.
Step by step
Solved in 2 steps