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,...
1) Implement MOVSX: Write a sequence of shift instructions that cause AX to be sign-extended into EAX. In other words, the sign bit of AX is copied into the upper 16 bits of EAX. example: 8000h in AX results in 0FFFF8000h in EAX 7000h in AX results in 00007000h in EAX
Assembly lang multiple choice Suppose we have the following pseudo-instruction in our program: push {r0, r2, r4} ..... Which of the following instructions would be the appropriate instruction to use when cleaning up the stack space used by the three register values that were pushed onto the stack? Group of answer choices sub sp, #12 add sp, #12 add lr, #12 2) Suppose we are comparing registers R1 and R2 and we want to branch if equal to the label...
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.
2) Implement ROR: Suppose the instruction set contained no rotate instructions. Show how you would use SHR and a conditional jump instruction to rotate the contents of the AL register 1 bit to the right. example: 10000000b in AL becomes 01000000b 10000001b in AL becomes 11000000b
(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...