Question

In: Computer Science

Write and assemble a program to load values into each of registers R20 – R24 and...

Write and assemble a program to load values into each of registers R20 – R24 and then push each of these registers onto the stack. Single-step the program, and examine the stack and the SP register after the execution of each instruction.

Solutions

Expert Solution

.INCLUDE “M32DEF.INC”

                LDI R20, HIGH(RAMEND)

                OUT SPH, R20

                LDI R20,LOW(RAMEND)

                OUT SPL, R20

                LDI R20, $20

                LDI R21, $31

                LDI R22, $42

                LDI R23, $53

                LDI R24, $64

                PUSH R20

                PUSH R21

                PUSH R22

                PUSH R23

                PUSH R25

L1:        RJMP L1


Related Solutions

For the registers values shown below, what are the values of $t2 & $t3, for the...
For the registers values shown below, what are the values of $t2 & $t3, for the following sequence of instructions? $s0=0xFFFF0011 $s1=0x00002136 sll $t2, $s0, 2 and $t3, $t2, $s1
Write a program to add 10 bytes of data and store the result in registers R30...
Write a program to add 10 bytes of data and store the result in registers R30 and R31. The bytes are stored in the Program memory starting at $200. The data would look as follows: MYDATA: .DB 92,34,84,129,... ;pick your own data.
Task 1 Write a program that adds the three numbers stored in data registers at 0x20,...
Task 1 Write a program that adds the three numbers stored in data registers at 0x20, 0x30, and 0x40 and places the sum in data register at 0x50 task 4 Modify the program in Task1, so the program will run in infinite loop by using these following functions: GOTO function BRA function CALL function Simulate your program in PIC18 IDE Simulator and attach a screenshot of your simulation while the program is running.
[Procedures] Write a main program which sets the registers BX and CX and calls a procedure...
[Procedures] Write a main program which sets the registers BX and CX and calls a procedure Add-Two. The procedure Add-Two adds the values in registers BX and CX and returns the output (which is the sum) in AX. Single step through the program, displaying the value of the stack pointer so that you understand how the call and return are implemented.
4. A firm hires two workers to assemble bicycles. The firm values each bicycle assembled at...
4. A firm hires two workers to assemble bicycles. The firm values each bicycle assembled at $12. Alisha’s marginal cost of allocating effort to the production process is 2N, where N is the number of bicycles assembled per hour. Kyle’s marginal cost is 3N. a) If the firm pays piece rates of $12 per bicycle assembled, what will be each worker’s hourly wage, and how many bikes will they each assemble in an 8-hour day? Alisha’s wage:                                    # bikes assembled...
Write a C program that asks the user to enter double values (the values can be...
Write a C program that asks the user to enter double values (the values can be positive, zero, or negative). After entering the first double value, the program asks "Would you like to enter another value?", and if the user enters Y or y, the program continues to get additional values and stores these values into a double array (for up to 100 values — use a symbolic #define constant to specify the 100 size limit). The program will need...
Write a multithreaded program that calculates various statistical values for a list of numbers. This program...
Write a multithreaded program that calculates various statistical values for a list of numbers. This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value, and the third will determine the minimum value. For example, suppose your program is passed the integers 90 81 78 95 79 72 85 The program will report The...
Programming in C++ Write a program that prints the values in an array and the addresses...
Programming in C++ Write a program that prints the values in an array and the addresses of the array’s elements using four different techniques, as follows: Array index notation using array name Pointer/offset notation using array name Array index notation using a pointer Pointer/offset notation using a pointer Learning Objectives In this assignment, you will: Use functions with array and pointer arguments Use indexing and offset notations to access arrays Requirements Your code must use these eight functions, using these...
In a Java program, how could I write a program that can assign values that would...
In a Java program, how could I write a program that can assign values that would make a rock paper scissors game work? I have a program that will generate a computer response of either rock, paper, or scissors but how can I compare a user input of "rock", "paper", or "scissors" so that we can declare either the user or the computer the winner.
Write a c++ program to load two column of numbers, do arithmetic operations to the data...
Write a c++ program to load two column of numbers, do arithmetic operations to the data points by following the steps below carefully. Also we need to capture the running time in microseconds for each of these and also the time taken for basic operation. Steps to complete. 0. Download the data file named Datafile1.data from the file area of the assignment. 1. Load two columns of data points, each column into a storage area, preferably a vector. 2. Initialize/start...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT