Write an ARM assembly language program to collect the correct amount of road toll tax from a vehicle. If the vehicle is a motorbike then the correct road toll tax should be 2, otherwise the road toll tax should be 5. The vehicle type is given to you, so you don’t have to guess. Assume that someone has already put the vehicle type value in register R0. Therefore, R0 contains a value, 0 or some other value. If the value in register R0 is 0 then the vehicle is a motorbike, if it is any other value then it is not a motorbike. The correct road toll tax value needs to be in register R1. So at the end of your program R1 will either contain 2 or 5, depending on the value in R0. a) Make a flowchart of your program. b) Write the ARM assembly language program, matching the flowchart.
a) Flowchart

b) ARM Program
cmp r0, #0
beq true //true branch
mov r1, #5 //false
b done //done branch
mov r1, #2 //true
Write an ARM assembly language program to collect the correct amount of road toll tax from...
ARM assembly language Write a program "fibonacci.s" that computes the Nth Fibonacci number where N is not so large that overflow of integer arithmetic is a concern. When your assembly language program is called it should expect the value of N to be passed using register r0 and your program should return the Nth Fibonacci number in register r0. Please include comments as well. Do not just use the output generated by gcc -S
Write ARM assembly language instructions to change the value of r0 as follows: • set the most significant byte of r0 to one’s (i.e., 0xFF) if the least significant byte of r1 is less than 90. • complement the least significant byte of r0 if r1 is odd.
Write a simple program in arm, assembly language , using only
Registers, to test if 371 is an Armstrong number. The program
written should only have instruction set from the Cortex m0+. And
then put a 1 in a register to show it
It is, or 0 if it isn’t.
The second program is about the Armstrong numbers. You assume it will be a 3-digit number which will be entered through the data area. You can use a register so...
Write a program in assembly language that loads register R2 with the word in memory location which is 10 bytes above the address in R0; and loads register R3 with the word in memory location which is 10 bytes below the address in R1. Your program must compare the two numbers in R2 and R3. If number in R2 is less than or equal to the number in R3 it must add the two numbers and save the result in...
Write an ARM assembly language program to translate the following sequence of statements . Assume x and y are memory locations that store two unsigned integers. Use the following: x is in R1, y is in R2, and z in R3. Make sure that your program works for any value of x and y. if (x > 15) { x = 1; if (y > 15) { y = 2; } else { y =...
Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...
I need help with ARM assembly program :
Using the following code as basic :
1 ) Write a program code that is able to calculate the following
: Result = A + ( B * C ) - D
Place the result as the return value so you can print it
afterwards in the command prompt.
2) This time, use MLA instruction to
reduce the number of instructions in question 1.
Place the result as the return value so...
Write a program in ARM assembly language that copies each element of array A to consecutive fourth elements of array B, i.e., A[0] to B[0], A[1] to B[3], A[2] to B[7], etc. The array A is 12 elements long, and each element is a number that is 32 bits (1 word) wide. Assume the base address of array A is in register R2, and the base address of array B is in R3.
Write an ARM assembly language program to translate the following sequence of statements . Assume x and y are memory locations that store two unsigned integers. Use the following: x is in R1, y is in R2, and z in R3. Make sure that your program works for any value of x and y. if (x > 15) { x = 1; if (y > 15) { y = 2; } else { y =...
Question 2 ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper. (5 marks) Explain the difference between eor and eors instruction. Use an example to show why both forms are useful. а. b. (5 marks) Explain using an example what the "Idr r3, [r7,#4]" instruction does. c. (10 marks) The following is the assembly language generated by a C compile type mystery, %function mystery: args 0, pretend = 0, frame =...