First page Back Continue Last page Overview Graphics
Laboratory 4.1 : Arrays
Add code to check the switches and output one of two different sequences to the LEDs depending on the state of the switches.
- If I/O port T (address $ae) is zero send sequence 1, shown below, to the LEDs, and
- if nonzero send sequence 2, also shown below, to the LEDs.
Use an if-else structure to load a pointer to either sequence 1 or sequence 2. The program should continually loop sending the entire sequence out and then dropping back and checking the switch settings again. Use a while structure when sending out the sequences. If a terminator is used at the end of the sequences, a single loop can be used to send out the data.
The two sequences are:
sequence 1 $81,$42,$24,$18,$00,$24,$42
sequence 2 $80,$40,$20,$10,$08,$04,$02,$01