Question

In: Computer Science

1- Assume that the state of the 8086 registers and memory just prior to the execution...

1- Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below:
(AX) = 0010 H
(BX) = 0020 H

(CX) = 0030 H (DX) = 0040 H (SI) = 0100 H
(DI) = 0200 H (CF) = 1 (DS:100H) = 10 H (DS:101H) = 00 H (DS:120H) = FF H (DS:121H) = FF H (DS:130H) = 08 H (DS:131H) = 00 H (DS:150H) = 02 H (DS:151H) = 00 H (DS:200H) = 30 H (DS:201H) = 00 H (DS:210H) = 40 H (DS:211H) = 00 H (DS:220H) = 30 H (DS:221H) = 00 H

Note: (DS:100H) = 10 H ; this means that the data written in the address that is obtained by combining DS register (as base address) and 100H(offset) , is 10H.

Which result is produced in the destination operand in each of the following cases (instructions are independent): (32 points)

  1. a) ADDAX,00FFH

  2. b) ADC SI, AX

  3. c) INCBYTEPTR[0100H]

  4. d) SUB DL, BL

  5. e) SBB DL, [0200H]

  6. f) MUL DX

  7. g) IMULBYTEPTR[SI]

  8. h) IDIV BX

Solutions

Expert Solution

a) ADD AX,00FFH

AX= 0010H = 0000 0000 0001 0000 +

0000 0000 1111 1111

They are added together and we will get 0000 0001 0000 1111 = 010F H

b) ADC SI, AX

ADC will work with the syntax operand1 = operand1 + operand2 + CF so here it wil be

SI = SI +AX+CF

= 0100H+0010H+1

= 0111 H

c) INCBYTEPTR[0100H] hope you mean INC BYTE PTR[0100H]

INC BYTE PTR [0100H]; This indicates the size of memory data addressed by thememory pointer

Here the value at location [0100] is given as 10H but as we increment it by using INC instruction it will become 11H

INC BYTE PTR[0100H] = 11H

d) SUB DL, BL - This instruction performs subtraction of lower 8-bits in both DX and BX registers . The lowe part of these registers are DL and BL respectively. Now thier values become.

DX = 0040H So DL = 40H

BX = 0020H So BL = 20 H

Now SUB DL, BL 40H - 20H and result will store in DL register

DL = 40H = 0100 0000

BL = 20H = 0010 0000

So  SUB DL, BL = 0010 0000 = 20H

  

e) SBB DL, [0200H]

Solution:Value in DL = DL – (byte at DS:0200) – CF = 40H – 30H – 1 = 0FH

To understand better you can try to convert these Hexadecimalnumber to binary and solve it

that is 40H = 64 , 30H = 48 and 1 remains same. So 64-48-1 = 64 - 49 = 15 = 0FH

f) MUL DX - The MUL instruction will multiply the value in AX with DX and result will be stored in DXAX

So here Multiply AX= 10H with DX = 0040H and result will stored in DXAX = 10H * 40H = 400H

DX = upper 16 bits of result = 0000H; AX = lower 16 bits of result = 0400H

g) IMUL BYTE PTR[SI]

Anser Will be : AX = AL * byte at address DS:SI (signed multiplication of 8-bit values)

Here DS:SI = 0010H Al = 0010H

AX = 10H * 10H = 100H

h)  IDIV BX

As this this a division with 16 bit register and uses IDIV it will perform signed divion of BX register with values in DXAX together as 32 bit register

DIV BX = DX AX/BX = 0040H 0010H / 0020H = 20000H

Since it is a word IDIV divides double-word value in DX:AX bysource, returning quotient in AX and the remainder in DX.

In Decimal = 4194320 / 32 = 131072

Here in the cases of 'g' and 'h' we are not using any signed numbers so all the operations will work similar to the unsigned operations

                     

Related Solutions

Assume that the state of the 8086 registers and memory just prior to the execution of...
Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below: (AX) = 0000 H (BX) = 0010 H (CX) = 0105 H (DX) = 1111 H (SI) = 0100 H (DI) = 0200 H (CF)= 0 (DS:100H) = 0F H (DS:200H) = 22 H (DS:220H) = AA H (DS:221H) = 55 H (DS:400H) = AA H (DS:401H) = 55 H Examine the following instructions independently and calculate the...
A) Name and explain the flag registers of 8086?                                  &nbs
A) Name and explain the flag registers of 8086?                                                                                                  B) Explain the Shift instruction? Name it’s types and explain only one of them?    C) Explain addressing decoding using 3- to 8- line decoder ? NOTE: In part C give the reason why we do address decoding and then explain the processes.
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has three operands. Two registers and the third operand is a direct address location of a memory. Find minimum size of PC, MAR, MDR, IR. Solution: OPCODE R1, R2, address OPCODE is 6 bits since 2^6>40 Register field is 4 bits since 2^4 =16 Memory field is 18 bits since 2^18=256K Instruction length =6+4+4+18=32 bits MDR=32 bits IR=32 bits MAR=18 PC=18 Please explain
Design a 8086 microprocessor base system that manage 1Mbyte of memory and can handle serial and...
Design a 8086 microprocessor base system that manage 1Mbyte of memory and can handle serial and parallel communication, a keyboard, a screen, a printer and a USB connection that handle high capacity secondary memory. Show all the connections needed and use all the necessary family chips needed to handle the I/O Systems. Show the memory map needed and the necessary I/O drivers. Use an interrupt manage chip to handle the I/O devices to be connected.
In the PIC18F452 Programming Model, list 2 registers that are used to access the Program Memory....
In the PIC18F452 Programming Model, list 2 registers that are used to access the Program Memory. Indicate their sizes.
Draw the figure for memory segments with 8086 microprocessor software model. Explain the logical address structure...
Draw the figure for memory segments with 8086 microprocessor software model. Explain the logical address structure used for each segment (Explain which registers are used in logical address presentation of each segment; segment address : offset address).
Explain the bounds registers approach for partitioned memory management and also give the major disadvantage of...
Explain the bounds registers approach for partitioned memory management and also give the major disadvantage of the bounds registers approach
Question 3. Describe memory types used in the MIPS assembly. Explain registers used in the MIPS...
Question 3. Describe memory types used in the MIPS assembly. Explain registers used in the MIPS assembly. Differentiate between assembly source code and machine code. Write a note on MIPS instruction formats.
Assume Dover Auto Inc. acquires all of the stock of Dover Financial Corporation. Just prior to...
Assume Dover Auto Inc. acquires all of the stock of Dover Financial Corporation. Just prior to the acquisition, their separate balance sheets are as follows: Dover Auto Inc Dover Financial Corporation Total assets 227,339,000 51,933,000 Total Liabilities 184,562,000 40,933,000 Shareholders’ Equity 42,777,000 11,000,000 Total Liabilities and Equity 227,339,000 51,933,000 Assume Dover Financial Corporation’s assets and liabilities are reported at fair value. Dover Auto Inc. pays $11,000,000 in cash to Dover Financial Corporation’s shareholders for Dover Financial corporation’s assets and liabilities...
Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is...
Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is byte-addressable? b. What are the lowest and highest addresses if memory is word-addressable, assuming a 16-bit word? c. What are the lowest and highest addresses if memory is word-addressable, assuming a 32-bit word? Explain with Steps please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT