Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

0100H. 6. The following is the list of memory contents in an Intel system when C

ID: 2249508 • Letter: 0

Question

0100H. 6. The following is the list of memory contents in an Intel system when CS-1000H andI Contents 01 10 EA Address 20134 20133 20132 20131 20130 FO 20129EB (Short jump) 20128 20127 20126 20125 20124 20123 20 EB (Short jump) 02 E9 (Near jump) 20 01 10104 10103 10102 10101 10100 23 (a) What are the values of CS and IP after the execution of the first instruction? (b) What are the values of CS and IP after the execution of the second instruction? (e) What are the values of CS and IP after the execution of the third instruction?

Explanation / Answer

Answer:-a) Initial CS and IP values gives the present instruction location as (1000*10) + 0100 = 10100H, so instruction at memory location 10100H will execute. As code here is a far jump and the address where to jump is given in next four location i.e from 101001 to 101004, is (2000*10) + 0123 = 20123H. Thus after first instruction CS = 2000H and IP = 0123H.
(NOTE:- In Intel processors effective address = (segment address x 10) + offset. Also 'H' denotes hexa-decimal, so addition and multiplication should be done as per hex-adecimal rules.)

b) Now processor is at address 20123H and here instruction is a near jump instruction. For near jump instruction next two byte i.e 16-bits are the offset value that must be added with next instruction address, to find the jump location. So we are at 20123H, next is 20124H and 16-bit offset is 0002H, so the address where to jump is 20124H + 0002H = 20126H. Thus CS : IP = 2000H : 0126H.

c) Now we are at 20126H and instruction here is a short jump. This instruction requires an 8-bit offset value that must be added with next instruction address to get address where we want to jump. So present address is 20126H and next address is 20127H, offset given for this instruction is 02H, hence address to jump is 20127H + 20H = 20147H. Thus CS : IP = 2000H : 0147H.