Question

What happens to the value of IP each time an instruction is executed In the previous...

What happens to the value of IP each time an instruction is executed

In the previous question, assume that the instruction is 2 bytes, what happens for IP after the instruction execution?

Homework Answers

Answer #1

1)Instruction Pointer(IP) is the 16 bit register. It holds the offset of the next instruction to be executed in the code segment.

The logical address of the instruction consists of CS(code segments) and IP(instruction pointer).

The instructions are stored in the byte aligned fashion in memory and IP holds the pointer to the instruction. So each time an instruction is executed in byte sized memory, the value of offset in IP register is incremented by one.

Instruction Pointer(IP) is incremented by 1 after every instruction byte is executed. IP->IP + 1

Value of IP will be incremented by 1 each time an instruction is executed.

2) If the instruction is 2 bytes, then value of Offset in IP register will be incremented by 2 .

Instruction pointer IP is incremented once for each byte so for size of two bytes of instruction the Instruction Pointer (IP) will be incremented by 2 that is  IP-> IP + 2

Value of IP will be incremented by 2 for instruction of size 2 bytes.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
(Pipelining) Given 3 different instruction types, A, B and C. Each type-A, B, and C instruction...
(Pipelining) Given 3 different instruction types, A, B and C. Each type-A, B, and C instruction takes 40ns, 25ns and 50ns to complete, respectively. An assembly program is written with 30 type-A, 40 type-B and 20 type-C instructions. (a). Assume a single-issue not pipelined processor, how much time (in nano-seconds) is required to complete the execution of this program? (10pts) (b). Now let us pipeline these instructions based on a cycle time of 10ns. To pipeline these instructions equally and...
I. What value will be in register r2 after execution of the following instructions? Show your...
I. What value will be in register r2 after execution of the following instructions? Show your work with the register values after executing each instruction. MOV r2, #0x0 LDR r1, =0xCF MOVS r1, r1, LSR #1 ADC r2, r2, #0 MOVS r1, r1, LSR #1 ADC r2, r2, #0 II. Assume a 32 bit register holds a data of four bytes as B3B2B1B0. Write a sequence of ARM instruction that takes this data as input and swaps the bytes 0...
Assume the current value in the PC to be x401A. Write BR instruction to unconditionally branch...
Assume the current value in the PC to be x401A. Write BR instruction to unconditionally branch to the instruction located at an offset of x0EF. What will the PC point to after the BR statement in (a) is executed? Show the hexadecimal representation. If unconditional branching is possible using BR, why do we need the JMP instruction? DO NOT COPY ANSWERS!
If each of the data set is increased by 10% what happens to the value of...
If each of the data set is increased by 10% what happens to the value of the: 1. Mean 2. Mean deviation 3. Standard deviation
What is the value of n and counter when the code below is executed? n =...
What is the value of n and counter when the code below is executed? n = 256; counter = 1; while n ~= 1 if rem(counter,2) == 0 n = n/2; else n = n/4; end counter = counter + 1 ; end a. n=1; counter = 6 b. n=5; counter = 6; c. n=6; counter = 256; d. n=256 counter = 6 e. n=128; counter=64;
What is the value of n and counter when the code below is executed? n =...
What is the value of n and counter when the code below is executed? n = 256; counter = 1; while n ~= 1 if rem(counter,2) == 0 n = n/2; else n = n/4; end counter = counter + 1 ; end a. n=1; counter = 6 b. n=5; counter = 6; c. n=6; counter = 256; d. n=256 counter = 6 e. n=128; counter=64;
What is the value of n and counter when the code below is executed? n =...
What is the value of n and counter when the code below is executed? n = 256; counter = 1; while n ~= 1 if rem(counter,2) == 0 n = n/2; else n = n/4; end counter = counter + 1 ; end a. n=1; counter = 6 b. n=5; counter = 6; c. n=6; counter = 256; d. n=256 counter = 6 e. n=128; counter=64;
1) What is the meaning of the time value of money? 2) How are compounding and...
1) What is the meaning of the time value of money? 2) How are compounding and discounting related? 3) What happens to the future value of a lump sum invested the longer the time period for which it will be invested?
What happens to the acceleration of a ball after it is thrown upward into the air?...
What happens to the acceleration of a ball after it is thrown upward into the air? (Neglect air resistance.) Question 8 options: increases and then decreases increases decreases remains the same decreases and then increases If a car is traveling eastward and slowing down, what is the direction of the force on the car that causes it to slow down? Question 9 options: eastward neither eastward nor westward westward What happens to the speed of a ball after it is...
Consider the following code segment, where the branch is taken 30% of the time and not-taken...
Consider the following code segment, where the branch is taken 30% of the time and not-taken 70% of the time. R1 = R2 + R3 R4 = R5 + R6 R7 = R8 + R9 if R10 = 0, branch to linex R11 = R12 + R13 R14 = R11 + R15 R16 = R14 + R17 ... linex: R18 = R19 + R20 R21 = R18 + R22 R23 = R18 + R21 ... Consider a 10-stage in-order processor,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT