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...
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!
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...
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 happens in the memory after the execution of the following C# code? Draw it in...
What happens in the memory after the execution of the following C# code? Draw it in the stack-heap diagram below. [5 pts] int[] myArray = {32, 99, -18, 0, 142, 71} myArray[4] = -26; myArray[3] = myArray[2];
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;
Python Design a class named IP_address to represent IP address objects. The IP_address class contains the...
Python Design a class named IP_address to represent IP address objects. The IP_address class contains the following A number of instance variables/fields to store a table of data. You can design them by your own. A constructor that creates a table with the following: a list of data. ip address a integer to indicate the number of elements in the sum_list/freq_list/average_list A get_ip_address() method that returns the ip address For example, consider the following code fragment: ip_key = '192.168.0.24' data_list...
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?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT