Microprocess Assignment 1.Name all eight 32-bit general-purpose registers. Name all six segment .registers Name at least four CPU status flags Answer -Name all eight 32-bit general-purpose registers EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP -Name all six segment registers CS, DS, ES, FS, GS, SS -Name at least four CPU status flags Most common: Carry, Sign, Zero, Overflow. Less common: Auxiliary .Carry, Parity 2.What is the purpose of the IP/EIP register? What special purpose does the ECX register serv? Answer What special purpose does the ECX register? Loop counter 3.Besides the stack pointer (ESP), which other register points to variables on the stack Answer EBP 1 4.Which flag is set when the result of a signed arithmetic operation is too wide to fit into the destination. Answer Overflow Which flag is set when an operation generates a negative result? Answer… Sign 5.What is the range of addressable memory in protected mode? Answer GByte 0 to FFFFFFFFh What is the range of addressable memory in Real-address mode? Answer MByte 0 to FFFFFh 6.In Real-address mode, convert the following segment-offset address to .a linear address: 0CD1:02E0 Answer. 0CFF0h 7.In Protected mode, which register references the descriptor for the stack segment? Answer SS Register 2 In Protected mode, which table contains pointers to the various segments used by a single program. Answer. Local descriptor table 8.In the real mode, show the starting and ending addresses of each segment located by the following segment register values: (a) 1000H (b) 1234H (c) 2300H (d) E000H. Answer Staring Address Ending Address 1000H 0000H 1000 H 1234H 1001 H 1001 H 2300H 2000 H 2000 H E000H E000 H E000 H 9.Find the memory address of the next instruction executed by the ,microprocessor :when operated in the real mode, for the following CS: IP combinations (a) CS =1000H and IP = 2000H (b) CS = 2000H and IP = 1000H (c) CS = 2300H and IP = 1A00H (d) CS =1A00H and IP =B000H 3 Answer (a) CSx10+IP= 10000H + 2000H=12000H (b) CSx10+IP= 20000H + 1000H=21000H (c) CSx10+IP= 23000H + 1A00H=24A00H (d) CSx10+IP= 1A000H + B000H=25000H 10. Which 32-bit register or registers are used as an offset address for . data segment data in the Pentium 4 microprocessor Answer EAX, EBX, ECX, EDX, ESI, EDI, EBP AND ESP 11.Determine the memory location addressed by the following real mode 80286 register combinations : (a) DS = 1000H and DI = 2000H DS = 2000H and SI = 1002H SS = 2300H and BP = 3200H DS = A000H and BX = 1000H Answer (a) DSx10+DI =10000H +2000H=12000H (b) DS x10+SI= 20000H +1002H=21002H (c) SS x10+BP= 23000H +3200H=26200H (d) DSx10+BX=A0000H +1000H=A1000H 4 12.Determine the memory location addressed by the following real mode Pentium 4 register combinations: (a) DS = 2000H and EAX = 00003000H (b)DS = 1A00H and ECX = 00002000H )c)DS = C000H and ESI = 0000A000H (d) SS = 8000H and ESP = 00009000H Answer DSx10+EAX=20000H+00003000H=23000H DSx10+ECX=1A000H+00002000H=1C000H DSx10+ESI=C0000H+0000A000H=0CA000H DSx10+ESP=80000H+00009000H=89000H 13.Protected mode memory addressing allows access to which area of the memory in the 80286 microprocessors and to which area of the memory in the Pentium II microprocessor? Answer Protect mode tending to (80286or more) permits admittance to information located over the main 1m byte just as inside the primary 1m byte. 14.What is the purpose of the segment register in protected mode memory addressing. Answer In protect mode, segment register simply point to data structure called segment descriptors that contain the information needed to access physical memory location. 5 15.How is the stack top address calculated. Answer The SP store the offset of the stack top from the base of stack segment. For example Ss=0*7000 and SP=0*000 ss left shifted by 4bits =0*70000 SP=0*0000 the sum =0*70000 is the physical address of stack top Assembly [1*] Which of the following instructions cannot be coded in the 8086/88 assembly language and why? (a) MOV AX,27 (d) MOV CX, 397 (g) MOV DS, BX (b) MOV AL,978 (e) MOV SI,9516 (h) MOV BX, CS (c) MOV DS, 9BF2 (f) MOV CS, 3490 (I) MOV AX, DL (j) MOV BL, CX (k) MOV CS, SS (l) MOV [BX], [DI] (m) MOV [BX],10H Answer 6 (b) MOV AL,978 (c) MOV DS, 9BF2 7 (f) MOV CS, 3490 (k) MOV CS, SS 8 MOV [BX], [DI] 9 [2*] Suppose that DS = 0200H, BX = 0200H and DI = 0300H. Determine the data memory address accessed by each of the following instructions (a) MOV AL, [2000H] AL (b) MOV AL, [BX] (c) MOV [DI], Answer (a)DSx10+2000H=2000H+2000H=4000H (b)DSx10+200H=2000H+200H=2200H (c)DSx10+300H=2000H+300H=2300H 10 [3*] Assume memory locations of the following contents:DS:6826=48 and DS: 6827=22.Show the content of BX after the execution of the instruction c MOV BX, [6826]. Answer [4*] If AX=3245H, BX=5632H, CX=672BH, CS=2000H, SI=62F4H, find the result of each line of the following program :( the memory map is shown below) 11 (a) MOV DS, AX (b) MOV SI,100H (c) MOV BX,04H (d) ADD AX, [SI] Memory location data: Memory location Data 32557H 2DH 32556H 24H 32555H 3CH 32554H 8BH 32553H 79H 32552H 6FH 32551H 6AH 32550H 34H Answer 12 13 5] Identify the addressing modes, the source, and the destination operands in the following instructions: (a) MOV DL, BL (b) MOV AX, 00FFH (c) MOV [DI], AX (d) MOV DI, [SI] (e) MOV [BX+100H], CX (f) MOV 100H[DI], AH (g) MOV [BX][DI]+100H, AL Answer Source destination (a) MOV DL, BL Register Register (b) MOV AX, 00FFH Immediate Register (c) MOV [DI], AX Register Register indirect (d) MOV DI, [SI] Register indirect Register (e) MOV [BX+100H], CX Register Based (f) MOV 100H[DI], AH Register Indexed (g) MOV [BX][DI]+100H, AL Register Based with 16bit displacement 14 [6*] Given that: DS = 1000H, SS = 2000H, BP = 1000H, DI = 0100H, BX = 0200H, LIST = 0250H, SI = 0500H and LABEL = 1234H. Determine the data memory address and the addressing modes for each of the following instructions: (a) MOV AL, [BP][DI]+LABEL (b) MOV CX, [DI] (b) MOV DX, [BP] (d) MOV LIST[SI], DX (e) MOV BL, [BX][SI]+LIST (f) MOV BH, [BX]+LIST Answer (a)DSx10+[1000H] [0500H] +1234H= 502BE2h (b)DSx10+0100H= 2774h (c)Ds 10+1000H= 2AF8h (d)DSx10+ [0250] [0500] = 20F58h (e)DSx10+[0200H] [0500H] +0250H=1AEAAh (f) DSx10+0200+0250=28D2h [7*] Write a program to add a data byte located at offset 0500H in 2000H segment to another data byte available at 0600H in the same segment and store the result at 0700H in the same segment. Answer 15 16