Question

In: Computer Science

Create three 8-bit variables in the “.text” section and initialize it to any values you like....

Create three 8-bit variables in the “.text” section and initialize it to any values you like. Load three registers (R1, R2, and R3) using the initialized values. Now, add the values of register R2 and R3 and store the result on the stack. Multiply the content of R1 and top of the stack, and again store the result on to the stack. Make sure to use appropriate instructions. (ARM assembly language)

Solutions

Expert Solution

section .text
global _start

_start:

var1: db 1 /* here I declared first variable var1 with initial value 1 */
var2: db 2 /* this is our second variable with initial value 2 */
var3: db 3 /* this is our third variable with initial value 3 */

LB R1,var1 /* here I load the value of var1 to register R1 */
LB R2,var2 /* here I load the value of var2 to register R2 */
LB R3,var3 /* here I load the value of var2 to register R3 */   
PUSH R2 /* here I push the value of register R2 into the stack */
PUSH R3 /* here I push the value of register R3 into the stack*/
ADD /* here add command add R2 AND R3 which we pushed into the stack*/
PUSH R1 /* here top we push R1 into the top of the stack*/
MUL /* finally we multiply the R1 with the sum of R2 and R3*/

/*this code is further explained below in detail*/


Related Solutions

Question 1 Please create three different types of variables and assign three different values into the...
Question 1 Please create three different types of variables and assign three different values into the variables. Please create a new variable and assign the sum of two variables above. Please display all the data (four data here) as a line. Question 2 using Scanner, take three inputs from a user (job level, the number of years in company, and job title) and display yearly bonus percentage based in the following rule: job level : 1 to 10 Job title...
PYTHON ASSIGNMENT Problem: (1) The  __init__ method should initialize the values of the instance variables. Here is...
PYTHON ASSIGNMENT Problem: (1) The  __init__ method should initialize the values of the instance variables. Here is the beginning of __init__: def __init__(self, the_hr, the_min, the_sec): self.hr = the_hr # Also initialize min and sec. (2) Include a __str__ method that returns the current state of the clock object as a string. You can use the string format method format like this: return "{0:02d}:{1:02d}:{2:02d}".format(self.hr, self.min, self.sec) (3) When the tick method is executed, add one to sec. If the resulting value...
1) Dynamic Allocation (c++) a. Create two integer variables x and y, initialize them with different...
1) Dynamic Allocation (c++) a. Create two integer variables x and y, initialize them with different values. b. Use dynamic memory allocation, declare px and py as address of x and y separately. c. Print out x, y, px, py, &x, &y, *px, *py.   d. Let py = px, and *py = 100 e. Print out x, y, px, py, &x, &y, *px, *py. g. Print out *px++, x, px
Create an object call Accounts using python for a banking system. Initialize the account with three...
Create an object call Accounts using python for a banking system. Initialize the account with three data as inputs : Firstname, Lastname and initial deposit. Create 4 additional member functions: Deposit, Withdraw, Fee Calculations, interest The fee calculation is going to be $14 per month if the total amount in the account is less than $1000. Interest is set to be at 5%.
(In C) Note: Can you create an example code of these tasks. use any variables you...
(In C) Note: Can you create an example code of these tasks. use any variables you wish to use. postfix expressions: (each individual text (T), (F), (NOT), etc is a token) F T NOT T F NOT T T T AND F T F NAND (1) Create stack s. (2) For each token, x, in the postfix expression: If x is T or F push it into the stack s. (T = true, F = false) Else if x is...
Rework problem 3 from section 2.4 of your text. Assume that you randomly select 8 cards...
Rework problem 3 from section 2.4 of your text. Assume that you randomly select 8 cards from a deck of 52. What is the probability that all of the cards selected are diamonds? equation editorEquation Editor
Create a chart ( any way you would like)that summaries all the medias include in the...
Create a chart ( any way you would like)that summaries all the medias include in the chart if the media is selective, differential, enrichment-any special characteristics, what is it used for identification, what are the possible results ( and any color changes or any other ingredients needed to analyze) and what are the interpretations if those results.
Create the appropriate variables and algorithm to calculate the following. Choose your own values for the...
Create the appropriate variables and algorithm to calculate the following. Choose your own values for the variables. Do not enter the code on this paper. Create a program that calculates and displays the calculation. Approximate pi (π) as 3.14159. You do not need to create a new program for each question. If certain math equations use the same variable name, then you only need to declare it once in your main function. Separate each problem using comments, like seen in...
My Values: In this section you will write about your values, such as whether you follow...
My Values: In this section you will write about your values, such as whether you follow individualistic or collective values or a combination of both. Explain some of these individualistic or collective values. Also in this section write about an issue that you are passionate about such as gender equality, climate change, education or any other issue that interests you and say what you can do to contribute positively to this issue.
CAN YOU PLEASE GIVE ME A POEM SOMETHING LIKE THAT. Create or find a poem (any...
CAN YOU PLEASE GIVE ME A POEM SOMETHING LIKE THAT. Create or find a poem (any style) which reflects/describes your thoughts on teaching diverse population in the classroom. Make sure your poem has a title and demonstrates your overall understanding of the importance of including diversity in classroom curriculum. We Are One The color of your hair The personality The likings Might not be the same as mine The way you live The things you eat The language you speak...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT