70 likes | 179 Views
The Simulator project. Assignment 1. Create a subroutine for delay between the individual diplays in the assignment. Use a BSR instruction for this . First, attach a 7-segment display to Port B
E N D
Assignment 1 • Create a subroutine for delay between the individual diplays in the assignment. Use a BSR instruction for this. • First, attach a 7-segment display to Port B • Then write code to light up each of the individual segments of the display with a delay between each. • Then write code to activate the segments such that the display shows 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 in order with a delay between the display of each digit.
Detail on the use of BSR • BSR stands for Branch to Subroutine • All that is stacked on a BSR is the Program Counter. If you want to save any other register, you need to do it. • Convention is to stack (and then restore before return) any registers that your routine uses. • The return to the calling program is achieved by a RTS instruction.
Assignment 2 • Add a 2nd display on Port C and be able to output the most-significant-nibble of what is in accumulator A to this. • For this you will have a couple levels of subroutines.
The subroutines • The program flow using subroutines.
Assignment 2 • Add the second 7-Segment Display for the MSB. • The intent is to display the contents in the A accumulator (BCD) on the display. • In assignment 2 you set up the subroutines to display the digits on the respective display.
Assignment 2 structure • The subroutine calling structure of 2