Question
please provide screenshots using dos debug.
4. Assemble the following instruction sequence into the memory starting at address CS: 100 and then verify their machine code
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is my screenshot of DOS Debug window:

a 100 072A:0100 add ax,0off 072A:0103 adc si,ax 072A:0105 inc byte ptrI01001 072A:0109 sub dl,bl 072A:01OB sbb d1, 02001 072A

here 3 instruction are giving error they are,

neg byte ptr[di]+0010

div word ptr[si]+0030

idiv word ptr[bx][si]+0030h5

above this instructions are giving error because in those instruction addressing mode is wrong.

We can not use addressing mode like [di]+0010.So due that addressing mode these three instructions give error.

Now we calculate byte of memory each instruction take up,

1) 0100 - 0103 = 3 in HEX = 3 in decimal = 3 bytes

2) 0105 - 0103 = 2 bytes

3) 0109 - 0105 = 4 bytes

4) 010B - 0109 = 2 bytes

5) 010F - 010B = 4 bytes

6) 0111 - 010F = 2 bytes

7) 0113 - 0111 = 2 bytes      //for mul dx

8) 0115 - 0113 = 2 bytes      //for imul word ptr[bx+si]

Now We have discussed that three instructions give error so that we can not calculate how memory bytes it take up,but i directly say that how many bytes they take up if they are modified like,

For neg byte ptr[di]+0010 if we change it to neg byte ptr[di+0100] then this will word and it takes 3 bytes.

For div word ptr[si]+0030 change it to div word ptr[si+0030] then it will take 3 bytes.

For idiv word ptr[bx][si]+0030h5 change it to idiv word ptr[bx][si+0030] then it will also take 3 bytes.

if you have any query then feel free to ask in comment.

Add a comment
Know the answer?
Add Answer to:
4. Assemble the following instruction sequence into the memory starting at address CS: 100 and th...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ECE3166 ADVANCED MICROPROCESSORS JUNE 2020 Question 2 (a) State the addressing mode and physical address of...

    ECE3166 ADVANCED MICROPROCESSORS JUNE 2020 Question 2 (a) State the addressing mode and physical address of the source operand for the x86 instructions below. Then, state the results and affected registers after execution of the instructions. The initial register / memory contents are given in Table Q2. MOV ECX ES [BX][SI] - 7 [4 marks] MUL BYTE PTR[202H] [5 marks] Table Q2 Register Register Content (Hex) CS 3000 DS 3001 ES 3002 SS 3003 AX BX SI DI Content (Hex)...

  • Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF...

    Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF = 1.    Give the new contents of AL after each of the following instructions is executed.    Assume the above initial conditions for each part of this question. a. SHL AL,1 b. SHR AL,1 c. ROL AL,2 d. ROR AL,3 e. SAR AL,2 f. RCL AL,1 g. RCR AL,3 B. Suppose EAX contain ABCDH.    Show the contents of BX and CX after...

  • Each of these problems gives "before" conditions and an instruction. Give the indicated "after" s...

    Each of these problems gives "before" conditions and an instruction. Give the indicated "after" state of the indicated registers and flags as appropriate. Before Instruction executed Afte (e) EDX: 00 00 02 E9 inc edx EDX SF __ ZF__ (f) EBX: FF FF FF 3B neg ebx EBX SF __ ZF__ (g) EAX: 01 23 45 67 ECX: 89 AB CD EF sub eax, ecx EAX SF __ ZF__ CF__ OF__ (h) AX: 12 34 CX: 7A BC CF: 1...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT