please give answer if you are confirm other. wise donot attempt ,this is third t
ID: 2247155 • Letter: P
Question
please give answer if you are confirm other. wise donot attempt ,this is third time asking.
subject 8086 microprocesser
Q1. If the signed number 65 is added to each of the following signed numbers, give the values of the sign and overflow bits after each addition:
(i) D3 (ii) 83
Q2. Give the addressing mode used for the source and the destination in each of the given instructions.
(i) mov AX, [BP+23+SI]
(ii) mov CX, SS:1234
(iii) mov DX, 23[BX]
What will be the contents of the ax and bx registers after the entire code is executed.
mov ax, 3432
mov bx, 1238
add bx, ax
aaa
Explanation / Answer
Q1.
(i)
Consider these are 8 bit numbers and the 8th bit indicates sign,
Now D3 + 65 will be as follow
1 101 0011
+ 0 110 0101
----------------------
0 011 1000 (56)
Here the sign bit is = 0 and over flow bit is =0 (as it off opposite signs there wont be overflow).
(ii)
Consider these are 8 bit numbers and the 8th bit indicates sign,
Now 83 + 65 will be as follow
1 000 0011
+ 0 110 0101
----------------------
1 110 1000 (-24)
Here the sign bit is = 1 and over flow bit is =0 (as it off opposite signs there wont be overflow).
Q2.
(i) mov AX, [BP+23+SI]
Addressing mode used here is Based indexed with displacement mode.
In Based indexed with displacement mode operand offset is computed by
adding base register contents , index register contents , displacement.
(ii) mov CX, SS:1234
Here SS:1234 indicates that in Stack Segment we have to refer 1234 address.
Hence this is an address and hence this is Direct Addressing Mode.
(iii) mov DX, 23[BX]
This is Register Relative addressing the final address we will get by adding
the displacement (23) to the content of BX.
Q3.
mov ax, 3432 [moves 3432 in to ax register]
mov bx, 1238 [moves 1238 in to bx register]
add bx, ax [add ax and bx and store the result in bx]
3432 + 1238
0011 0100 0011 0010
+ 0001 0010 0011 1000
------------------------------------
0100 0110 0110 1010 (466A)
aaa [Ascii Adjust after addition]
Here in the result of addition in any byte if lower nibble is > 9 then
we have to do the following , Consider lower Nibble as AL and upper nibble as AH
then
AL = AL + 6
AH = AH + 1
Hence in the result 466A [ 0100 0110 0110 1010 ]
after adding 6 to 1010 then it will be 0 [0000]
after adding 1 to 0110 then it is 0111
Hence the final result is 0100 0110 0111 0000 [4670].
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.