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
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.
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.
UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit...
UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. a) What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) b) Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? c) With...
2. Given variables A, B and C; each holding an 8-bit unsigned number. Write an AVR...
2. Given variables A, B and C; each holding an 8-bit unsigned number. Write an AVR assembly program to find the average of A to C, placing the result into variable F. -embedded system-
The vi text editor can be a bit challenging to use at first, but once you...
The vi text editor can be a bit challenging to use at first, but once you have familiarized yourself with how it works you will find it an efficient way to create and edit text files in Linux, and UNIX as well. The key thing to remember is that vi has two operational modes: insert mode and command mode. In insert mode, everything you type is entered into your file. You can use the backspace, delete and the arrow keys....
Create the Parser module in System Verilog to convert the 8-bit Button Board input into four...
Create the Parser module in System Verilog to convert the 8-bit Button Board input into four 4-bit Binary Coded Decimal numbers. The parser should read in an 8-bit Button Board input as an 8-bit number (0-255). Parse that 8-bit number into four 4-bit numbers (0-9) representing its ones, tens, hundreds, and thousands digit.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT