First page Back Continue Last page Overview Graphics
Laboratory 2.2 (cont)
Write a program that reads the switches at port T (address $ae) from the evaluation board, adds the contents of memory location "ADDEND" to the value read from the switches, and writes the resulting value to the board's LEDs. The LEDs can be accessed via port S (address $d6).
- Use the “ds.b" assembler directive to reserve a byte of memory at location "ADDEND".
Run the program several times with different values in location "ADDEND".
To write data to the LED's, port S needs to be made an output port. Make port S an output by writing all ones to the port S data direction register at address $d7.
Since ADDEND is uninitialized, the debugger can be used to put different values in addend each time the program is executed. To modify a variable, place the cursor on the variable, right click and select Variable/Modify.