100% found this document useful (2 votes)
149 views2 pages

Question: Using Arm Assembly Language (Arm Cortex-M Microcontroll

The document discusses writing an ARM assembly language program to simulate an elevator operating in a 9-story building with a basement. It provides descriptions of subroutines to: 1) Generate a 1 second delay 2) Display "Door open" after a 1 second delay 3) Display "Door close" after a 1 second delay 4) Move up one floor at a time, displaying each floor number, until the destination is reached 5) Move down one floor at a time, displaying each floor number, until the destination is reached 6) Display "Same floor" after a 1 second delay It also provides pseudo-code for the main program to initialize the elevator, get user input,

Uploaded by

Mustafa Khudhair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
149 views2 pages

Question: Using Arm Assembly Language (Arm Cortex-M Microcontroll

The document discusses writing an ARM assembly language program to simulate an elevator operating in a 9-story building with a basement. It provides descriptions of subroutines to: 1) Generate a 1 second delay 2) Display "Door open" after a 1 second delay 3) Display "Door close" after a 1 second delay 4) Move up one floor at a time, displaying each floor number, until the destination is reached 5) Move down one floor at a time, displaying each floor number, until the destination is reached 6) Display "Same floor" after a 1 second delay It also provides pseudo-code for the main program to initialize the elevator, get user input,

Uploaded by

Mustafa Khudhair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

home / study / engineering / computer science / computer science questions and answers / using arm assembly language (arm

cortex-m microco…

Question: Using ARM Assembly Language (ARM Cortex-M MicroControll…


See this question in the app

Using ARM Assembly Language (ARM Cortex-M MicroController)


Consider a 9-story building with a basement. The rst oor is given the number 1, the second is given the
number 2 and so on. The basement is given the number 0. 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 1 second.
b) OPEN: displays a ‘Door open’ message on the screen after a delay of 1 second. A working version of
this code is supplied for your use, if you like on the “Software Downloads” page from the Lab page
c) CLOSE: displays a ‘Door close’ message on the screen after a delay of 1 second.
d) UP: performs the following procedure: i. Displays a ‘Going UP’ message on the screen. ii. Goes up one
oor at a time (1 second delay between each oor), until the elevator reaches the destination. iii. At each
oor, prints that number (current oor number) on the screen. iv. After the elevator reaches the
destination oor, stores this number as the current oor number in memory.
e) DOWN: performs the following procedure: i. Displays a ‘Going DOWN’ message on the screen. ii. Goes
down one oor at a time (1 second delay between each oor), until the elevator reaches the destination.
iii. At each oor, prints that number (current oor number) on the screen. iv. After the elevator reaches
the destination oor, stores this number as the current oor number in memory.
f) STAY: displays a ‘Same oor’ message on the screen after a delay of 1 second.
Following is the pseudo code you can use for your main program,
1. Initialize the elevator at oor #1 (memory location containing the present location of the elevator).
2. Call the ‘OPEN’ subroutine.
3. Wait for the input from the user (0-9).
4. Call the ‘CLOSE’ subroutine.
5. Compare the number input with the present oor number.
6. If the number input is greater than the present oor number, call the ‘UP’ subroutine. Then jump to
step 9.
7. If the number input is less than the present oor number, call the ‘DOWN’ subroutine. Then jump to
step 9.
8. If the number input is equal to the present oor number, call the ‘STAY’ subroutine
9. Jump back to step 2.

Expert Answer

Anonymous answered this


Was this answer helpful? 1 1
13 answers

ARM ASSEMBLY LANGUAGE:-

An assembler translates a le containing

assembly language code into the corresponding machine language.

But ARM processors support an entirely different machine language.the design of the machine langauge
encoding is called the instruction set architecture

int total;

int i;

total=0;

for (i=10; i>0; i--)

total +=i;

mov R0, ≠0
mov R1, ≠10

again ADD R0,R0,R1


SUBS R1,R1
BNE again

halt B balt
  


View comments (1)

You might also like