Question: 6 . 1 0 Problem 6 c: Elevator Create a new Platform.IO project called Lab 6 c . Your project should include the startup.s ,
Problem c: Elevator
Create a new Platform.IO project called Labc Your project should include the startup.s
ECEasmutil.s and platformio.ini files from the Lab zip file. Create a new main.s file
with the program you will write
Consider a story building with a basement. The first floor is given the number the second
is given the number and so on The basement is given the number You will write a program
to simulate an elevator operated throughout the whole building. Write the following
subroutines that will work with the main program,
a DELAY: generates a software delay of second.
b OPEN: displays a Door open message on the screen after a delay of second. A
working version of this code is supplied for your use, if you like on Canvas.
c CLOSE: displays a Door close message on the screen after a delay of second.
d UP: performs the following procedure:
i Displays a Going UP message on the screen.
ii Goes up one floor at a time second delay between each floor until the elevator
reaches the destination.
iii. At each floor, prints that number current floor number plus a space on the screen.
iv After the elevator reaches the destination floor, stores this number as the current
floor number in memory.
e DOWN: performs the following procedure:
i Displays a Going DOWN message on the screen.
ii Goes down one floor at a time second delay between each floor until the
elevator reaches the destination.Lab FA Subroutines and the Stack
iii. At each floor, prints that number current floor number on the screen.
iv After the elevator reaches the destination floor, stores this number as the current
floor number in memory.
f STAY: displays a Same floor message on the screen after a delay of second.
Following is the pseudo code you can use for your main program,
Initialize the elevator at floor #memory location containing the present location of
the elevator
Call the OPEN subroutine.
Wait for the input from the user
Call the CLOSE subroutine.
Compare the number input with the present floor number.
If the number input is greater than the present floor number, call the UP subroutine.
Then jump to step
If the number input is less than the present floor number, call the DOWN subroutine.
Then jump to step
If the number input is equal to the present floor number, call the STAY subroutine.
Jump back to step
Your output should look something like this:
Show the working program to TA
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
