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

Recently Asked assembly programming Questions

Expert help when you need it
  • Q1:Instructions translate the "cppFunction" into "asmFunction" and enter your assembler code in "AssemblerFunction.asm", do not change the Main.cpp. You can use the newest Visual Studio project, then you upload the whole project, but you still cannot change the Main.cpp file. This is an easy Leetcode problem (#121), without any complicated data structures, so it should not be a problem. Everything is set up; you only enter the assembler code.See Answer
  • Q2:translate the "cppFunction" into "asmFunction" and enter your assembler code in "AssemblerFunction.asm", do not change the Main.cpp. You can use the newest Visual Studio project, then you upload the whole project, but you still cannot change the Main.cpp file. This is an easy Leetcode problem (#121), without any complicated data structures, so it should not be a problem. Everything is set up; you only enter the assembler code.See Answer
  • Q3:Task 6.1: Comparing strings In this exercise, you will consider comparing strings. 1. The following C code implements the strcmp function (http://linux which. net/man/3/strcmp). Explain how the function works! 1 int stremp(char *a, char *b) { 2 while (*a *b) ( 3 if ("a 4 5 6 8 return 0; return a "b; 2. Translate this C code into MIPS Assembler. Comment on your assembler- Code. When commenting, note that the relationship between C- Code and MIPS assembler is clearly displayed. Remember, all use- to cache these registers on the stack! 5 Points 10 PointsSee Answer
  • Q4:Task 6.2: Pipeline Simulate the flow of the following code if it passes through a pipeline as in the The lecture is on! To do this, expand the diagram below, which indicates which Stage each command in which beat goes through: The pipeline consists (as discussed in the lecture) of the 5 stages of Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MA) and Write Back (WB), Values calculated in the EX phase are only calculated at the end of the WB phase written back to the register. When a subsequent command is in its EX-phase this value is required for the calculation, the pipeline must therefore be delayed for so long (stalled) until the corresponding value has been written back to the register. Also Iw and sw can only start execution when all source registers for Are available. As can be seen in the diagram, register r2 is set to clock 6 (WB of the second command) written back. Since the add command requires this register, the pipeline must be be delayed for a long time until r2 is available for execution (EX) in clock 7. In contrast to the lecture, it is assumed here that a written register value is only available for reading in the next bar. 1 lw r1.0x1000 (ro) 2 lw r2.0x1004 (ro) 3 add r3, rl, r2 4 sub r4, rl, r2 5 sw r4, 0x100c (ro) 6 sw r3.0x1008 (ro) 7 addi r5, ro, 0x10 8 sub r6, r0, r5 9 sw r5, 0x2000 (1) 10 sw r6.0x2000 (2) 1. Expand the diagram by the required delay! 2. How many cycles does the pipeline have to be delayed for? 3. What acceleration was achieved with the pipeline for this code? Go You assume that 200 hp are required for one cycle with pipelining. Without Pipelining takes one cycle and thus an instruction of 800 hp. 4. Rearrange the instructions so that when processing in the pipeline no delays are needed! The semantics of the program should be stay the same! This means in concrete terms. At the end of the execution, the registers should contain the same values and the same values should be written to the memory have been. What acceleration is being achieved now? 6 Points 1 Point 2 Points 6 PointsSee Answer
  • Q5:Submit your assembly language source code (.asm file) and screen shots that display your program's successful execution (the output screen). Do not submit screenshots of your code./nCOSC 2425 - Project 3 Write an assembly language program that asks the user to enter an integer dollar amount between 1 and 3,000. Your program should display the corresponding class description using the following table. Donation Amount (dollars) $2,000 and above $1,500 to $1,999 $1,000 to $1,499 $500 to $999 $1 to $499 Class of Donation Platinum Gold Silver Bronze Brass Write the program so that it executes (loops!) until the user inputs some value that you determine to be the "sentinel value". Your program must guard against and provide user messages for input values that are outside the valid range.See Answer
  • Q6:You are asked to implement a MIPS procedure named string_insert. The procedure will take two null-terminated ASCII strings: strl and str2 and an integer position value pos as input parameters. When invoked, the string_insert procedure will insert a copy of str2 into str1 right before the index location indicated by pos. For example, if str1 contains the string "ABCDEFG" and str2 contains "123", then a procedure call string_insert with the pos parameter value of 5 would update str1 into "ABCDE123FG"; since the letter F had the index location of 5. If the pos value exceeds the lengths of str1, then str2 should be concatenated at the end of str1. Of the pos value equals to 0; then str2 will be prepended to str1. The string_insert procedure will not return any value. Furthermore, you also need to implement a second MIPS procedure named strlen. Like the C library function of the same name, strlen will take a string as input parameter, and return the number of characters in that string, excluding the null character. The return value of strlen will be available at the $v0 register for the caller procedure to read. You should try to implement strlen first, and then focus on string_insert because the implementation of substring_count can be greatly simplified when it can invoke the strlen procedure. The main function of the program is given in the following. You may define any additional number of helper procedures as necessary. However, the data segment as well as the body of the main function should be used exactly as given. If you need space to temporarily hold bulks of data, you can and should utilize the stack segment of the process./n.data #Static arrays used to store the two string inputs stri: .space 200 # reserve a 200-byte memory block str2: .space 200 # reserve a 200-byte memory block #String literals printstri: asciiz "Enter the first string: printstr2: .asciiz "Enter the second substring: " printstr3: .asciiz "Enter the insertion position: printstr4: .asciiz "After insertion, updated first string is: " -text .globl main main: 11, $v0, 4 #to print prompt #1 la $a0, printstri syscall li, $v0, 8 #input the first string la $a0, stri li $al, 200 syscall 11, $v0, 4 #print prompt #2 la $a0, printstr2 syscall li, $v0, 8 #input the second string la $a0, str2 li $al, 200 syscall 11, $v0, 4 #to print prompt #3 la $a0, printstr3 syscall " li, $v0, 5 #input the position value (integer) syscall #pos stored in $v0 la $a0, stri la Sal, str2 add $a2, $0, SVO jal string_insert #load the address of strl to $a0 #load the address of substri to Sal #load the position value to $a2¹ #procedure call from main/n11, $v0, 4 la $a0, printstr4 syscall la $a0, strl syscall 11, $v0, 10 syscall string_insert: #print string mode #Literal part of Output #load address of strl for output #clean exit #definition of string_insert goes below # Any additional function definition (s), including strlren To get full credit for your work, your MIPS code must be sufficiently documented with single- line comments explaining the purpose of the key parts of the program. Save your MIPS program in a single plaintext file and submit it to Moodle. Good Luck!See Answer
  • Q7:1. (15 pts) Convert the following numbers to binary numbers (List calculation steps) a. Oxefcdab b. 205 c. 121See Answer
  • Q8:2. (15 pts) Convert the following numbers to hexadecimal numbers (List calculation steps) a. 0101 0011 1011 1111 b. 243 c. 155See Answer
  • Q9:3. (15 pts) Convert the following numbers to decimal numbers (List calculation steps). a. 1100 1011 b. 0x77 c. OxffSee Answer
  • Q10:4. (14 pts) Assume a 32-bit integer Oxabcd1234 is stored between memory address Ox2000 and 0x2003. A. What is the Least Significant Byte (LSB) in the integer? B. What is the Most Significant Byte (MSB) in the integer? C. With little endian format, what are the values at Ox2000 to 0x2003, respectively? D. With big endian format, what are the values at Ox2000 to 0x2003, respectively?See Answer
  • Q11:5. (9 pts) An Integer has been stored in the following memory space within a little-endian computer. 0x100 0x101 0x102 0x103 12 CD EF 90 A. Which address stores the most significant byte? B. Which address stores the least significant byte? C. What's the integer value in hex format?See Answer
  • Q12:6. (8 pts) How many bits does each of the following register have? A. al B. rcx C. ax D. eaxSee Answer
  • Q13:7. (8 pts) What are the four components of a computer in the Von Neumann Architecture?See Answer
  • Q14:8. (8 pts) Registers A. Which register points to the next instruction to be executed? B. Which register points to the current top of the stack? C. Which register is as a base pointer during function calls? D. Which register is used for status and CPU control information?See Answer
  • Q15:9. (8 pts) If the rax register is set to Ox9ABCDEF012345678, what are the contents of the following registers in hex? A. al B. ax C. eax D. raxSee Answer
  • Q16:Objective Write an ARM program that takes two integers as input, x and y, and calculates x*y using only addition. Convert the following C code into ARM: int main() { int x, y, result=0; //read x printf("Please enter x: "); scanf("%d", &Xx); //read y printf("Please enter y: "); scanf("%d", &y); if (y<0) { } x=0-X; y=0-y;/nif (y<0) { } x=0-X; y=0-y; for (int counter=0; counterSee Answer
  • Q17:Your assignment is to replace the portion in HA4-main.s that is within hyphened comments (i.e. everything between lines 40 and 64) by a mainline program. Your program will compute: 1+2+3+4+5+........ ....+n. You could prompt the user for n and display the sum. You might want to use Gauss formula: n(n+1)/2. Create your own sensible prompts and output messages. An example execution of your program could be: Please enter the number of terms in your series: 20 The sum of your series is 210.See Answer
  • Q18:Word process all answers. Show work for partial credit. 1. Answer the following questions regarding the Intel x86 instruction set (refer to the figure on slide 3 of the chapter 5 power point notes). a. Assume the x86 architecture can fetch 32 bits per cycle and the x64 architecture can fetch 64 bits per cycle. In the best case, how many instructions can be fetched per cycle in the x86 and how many instructions can be fetched per cycle in the x64? In the worst case, how many cycles might it take the x86 to fetch one instruction and how many cycles might it take the x64 to fetch one instruction? Best case means the shortest possible instruction length and worst case means the longest possible instruction length. b. What is the largest immediate datum available (not in bits but the largest value)? Remember that the immediate datum is in two's complement. c. How many registers are available to be used as index registers? d. What is the maximum number of opcodes that could be accommodated in an instruction (this is not the actual number, but the maximum that could be used)? The actual number varies by generation with the original x86 having only 81 but later variations had as many as 981.See Answer
  • Q19:2. We decide to change MARIE from an accumulator-based CPU to a general-purpose register set CPU. Instead of the AC being used as the default register, we specify a register in the instruction. The new instruction format is: opcode register operand. For instance, Add R1, X means R1 = R1 + X instead of AC = AC + X. We decide to provide MARIE with 4 registers (R0-R3). Answer the following. a. If we want to leave the instruction length at 16 bits, what will change: the number of bits for the op code or for the operand? And how many bits will that portion become? b. We decide instead to lengthen the instruction to accommodate the register specifier. How many bits long is the new instruction? c. With a longer instruction, we have to widen memory from 4Kx16 to 4KxY where Y is your answer in part b. Aside from widening memory, what else needs to be widened?See Answer
  • Q20:3. We add 14 new operations to MARIE. This will require a larger op code. We decide, as we do not want to lengthen instructions to prevent the changes you [should have] discussed in 2c, we reduce memory size. Answer the following. a. How many bits would an address have to now be? b. What would be the maximum addressable memory size? c. What hardware changes would we have to make to accommodate the changes from parts a and b of this question?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.