Question: Please help me do this LC - 3 Assembly program. It is to be run through PENNSIM and the instructions are as follows. We must

Please help me do this LC-3 Assembly program. It is to be run through PENNSIM and the instructions are as follows. We must use at least 6 subroutines. For this assignment, you will write a program that draws multiple color blocks on PennSim's graphic
display. The program user will be able to specify the location, pixel size, and color of 1-5 blocks, which
will be displayed onto the graphics sereen. Afterwards, the user may select each block by number and
that block will be brought to the front of the display.
The learning objectives for this assignment are:
Use load and store instructions to manipulate the content of memory.
Acoept varying number of digits as inputs
Use advanced boundary checking
Interface with the LC3 Graphics Memory
Program Specification
The program must start at address 3000.
The program prompt the user to enter the base coordinate (top left), color, and pixel count (x by x) for a
square box and will place this box on the screen. The use may select from 1 to 5 boxes, and the box
information must be retained after drawing it on the sereen. All entries for the box entry shall be echoed.
The PennSim graphics display (the "screen") is 128 by 124 pixels. We use an (x,y) coordinate system
to describe a location on the screen. Location (0,0) is the top left corner. The x coordinate increases as
we move to the right, and the y coordinate increases as we move down. In other words, (1,0) is one
pixel to the right of (0,0), and location (0,1) is one pixel below (0,0). Location (127,123) is the
bottom right comer of the screen. The boxes may NOT hang over the top, bottom, or side edges of the
graphics screen. If the coordinates are out of bounds for the chosen box size, an error message shall be
presented to the user and the box information re-prompted. The boxes are allowed to overlap each
other. While entering the box information the user shall use only integer values 0-127. Any other
character or number shall be ignored. The user should always press the ENTER key (x0A) to
signify their integer number is complete.
The first prompt will be for the x coordinate of the box origin. Followed by ENTER.
The second prompt will be for the y coordinate of the box origin. Followed by ENTER.
The third prompt will be for the number of pixels on both the horizontal and vertical sides.
Followed by ENTER.
The fourth prompt will be for the color and shall be a single letter representing the following
colors. Followed by ENTER.
Command
Character Action
r Set color to Red.
g Set color to Green.
b Set color to Blue.
y Set color to Yellow.
w Set color to White.
This information MUST be saved in memory for each of the 5 possible boxes.
3
At any time if the user enters the character n(next) the program will stop requesting box data
and will proceed to the redisplay phase. The program will present the user the opportunity to
draw up to 5 boxes. After this the program will automatically enter the redisplay phase.
During the redisplay stage the prompt is shown to the user to select a box number 1-5. This box
is redrawn from memory on top of the other boxes. The ENTER key is not required here. This is
repeated until the user hits the q quit key.
There are two additional commands:
Command
Character Action
c
Clear the screen.
Paint all pixels black. Program execution return to the start. Existing stored block data
is cleared.
q
Quit.
The program shall display a newline and message Thank you for playing, then
HALT. The screen remains as it is, it is not cleared.
Please help me do this LC - 3 Assembly program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!