Question

In: Computer Science

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:

  1. GOTO function
  2. BRA function
  3. CALL function

Simulate your program in PIC18 IDE Simulator and attach a screenshot of your simulation while the program is running.

Solutions

Expert Solution


Related Solutions

Using the Python program: a/ Write a program that adds all numbers from 1 to 100...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100 to a list (in order). Then remove the multiples of 3 from the list. Print the remaining values. b/ Write a program that initializes a list with ten random integers from 1 to 100. Then remove the multiples of 3 and 5 from the list. Print the remaining values. Please show your work and explain. Thanks
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in...
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in BSON collection.
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 3      Write a program that pushes the first 10 natural numbers to the stack,...
Task 3      Write a program that pushes the first 10 natural numbers to the stack, then pops those numbers. Use the debugger to view how the stack changes after each instruction. Once all the data has been pushed to the stack, take a screenshot of the stack in memory. Task 4     Write a subroutine called “Area” that calculates the area of a rectangle. Use accumulator A and B to pass the length and the width to the function....
Write a Python program stored in a file q3.py that: Gets single-digit numbers from the user...
Write a Python program stored in a file q3.py that: Gets single-digit numbers from the user on one line (digits are separated by white space) and adds them to a list. The first digit and the last digit should not be a zero. If the user provides an invalid entry, the program should prompt for a new value. Converts every entry in the list to an integer and prints the list. The digits in the list represent a non-negative integer....
1. Write a Java program that prompts the user to enter three integer numbers. Calculate and...
1. Write a Java program that prompts the user to enter three integer numbers. Calculate and print the average of the numbers. 2. Write a Java program that uses a for loop to print the odd numbers from 1 to 20. Print one number per line in the command line window. 3. Write a program which asks the user to input the size of potatoe fries she would like to purchase, and based on the size, it will tell her...
1. Write a program that prints a set of sqaures based on the widths stored in...
1. Write a program that prints a set of sqaures based on the widths stored in an array. Below are the specifications:  Ask the user for the number of sqaures to be printed  Create an array (based on the number of sqaures) to hold the widths  Ask the user for widths and store in the array  Print the sqaures (using any character (e.g. asterisk)) based on the widths stored in the array. (Java language)
There will be 10 numbers stored contiguously in the computer at location x7000 . Write a...
There will be 10 numbers stored contiguously in the computer at location x7000 . Write a complete LC-3 program, starting at location x3000, that will find the location of the smallest number and swap its location with the number in location x7000. For example, Suppose the following numbers are stored at location x7000: x7000 123F                                                                            x7000 0042 x7001 6534                                                                            x7001 6534 x7002 300F                                                                            x7002 300F x7003 4005                after the program is run, memory       x7003 4005 x7004 3F19                would look like----à                         ...
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.
2. Write the hexadecimal numbers in the registers of $a0, $a1, $a2, $a3 after the following...
2. Write the hexadecimal numbers in the registers of $a0, $a1, $a2, $a3 after the following codes running: ori $a0, $0, 11 ori $a1, $0, 19 addi $a1, $a1, -7 slt $t2, $a1, $a0 beq $t2, $0, label addi $a2, $a1, 0 sub $a3, $a1,$a0 j end_1 label: ori $a2, $a0, 0 add $a3, $a1, $a0 end_1: xor $t2, $a1, $a0 *Values in $a0, $a1, $a2, $a3 after the above instructions are executed.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT