5
Architecture & Organization II REVIEW PROBLEMS 1 Name: Ali Abdulrahim Ismail

Problems 1

Embed Size (px)

Citation preview

Page 1: Problems 1

Architecture & Organization II

REVIEW PROBLEMS 1

Name: Ali Abdulrahim Ismail

Page 2: Problems 1

1- explain what operation is performed by each of the instructions that follow.A- MOV AX , 0110HB- MOV DI , AXC- MOV BL , ALD- MOV [0100H] , AXE- MOV [BX+DI] , AXF-MOV [DI]+4 , AXG-MOV [BX][DI] + 4, AX2 – Assume that registers AX,BX, AND DL are All initialized to 0000H and that all the affected storage location in data memory have been cleared .Determine the location and value of the destination operand as instruction (A) through (G) in problem 1 executed as a sequence.3. write an instruction sequence that will initialize the ES register with the immediate value 1010H.4-write an instruction that saves the contents of the ES register in memory at address DS:1000H5- why does the instruction MOV CL , AX result in an error when it is assembled?

Page 3: Problems 1

6-If register BX contains the value 0100H,register DI contains 0010H ,and DS register contains 1075H , what physical memory location is swapped with AX when the instruction ( XCHG [BX+DI],AX ) is executed ?

7-write an instruction that add the immediate value 111FH and the carry flag to the contents of the data register DX .

8-write an instruction that show two different ways of instruction the add pointer SI by two .

9- Assuming that (Al) =23H and (BL) = 10 H ,what will be the new contents of AX after executing the instruction DIV BL?

10- write an instruction sequence that generates a byte size integer in the memory location 1000 H the value of the integer is to be calculated from the logic equation

RESULT = (AL) .(NUM1) + (NUM2) .(AL) +(BL) NUM1 = memory location in 1001HNUM2=memory location in 1002HRESULT should stored in 1000 11 –implement the following operation using shift and arithmetic instructions 7(AL) – 5(BL) / 8 (AX)

Page 4: Problems 1

Solution 1 (a) Value of immediate operand 0110H is moved into AX. (b) Contents of AX are copied into DI. (c) Contents of AL are copied into BL. (d) Contents of AX are copied into memory address DS:0100H. (e) Contents of AX are copied into the data segment memory location pointed to by (DS)0 + (BX) + (DI). (f) Contents of AX are copied into the data segment memory location pointed to by (DS)0 + (DI) + 4H.(g) Contents of AX are copied into the data segment memory location pointed to by (DS)0 + (BX) + (DI) + 4H.2. (a) Value 0110H is moved into AX. (b) 0110H is copied into DI. (c) 10H is copied into BL. (d) 0110H is copied into memory address DS:0100H. (e) 0110H is copied into memory address DS:0120H. (f) 0110H is copied into memory address DS:0114H. (g) 0110H is copied into memory address DS:0124H.3 . MOV AX,1010H MOV ES,AX4. MOV [1000H],ES5. Destination operand CL is specified as a byte, and source operand AX is specified as a word. Both must be specified with the same size.

Page 5: Problems 1

6. 10750H + 100H + 10H = 10860H.7. ADC DX,111FH8. ADD SI,2H, or INC SI INC SI9. (AH) = remainder = 3, (AL) = quotient = 2, therefore, (AX) = 0302H.10. MOV AX ,100 MOV DS, AX MOV CL , AL AND CL , [0001] MOV DL ,[0002] NOT DL AND AL , DL OR AL , CL OR AL ,BL MOV [0000] , AL11 . MOV DL , 7 MUL DL MOV CX , AX MOV AX,00 MOV DL , 5 MOV AL,BL MUL DL MOV DL , 8 DIV DL MOV AH,00 SUB CX , AX MOV AX,CX