Unit 2: 8086 Instruction Set
56 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of these options are correct? (Select all that apply)

  • Integer Instruction & Computation (correct)
  • Addressing Modes (correct)
  • 8086 Programming (correct)
  • Data Transfer Instruction (correct)
  • Instruction Format (correct)
  • Arithmetic Instruction & their use in programming (correct)
  • There are 7 addressing modes in the 8086 microprocessor.

    False

    What does the term "Opcode" stand for?

    Operation Code

    What does the term "Operand" refer to?

    <p>The data that is manipulated by the Opcode</p> Signup and view all the answers

    In immediate addressing mode, the source operand is a constant.

    <p>True</p> Signup and view all the answers

    Immediate addressing mode can be used to load information into any register, including segment and flag registers.

    <p>False</p> Signup and view all the answers

    In direct addressing mode, what part of the instruction is directly specified?

    <p>A 16-bit memory address (offset)</p> Signup and view all the answers

    How is the physical/effective address calculated in direct addressing mode?

    <p>DS * 10H + 4321 [offset]</p> Signup and view all the answers

    Register addressing mode is generally preferred because it results in compact and faster executing instructions.

    <p>True</p> Signup and view all the answers

    All registers, including IP (Instruction Pointer), can be used in register addressing mode.

    <p>False</p> Signup and view all the answers

    What type of register is used in register indirect addressing mode?

    <p>Index or base register</p> Signup and view all the answers

    In index addressing mode, where is the offset of the operand stored?

    <p>Index registers (SI or DI)</p> Signup and view all the answers

    What is the formula to calculate the effective address in index addressing mode?

    <p>10H * DS + [SI]</p> Signup and view all the answers

    Register relative addressing mode calculates the effective address by adding a displacement with the content of any register.

    <p>True</p> Signup and view all the answers

    What registers are involved in based index addressing mode?

    <p>Base register (BX or BP) and index register (SI or DI)</p> Signup and view all the answers

    What is the formula for calculating the effective address in based index addressing mode?

    <p>10H * DS + [BX] + [SI]</p> Signup and view all the answers

    In relative based indexed addressing mode, how is the effective address formed?

    <p>Adding an 8 or 16-bit displacement to the sum of the base register (BX or BP) and the index register (SI or DI).</p> Signup and view all the answers

    What is the formula for calculating the effective address in relative based indexed addressing mode?

    <p>10H * [BX] + [SI] + 50H</p> Signup and view all the answers

    Identify the addressing mode used in the instruction MOV AL, BL.

    <p>Register addressing</p> Signup and view all the answers

    Identify the addressing mode used in the instruction MOV AX, 0FFFH.

    <p>Immediate addressing</p> Signup and view all the answers

    Identify the addressing mode used in the instruction MOV [DI], AX.

    <p>Register indirect addressing</p> Signup and view all the answers

    Identify the addressing mode used in the instruction MOV DI, [SI].

    <p>Register indirect addressing</p> Signup and view all the answers

    Identify the addressing mode used in the instruction MOV [BX]+0400H, CX.

    <p>Register relative addressing</p> Signup and view all the answers

    What is the effective address of the instruction MOV CX, [4321H] if the DS register contains the value 5000H?

    <p>54321H</p> Signup and view all the answers

    A machine language instruction format consists of one or more ____ associated with it.

    <p>fields</p> Signup and view all the answers

    What is the name of the field that indicates the type of operation to be performed by the CPU?

    <p>Operation code field or op-code field</p> Signup and view all the answers

    The length of an instruction in the 8086 instruction set is always fixed at 1 byte.

    <p>False</p> Signup and view all the answers

    The least significant 3-bits of the opcode are used to specify the register operand in the One Byte Instruction format.

    <p>True</p> Signup and view all the answers

    The second byte in the Register to Register Instruction format specifies the operation code and width of the operand.

    <p>False</p> Signup and view all the answers

    The MOD field in the Register to/from Memory with no Displacement Instruction format indicates the mode of addressing.

    <p>True</p> Signup and view all the answers

    In the Register to/from Memory with Displacement Instruction format, the displacement field can be either 1 or 2 bytes long.

    <p>True</p> Signup and view all the answers

    The Immediate Operand to Register Instruction format uses the entire first byte and only 1 bit from the second byte for the opcode.

    <p>False</p> Signup and view all the answers

    The Immediate Operand to Memory with 16-bit Displacement Instruction format requires 3 or 4 bytes for coding.

    <p>False</p> Signup and view all the answers

    The Instruction set of the 8086 microprocessor is categorized into 6 different types.

    <p>False</p> Signup and view all the answers

    Which of these is NOT a category of 8086 instructions?

    <p>Memory manipulation instructions</p> Signup and view all the answers

    The MOV instruction is used to transfer data between one register and another or between a register and a memory location.

    <p>True</p> Signup and view all the answers

    The PUSH/POP instruction operates on the stack, which is a last-in, first-out (LIFO) data structure.

    <p>True</p> Signup and view all the answers

    The IN/OUT instruction allows data to be moved directly to and from input and output ports.

    <p>True</p> Signup and view all the answers

    The XCHG instruction enables the swapping of data between two memory locations.

    <p>False</p> Signup and view all the answers

    The LEA instruction is used to load the specified register with the actual value of the operand.

    <p>False</p> Signup and view all the answers

    The LDS/LES instruction loads both the data register (DS or ES) and the specified destination register with the content of the specified source memory location.

    <p>True</p> Signup and view all the answers

    The ADD instruction adds an immediate value or the contents of a memory location to the contents of another register or memory location, but it can't add a register to a register.

    <p>False</p> Signup and view all the answers

    The INC instruction increases the content of a register or memory location by a value specified by the user.

    <p>False</p> Signup and view all the answers

    The AAA instruction adjusts the result in AL after an ADD instruction that involves two ASCII operands to unpack the decimal digits in a BCD format.

    <p>True</p> Signup and view all the answers

    The DAA instruction specifically targets the result of addition operations that deal with packed BCD numbers, not unpacked BCD numbers.

    <p>True</p> Signup and view all the answers

    The SUB instruction subtracts the source operand from the destination operand and leaves the result in the destination operand.

    <p>True</p> Signup and view all the answers

    The SBB instruction subtracts the source operand and the carry flag from the destination register, similar to SUB, but it doesn't take into account the borrow flag.

    <p>False</p> Signup and view all the answers

    The NEG instruction takes the two's complement of the specified operand.

    <p>True</p> Signup and view all the answers

    The MUL instruction performs unsigned multiplication of the operand by the content of either AL or AX, depending on whether the operand is a byte or a word.

    <p>True</p> Signup and view all the answers

    The DIV instruction performs signed division.

    <p>False</p> Signup and view all the answers

    The AAD instruction converts two unpacked BCD digits into a packed BCD before division.

    <p>False</p> Signup and view all the answers

    The CBW instruction converts a signed byte in AL to a signed word in AX.

    <p>True</p> Signup and view all the answers

    The CWD instruction converts a signed word in AX to a signed double word in DX:AX, with the sign bit of AX being copied to all bits of the DX register.

    <p>True</p> Signup and view all the answers

    What are the two steps involved in the execution of the AAA instruction?

    <ol> <li>Set the high order bit of AL to 0 and clear AH. 2. If the lower 4 bits of AL are greater than 9, add 6 to AL and 1 to AH. Also, set Carry and Auxiliary Carry flags to 1.</li> </ol> Signup and view all the answers

    The DAA instruction adjusts the result of addition in AL for unpacked BCD numbers.

    <p>False</p> Signup and view all the answers

    Match the following instructions with their descriptions:

    <p>ADD = Adds two operands, one of which can be immediate data. ADC = Adds two operands and the carry flag. INC = Increases a register or memory location by 1. DEC = Decreases a register or memory location by 1. AAA = Adjusts the result of an ADD instruction involving ASCII operands to unpack the decimal digits in a BCD format. DAA = Adjusts the result of an addition involving packed BCD numbers to ensure it is a correct packed BCD value.</p> Signup and view all the answers

    Study Notes

    Unit 2: 8086 Instruction Set

    • The 8086 instruction set covers addressing modes, instruction formats, and programming.
    • Addressing modes determine how operands (data) are accessed from memory.
    • Instruction formats detail the structure of machine language instructions.
    • 8086 programming uses these modes and formats to execute operations. Key types of operations are integer operations, data transfer, and arithmetic calculations.

    Addressing Modes in 8086

    • Addressing modes define how data is located for instructions.
    • There are 8 primary addressing modes in the 8086.
    • Instruction execution categorizes instructions into sequential control flow instructions and control transfer instructions.
    • Modes include immediate, direct, register, register indirect, index, register relative, and based indexed addressing modes. Each mode has a specific way of determining the memory address.

    Opcode & Operand in Microprocessor 8086

    • Opcode is short for operation code. It's a command in machine or assembly language.
    • Opcodes can manipulate operands (data values).
    • Example: MOV AX, 1000H (MOV is the opcode, AX is the destination, and 1000H the source).

    1. Immediate Addressing Modes

    • Immediate data is part of the instruction.
    • Source operand is constant.
    • Example: MOV AX,0005H. This transfers the data from constant 0005H into destination register AX.
    • Immediate addressing can load data into most registers (excluding segment and flag registers).

    Examples of Immediate Addressing Modes

    • MOV AX,2500H.
    • MOV BL,22H
    • MOV CX,625H

    2. Direct Addressing Modes

    • Data is found at a specified memory location.
    • Address of the data in memory appears directly after the instruction.
    • Example: MOV CX, [4321H]. This moves the data from the memory address 4321H to register CX.

    3. Register Addressing Modes

    • Operands are specified using registers.
    • This is a preferred method due to instruction compactness and speed.
    • All registers (except IP) can be used.
    • Example: MOV AX, BX. Copies the data from register BX to register AX.

    4. Register Indirect Addressing Mode

    • Transfers data between a register and a memory location.
    • Address of data is dependent on the contents of BX, SI, or DI.
    • Data's location is in a specified segment (e.g., default data segment).
    • Example: MOV AX, [DI] , where data is at an address determined by the contents of register DI.

    5. Index Addressing Mode

    • Offset of an operand is stored in one of the index registers (SI or DI).
    • Default segment is DS.
    • Example: MOV AX, [SI] (data is at address based on contents of register SI).

    6. Register Relative Addressing Modes

    • Data's location is an effective address found by adding a displacement with content in BX, BP, SI or DI and the default segment.
    • Example; MOV AX, 50H + [BX].

    7. Based Index Addressing Mode

    • Data's location is found by adding content of base register to index register, using a default segment.
    • Example: MOV AX, [BX][SI]

    8. Relative Based Indexed Addressing Mode

    • Data is obtained using an effective address derived by adding a displacement and the content of base and the index registers, and a default segment.
    • Example: MOV AX, 50H [BX] [SI]

    Instruction Format

    • Machine language instructions have fields associated with them.
    • The first field is the opcode field (indicating the operation).
    • Other fields are operand fields for specifying data.
    • Instruction lengths vary from 1 to 6 bytes. Different formats include one-byte instructions, register-to-register instructions, register-to/from memory with no displacement, register-to/from memory with displacement, immediate operand-to-register, and immediate operand-to-memory.

    Instruction Set in 8086

    • 8086 instruction set is grouped into seven categories: data transfer, arithmetic/logic, program control transfer, machine control, shift/rotate, flag manipulation, and string instructions.

    Data Transfer Instructions

    • Transfer data from one register/memory to another. Includes:
      • MOV
      • PUSH/POP (for stack operations)
      • IN/OUT
      • XCHG
      • XLAT
      • LEA
      • LDS
      • LES

    Arithmetic & Logical Instructions

    • Include various arithmetic operations (addition, subtraction, multiplication, division) and logical operations. Examples:
      • ADD
      • ADC
      • INC
      • DEC
      • SUB
      • SBB
      • NEG
      • MUL
      • IMUL
      • DIV
      • IDIV
      • AAM
      • AAA
      • DAA
      • DAS

    Additional Q&As

    • Specific questions about instruction operations and effects are addressed.
    • Example scenarios and data values are used to illustrate application.
    • Instructions for manipulation and conversion of packed and unpacked BCD numbers, and programming tasks are given for practical implementation.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    8086 Instruction Set PDF

    Description

    This quiz covers the 8086 instruction set, including addressing modes, instruction formats, and basic programming techniques. Understand the various addressing modes and their implications for data access, as well as the structure of machine language instructions. Test your knowledge on operation types and execution categories within the 8086 microprocessor.

    More Like This

    8086 Instruction Set Overview
    5 questions
    8086 Addressing Modes Quiz
    10 questions
    8086 Instruction Set Quiz
    41 questions

    8086 Instruction Set Quiz

    SpiritualRutherfordium avatar
    SpiritualRutherfordium
    Use Quizgecko on...
    Browser
    Browser