Suppose there were no PUSH instruction. Write a sequence of two other instructions that would accomplish the same as push eax
Write a sequence of two other instructions that would accomplish the same as push eax
Ans:
============================================================================================
ESP is known as stack pointer register. it holds 32 bit offset into some location on the stack. ESP always points to top of thr stack.
first instruction decrement the stack pointer esp by 4.
second instruction copy a value eax into the stack location pointed to by the stack pointer esp.
Suppose there were no PUSH instruction. Write a sequence of two other instructions that would accomplish...
4. The following code fragments show a sequence of virus instructions and a metamorphic version of the virus. Briefly describe the effect produced by the metamorphic code. We were unable to transcribe this imageThe following code fragments show a sequence of virus instructions and a metamorphic version of the virus. Briefly describe the effect produced by the metamorphic code. Original Code Metamorphic Code mov eax, 5 add eax, ebx call (eax] mov eax, 5 push ecx pop ecx add eax,...
Write a sequence of MIPS instructions to do the following: set $t1 to 1 if the contents of $s0 is an even number and set $t1 to 0 otherwise. Please do not use the division instruction in you code. Instead, you could use some logical instruction to test if a number is even or odd.
(e) Suppose we measure the code for the same program from two different compilers and obtain the following data. Assume clock rate is 3GHz, which code sequence will execute faster according to execution time? or According to MIPS? By how much? (25 pts CPI for Instructions Code from Instruction Count (billions) CPI Compiler 1 Compiler 2 9 1 3 (e) Suppose we measure the code for the same program from two different compilers and obtain the following data. Assume clock...
Suppose a computer has 20-bit instructions. The instruction set consists of 32 different operations. All instructions have an opcode and two address fields (allowing for two addresses). The frst of these addresses must be a register, and the second must be memory. Expanding opcodes are not used. The machine has 16 registers. What is the maximum allowable size for memory? o 2 K byte O 14K byte O 11 K byte Next » ous Suppose a computer has 20-bit instructions....
Question 1: Consider two different implementations, M1 and M2, of the same instruction set. There are four classes of instructions (A, B, C, and D) in the instruction set. M1 has a clock rate of 500 MHz while M2’s clock rate is 750 MHz. The average number of cycles for each instruction class of M1 and M2 are shown in the following table: Class CPI for this class on M1 CPI for this class on M2 A 1 2 B...
pls both ans Question 20 5 pts Suppose a computer has 32-bit instructions. The instruction set consists of 64 different operations. All instructions have an opcode and two address fields (allowing for two addresses). The first of these addresses must be a register direct address, and the second must be a memory address. Expanding opcodes are not used. The machine has 16 registers. How many bits can be used for the memory address? Question 21 5 pts Suppose we have...
(d) 7650 (e) None of the above Question 7 [18 Points]-Instruction Set Architecture (ISA) I. Suppose an instruction set has 32-bit instructions. Every instruction has an 8-bit opcode and a 12- bit immediate operand. Some instructions have three register operands (two sources and a destination register). Every instruction that uses registers must be able to specify any of the registers. How many registers can this instruction set support? (a) 32. (b) 64. (c) 16. (d) There is not enough information...
Consider two different implementations of the same instruction set architecture. The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz and CPIs of 2, 4, 3, and 2 and P2 with a clock rate of 3.5 GHz and CPIs of 3, 3, 2, and 3. a. Given a program with a dynamic instruction count of 1.0E8 instructions divided into classes as follows: 30% class...
Question 20 5 pts Suppose a computer has 32-bit instructions. The instruction set consists of 64 different operations. All instructions have an opcode and two address fields (allowing for two addresses). The first of these addresses must be a register direct address, and the second must be a memory address. Expanding opcodes are not used. The machine has 16 registers. What's the size of the largest memory space that can be addressed by this computer?Assume byte addressable memory.
1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between the instructions above by drawing arrows between dependent instructions (only show true/data dependencies). a. Assuming forwarding support, in what cycle would the store instruction write back to memory? Show the cycle by cycle execution of the instructions as they execute in the pipeline. Also, show any stalls...