tutorbin

assembly programming homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched assembly programming homework help

tutorbin

Trusted by 1.1 M+ Happy Students

WhatsApp Support

Get Instant
Online Homework Help
via WhatsApp

Get instant homework help from top tutors—just a WhatsApp message away. 24/7 hw help support for all your academic needs!

A
S
M
R
★★★★★
2M+ students trust TutorBin
Your WhatsApp Number
phone
or
⚡ Instant reply
🔒 100% private
👨‍🏫 Top tutors
🌍 All subjects
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!
2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee

Recently Asked assembly programming Questions

Expert help when you need it
  • Q1:4. You are given a partial E20 assembly language program containing only the following: beginning: end: .fill 3 . fill 1 fill O .fill 9 fill 5 .fill 7 . fill 1 fill 4 That is, your program's data consists of an array of numbers between addresses beginning (inclusive) and end (exclusive). z T Complete the program so that it reverses the contents of the array in place. In other words, when the program ends, the value at memory address beginning will be 4; the value at memory address beginning+1 will be 1; the value at beginning+2 will be 7; the value at memory address end-1 will be 3; etc. You must implement your program using a loop. Your program should work with an array of any length. You may not assume that the length or content of the array is the same as given above. The only thing you know about the array is that it is bound by labels beginning and end. When using jump instructions, specify the destination as a label, not as a numeric address. Hint: use paired 1w and sw to copy a memory value from one address to another.See Answer
  • Q2:Question 5 Given the following structs, how many bytes would a single A take up? Answer in decimal only. struct A { char* str1; char ch; int i, j; Ba, b, c; }; struct B{ }; A✶a; Blank 1 Blank 1 Add your answer 1 PointSee Answer
  • Q3:Question 4 1 Point Given the struct definition for Inode shown below, and the memory containing one instance of Inode, answer the question below .Struct: struct Inode{ char *str; char first; int size; struct Inode *next; }; Memory: 0x555555756b80: 0x0000555555756ba0 0x0000000900000074 0x555555756b90: 0x0000555555756b40 0x0000000000000021 0x555555756ba0: 0x74617265706d6574 0x0000000000000065 0x555555756bb0: 0x0000000000000000 0x0000000000000021 What is the address where the variable size is stored? Give your answer either in hexadecimal or binary, accounting for all 64 bits. Blank 1 Blank 1 Add your answerSee Answer
  • Q4:Question 1 1 Point Given the following struct definitions, how many bytes are needed to store the variable x x;? Give your answer in decimal only. struct X { char c; YY. } struct Y { float a [5] [3]; float* b [4] [2]; }; Blank 1 Blank 1 Add your answerSee Answer
  • Q5: CS 341, Spring 2024 Homework 5 Overview In this homework assignment, you are going to write five functions in F#. The code containing your five functions must be in a file named: hw05.fs. The code is to be called from the F# code in a file named: main.fs. The file "main.fs" will act as the testing code that will contain all of the code needed to verify correct execution of the functions in the file "hw05.fs". The initial code in "main.fs” only has one test case included. You are expected to create additional test cases in "main.fs" to verify the functionality of your functions in "hw05.fs”. Note that the version of “main.fs” that is part of the autograder code is fairly long and contains quite a number of test cases. The test cases for the autograder will not be released. You are encouraged to be very thorough when creating your own test cases. The five functions that are to be written for this assignment are described below. Make sure you follow the directions specified in the comments for each function regarding the function's parameter(s), return value, implementation details, and helper functions. Some of the functions may expect you to create helper functions to make sure they run properly. Exercise #1 - countBetween TR (tail recursive) // // countBetweenTR A BL // // Given a list L of integers, counts A < x < B x in L. // // Example: countBetweenTR 20 60 [20; 90; 50; 60; 45] => 2 // // NOTE: write a tail-recursive version using a helper function; // do not change the API of the original countBetween TR function. // Exercise #2 - countBetween HO (higher-order approach) // // countBetweenHO A B L // // Given a list L of integers, counts A < x < B: x in L. // // Example: countBetweenHO 20 60 [20; 90; 50; 60; 45] => 2 // // NOTE: write this using a higher-order approach, in // particular using List.map and List.sum, or List.filter // and List.length. Do not use other List functions. // Exercise #3 - highestExamAverage // // highestExamAverage LT // // Given a list of tuples of the form ("netid", [score; score;...]), // computes each netid's average score as a real number and // returns the netid of the student with the highest // exam average. If more than one student has the same highest // exam average, then return the netid of the first student in the // list. // // Example: // highestExamAverage [("sdeitz2", [100; 90;91]); ("psankar", [100;100])] // // => "psankar" // NOTE: F# offers a function List.average L that computes the // average of a list of real numbers. However, the list of // scores in the tuple are integers, so in order to use // List. average, you would first need to convert the integers to // reals List.map float L would work nicely here. // --- // You can solve using recursion, or higher-order, or both; // tail recursion is not necessary. // Exercise #4 - subset // // subset SL // // Returns true if S is a subset of L, false if not. // // Examples: subset [3; 1; 2] [1; 4; 2; 0; 3] => yes // // subset [2; 1; 3] [1; 4; 0; subset [] [] 2; 8] => no => yes // subset [] [1; 2; 3] => yes // subset [1..1000] [1..1000] => yes // // NOTE: you can solve using tail-recursion, or using a // higher-order approach. Whatever you prefer. Beware // that List.length is an O(N) operation, since it // traverses the entire list and counts the elements. // // HINT: there are a variety of solutions. One idea // is write a helper function "contains e L" that // returns true if e is an element of L, and false // if not. Then build on that to define subset. This // leads to an O(N^2) solution, which is fine. // Exercise #5 – pairwise // // pairwise L1 L2 // // Given 2 lists L1 and L2, both the same length, // merges the corresponding elements into pairs, // returning a list of pairs. // // Example: // pairwise [1;3;5;7] [10;20;30;40] // => [(1,10); (3,20); (5,30); (7,40)] // // You must solve using recursion; tail recursion is not necessary. // Note: there is a F# library function named zip that // does this operation. // You may not use that function in your solution. // Requirements In order to earn full points for this homework assignment, your code must meet the following requirements: • No variables (i.e. no use of the keyword mutable). • No loops. Instead, use recursion or higher-order functions, e.g. List.map, List.iter, etc. You must use recursion or higher-order programming as noted in the header comments for each of the functions. Failure to use the proper approach for each exercise will result in deduction of points after the assignment deadline. Proper tail recursion is quite specific. Double check that any solutions you come up with really do use tail recursion. In previous semesters, many students submitted assignments that did in fact NOT implement proper tail recursion. Submission Login to Gradescope.com and look for the assignment "Homework 05". Submit your F# program file “hw05.fs". You have unlimited submissions. Keep in mind we grade your last submission unless you select an earlier submission for grading. If you do choose to activate an earlier submission, you must do so before the deadline. Add your name to the header comment and comment any functions you write! No late submissions will be accepted for this assignment. Academic Integrity All work is to be done individually - group work is not allowed. While we encourage you to talk to your peers and learn from them, this interaction must be superficial with regards to all work submitted for grading. This means you cannot work in teams, you cannot work side-by-side, you cannot submit someone else's work (partial or complete) as your own, etc. The University's policy is available here: https://dos.uic.edu/community-standards/ In particular, note that you are guilty of academic dishonesty if you extend or receive any kind of unauthorized assistance. Absolutely no transfer of program code between students is permitted (paper or electronic), and you may not solicit code from family, friends, or online forums (e.g. you cannot download answers from Chegg). Other examples of academic dishonesty include emailing your program to another student, sharing your screen so that another student may copy your work, copying-pasting code from the internet, working together in a group, and allowing a tutor, TA, or another individual to write an answer for you. Academic dishonesty is unacceptable, and penalties range from a letter grade drop to expulsion from the university; cases are handled via the official student conduct process described at the link above.See Answer
  • Q6:3. Use CPUlator to write a simple code for each of the following instructions. A is the first 2 digits of your student ID (SIS ID) as decimal number and B is the last 2 digits of your ID. For example, if your ID is 123456789, A-12 and B-89. (a) Store 8-bit values A and B to locations 0x20000010 and 0x20000011, respectively. (b) Store the 8-bit value B to the location of 0x20000020. (c) Load a word value to register R2 from the location of Ox20000020. Take a screenshot of the values at those locations in the memory after the program executes. What's the content of R2? (10 pt)See Answer
  • Q7:2. Use CPUlator to write a simple code to store values 0x10102265 and 0x23456789 into locations 0x20000030 and 0x20000038, Take a screenshot of the values at those locations in the memory. Add the values together and place the result in register R9. What's the content of R9? (10 pt)See Answer
  • Q8:CPSC 3300-Assembly Language Homework 2 (35 points) Cpulator. Olxz.net/sys-arm-de1soc Use CPUlator to write a simple code to store values 0x30 and Ox97 into locations 0x20000000 and 0x20000004. Take a screenshot of the values at those locations in the memory after the program executes. (10 pt) vse A-90, B = 54 2. Use CRUlatos to Ou 10109265 and Ox23456790 intoSee Answer
  • Q9: CPSC 3300-Assembly Language Homework 4 (55 points) 1. Write an assembly program that calculates y. Assume register RO holds integer x and register R1 saves the result. (5 pt) -1 ifx<0 y 0 if x=0 1 if x > 0 2. Write an assembly program that calculates the following. Assume the integer input x is stored in register RO and the result is saved in register R1. (10 pt) 9x if x <= 10 y 8x if x 10 and x <= 100 7x if x 100 and x <= 1000 6x if x 1000 3. Write a code which adds all even numbers from 0 to 1000 and stores the sum in the memory location of 0x10002010. Take a screenshot of the content in memory location 0x10002010. (10 pt) 4. Write a code which calculates the factorial of a number 11 (or 11!) and stores in the memory location of 0x10002020. Take a screenshot of the content in memory location 0x10002020. (10 pt) 5. Write ARM code to implement the following C++/JAVA operation. (10 pt) int s = 0; for (int i = 0; i < 10; i++) s = s + i * i; Store the result (value of s) in memory location 0x10002030. Take a screenshot of the content in memory location 0x10002030. 6. Translate the following C++/Java code to ARM assembly code. Store the result (value of s) in memory location 0x10002040. Take a screenshot of the content in memory location 0x10002040. (10 pt) int s = = 0; for (int i = 0; i < 5; i++) for (int j = 0; j < 5; j++) s = s + i *j;See Answer
  • Q10: Lab 8 - HCS12 Assembly & C Programming Objectives: • Practice HCS12 assembly subroutines • Practice C programming Introduction: In this lab, students will have hands-on practice creating subroutines in the HCS12 assembly. They will practice the different ways of passing the input parameters and returning values to/from the subroutine. In addition, students will practice calling a subroutine from another subroutine and practicing writing C code. Task 1 Write an assembly subroutine that calculates the average value of an array of 16-bit integers, equivalent to the C code below. Use registers to pass the function arguments to the subroutine. ° for the array pointer, use register X ° for the size of the array, use register B ° for the return value, use register D int average( int *array, int size ) { int sum = 0; for(int i = 0; i<size; i++ ) { sum = } } array[i]; return sum / size; Task 2 Repeat task 1 to pass the input parameters and return values through the stack. Draw your stack frame. Task3 Repeat task 1 to pass the input parameters and return values through global memory. Task 4 Implement the following C functions in HCS12 assembly. The size of each array (array1, array2, and result) should be 10 elements. The parameters of the "equation” function should be passed using the stack. Use the stack to pass all arguments to the subroutine. Call the equation subroutine from the main. Note that you need to write two subroutines. void equation ( int *arrayl, int *array2, int result, int size ) { for(int i = 0; i < size; i++ ) { result[i] = add (arrayl[i], array2[i]); } } Int add (int m, int n) { Return m+n; } The parameters to the add function are passed through the stack and the return value is returned through the stack as well. Note: The equation subroutine does not have a return value for this subroutine, instead the subroutine stores the result elements directly in memory. Task 5 Write a C program that reads two arrays, adds each element from one array to the element from the other array, and stores the result in a third array. If the addition result is less than 50 then multiply it by 3. Lab Report Lab reports are INDIVIDUAL. Your report should contain: • The assembly code for each task For each subroutine, draw a picture of the stack. Show the location of each subroutine argument, the return address, the return value, and any local variables. Draw a flowchart for task1, task4, and task5. Take a screenshot of the stack for all tasks. Take a screenshot of the Result arrays in memory, where applicable. Also, draw a flowchart and stack diagram for your program.See Answer
  • Q11:3. Write an ARM program that reads a string from the UART and writes that string back to the UART until the Enter key is encountered. Do not use any memory. Hint: the Enter key returns the hex value 0x0A. (10 pt)See Answer
  • Q12:2. Write an ARM program that displays 0 - 9 on the right-most seven-segment with a one second time delay. (10 pt)See Answer
  • Q13:1. Write an ARM program that keeps blinking the left-most and the right-most LEDs in a one second interval. (10 pt)See Answer
  • Q14:4. Write an ARM program that implements the following recursive function that calculates the n-th number in the Tribonacci sequence. Test the program by passing 10 to x. The result of tribonacci should be stored in register RO. Take a screenshot of the content in R0 after the program executes. (10 pt) int tribonacci (int n) { if (n == 1) return 1; else if (n == 2) return 1; else if (n == 3) else return 2; } return tribonacci(n - 1) + tribonacci(n-2) tribonacci (n = 3); +See Answer
  • Q15:3. Write an ARM program that implements the following recursive function that calculates the power of a number. Test the program by passing 2 to x and 10 to y. The result of pow should be stored in register R0. Take a screenshot of the content in RO after the program executes. (10 pt) int pow (int x, int y) { if (y == = 0) else return 1; return x * pow(x, y - 1); }See Answer
  • Q16:2. Write an ARM program that implements the following recursive function that calculates the sum of all integers from 1 to a given number. Test the program by passing 10 to x. The result of sum should be stored in register R0. Take a screenshot of the content in RO after the program executes. (10 pt) int sum (int x) { if (x == 1) else return 1; } return x + sum (x - 1);See Answer
  • Q17:1. Write an ARM program that implements the following functions. Your code should include two subroutines (mult and sumSquare with a nested call to mult). Test the program by passing 10 to x and 5 to y. The result of sumSquare should be stored in register R0. Take a screenshot of the content in RO after the program executes. (10 pt) int sumSquare (int x, int y) { return mult (x, x) + y;B } int mult (int x) { return x * x; }See Answer
  • Q18: AENG/ECE-505 Winter 2024 HW3-2 Let us assume the program has been successfully built, and you run the program step by step. #define MAX_STR_LEN 2 #define MAX_INT_LEN 5 2 1. Pointer 123 +56 1 ∞ int main(void) = "dead"; { char str[MAX_STR_LEN] char *pstr1, *pstr2; int arr[MAX_INT_LEN]; int *parr, *parr_start; int i; pstr1 pstr2 0 1 2 9 10 11 12 13 = 14 = str; &str[0]; 15 /* --- */ 16 17 = 'A'; 18 19 /* --- * 20 21 /* 22 23 for (i = 24 *(pstr1 + 2) pstr2++; *(pstr2 + 2) = 'D'; */ 0; i < MAX_INT_LEN; i++) { arr[i] = i+100; 25 } 26 /* --- 27 28 29 /* --- 30 31 i+200; 32 } 33 parr = parr_start = arr; */ for (i = 0; i < MAX_INT_LEN; i++) { *parr++ = parr = parr_start; 34 /* --- */ 35 36 return 0; 37 } AENG/ECE-505 Winter 2024 This is the memory block. Fill out the blank step by step as you go through the questions. If the block is not yet initialized at the specified line number, fill it with the '?' mark. Note that you must execute the program in CCS to identify the memory location. Memory Location Content (32-Bit Hex) Line 15 Line 19 Line 21 Line 26 Line 29 Line 34 0x200001E0 0x200001E4 0x200001E8 0x200001EC 0x200001FO 0x200001F4 0x200001F8 0x200001FC 0x20000200 1. When you reach Line 15, what values are filled? If its value is not initialized yet, use the '?' mark. Don't forget to fill the memory block as well Variable Туре Name Value Location arr parr str AENG/ECE-505 Winter 2024 pstr1 pstr2 2. Is pstr1 same or different with pstr2? Explain why it is so. 3. When you reach Line 19, what is the pstr2 value? 4. When you reach Line 21, what would be the value from the C code below? Explain why it is so. * (pstr1 + 3) 5. When you reach Line 26, what values are at the arr array? 6. When you reach Line 29, what would be the value from the C code below? Explain why it is so. *(parr + 2) 7. When you reach Line 34, what would be the value from the C code below? Explain why it is so. *(parr +1) 2. Call by Reference vs. Value - You would like to implement a C function that swaps two values. AENG/ECE-505 Winter 2024 1 2 3 4 5 6 void swap_call_by_value(int foo, int bar) { int temp = foo; foo = bar; 9 } bar = temp; void swap_call_by_reference (/* add your code here */) /* add your code here */ 10 { 11 12 13 14 15 16 } 17 18 19 { 20 21 22 23 /* */ 24 int main(void) int aaa = 10, bbb = 20; swap_call_by_value(aaa, bbb); swap_call_by_reference(&aaa, &bbb); 56900 222 25 /* */ 26 27 return 0; 28 } 1. Complete the swap_call_by_reference function. After the successful completion, let's assume that you run the program step-by-step using the debugger. 2. When you reach Line 23, what are the values of aaa and bbb? Explain why they are so. 3. When you reach 25, what are the values of aaa and bbb? Explain why they are so.See Answer
  • Q19:6. A word consists of the bytes b4, b3, b2 and bl. Write a simple code to invert the bits of b3 and clear the bits of b2 in register R0. All other bits should be left unchanged. You may assign any value to RO. (5 pt)See Answer
  • Q20:5. This is a classic problem of assembly language programming. Write a simple code that swaps the contents of registers RO and R1 without using any additional registers or memory storage (that is, you can't move R0 or R1 to a temporary location). You may assign any value to RO and R1. Hint: consider using the exclusive OR operation. (5 pt)See Answer

TutorBin Testimonials

I found TutorBin Assembly Programming homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Assembly Programming subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Assembly Programming assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Assembly Programming homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.