ARM Assignment
Goals:
Initialize register X, Y, and Z to zero.
Loop 10 times, each time adding 1 to register X.
If register X is even, add one to register Y.
If register X is divisible by 3, add one to register Z.
Result:
Register X at 10.
Register Y at 5.
Register Z at 3 or 4 (depending on when you increment your counter).
ARM64 GCC 5.4 CODE
main:
sub sp, sp, #16
str wzr, [sp, 12]
str wzr, [sp, 8]
str wzr, [sp, 4]
.L5:
ldr w0, [sp, 12]
cmp w0, 9
bgt .L2
ldr w0, [sp, 12]
and w0, w0, 1
cmp w0, wzr
bne .L3
ldr w0, [sp, 8]
add w0, w0, 1
str w0, [sp, 8]
.L3:
ldr w2, [sp, 12]
mov w0, 21846
movk w0, 0x5555, lsl 16
smull x0, w2, w0
lsr x1, x0, 32
asr w0, w2, 31
sub w1, w1, w0
mov w0, w1
lsl w0, w0, 2
sub w0, w0, w1
sub w1, w2, w0
cmp w1, wzr
bne .L4
ldr w0, [sp, 4]
add w0, w0, 1
str w0, [sp, 4]
.L4:
ldr w0, [sp, 12]
add w0, w0, 1
str w0, [sp, 12]
b .L5
.L2:
mov w0, 0
add sp, sp, 16
ret
ARM Assignment Goals: Initialize register X, Y, and Z to zero. Loop 10 times, each time...
Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program to evaluate: Z = 3x - 5y+5 Leave the result in register $10. Inspect the register after running the program to check that the program works. Run the program several times, initialize x and y to different values for each run.
What does the following program print? I // Exercise 3.12 Solution: ex03_12.cpp // What does this program print? #include <iostream> using namespace std; 3 4 7 int main() { int y; // declare y int x = 1; // initialize x int total = 0; // initialize total while ( 10 ) // loop 10 times y = X* X; // perform calculation cout << y << endl; // output result total += y; // add y to total ++x;...
y-0 cm y 60 cm 30 cm B 10 T 10 Ω 10 cm. . v 10 m/s z out of page y A rectangular wire loop is carried in the y-direction at a constant speed of 10 m/s. The loop has a total loop resistance of 10 Ω and is lying in the x-y plane. It is 30 cm long and 10 cm wide. A region of constant and uniform magnetic field of magnitude 10 T pointing in the...
2. a)Write the ARM ALP conditional code snippet for the following statements written in C-language. Assume R1 to Rn as06 variables Let R1, R2, R3 contain the starting addresses of arrays X, Y and Z respectively Use Register R4 for variable i. Display appropriate messages. While (i+10) else Z[i] XiYi; b)i Write a program to display a message "This is an examination Question" on the screen using 06 a function sub program Note the following Address of the string to...
Assembly Operations A very simple microcontroller has one register, X, which is initialised to 0, and supports only 3 types of microinstructions: LDI v: Load (store) the immediate value, v, into X- ADD v Add the immediate value v to X and store the result in X SQR: Square the value of and store the result in A program for this microcontroller is simply a sequence of n microinstructions, each being of one of the 3 types described. For example,...
8). Name five of the fundamental ter ns which encompass object-oriented programming 9). Write a class called NumberOfGoals that represents the total number of goals scored by a ootball team. The NumberOfGioals class should contain a single integer as data, representing the number of goals scored. Write a constructor to initialize the number of goals to Zero. 10). Write a set of instructions to prompt the user for an int value and input it using the Scanner class into the...
Part 1: Using Idle Write a Python Script that Does the Following 1. At the top of your program, import the math library as in from math import * to make the functions in the math module available. Create a variable and assign into it a constant positive integer number of your choice. The number should be at most 10. 1 Suppose we call this variable x for this writeup document Try something like x = 4 2. Create another...
A conducting loop with area 0.14 m2 and resistance 10 Ω lies in the x-y plane. A spatially uniform magnetic field points in the z direction. The field varies with time according to Bz=at2−b, where a = 3.0 T/s2 and b = 8.8 T . Find the loop current when Bz = 0.
radodls.org/assignment/1936186696/assessment and the arm span, rounded to the nearest centimeter, of each person in a random sample of 10 seniors at a high school. A scatterplot of arm span versus height for the 10 seniors is shown 164 T 163 2 162 161 E 160 E 159 2158 157 156 155 t + 155 156 157 158 159 160 161 162 163 164 Height, centimeters Part A: Based on the scatterplot, descnibe the relationship between arm span and height for...
Java Questions When creating a for loop, which statement will correctly initialize more than one variable? a. for a=1, b=2 c. for(a=1, b=2) b. for(a=1; b=2) d. for(a = 1&& b = 2) A method employee() is returning a double value. Which of the following is the correct way of defining this method? public double employee() c. public int employee() public double employee(int t) d. public void employee() The ____ statement is useful when you need to test a...