Lesson 4

Cards (49)

  • INSTRUCTION SET ARCHITECTURE

    Basically the interface between your hardware and the software. The only way that you can interact with the hardware is the instruction set of the processor. To command the computer, you need to speak its language and the instructions are the words of a computer’s language and the instruction set is basically its vocabulary. This specifies what the processor is capable of doing and how it gets accomplished.
  • instruction set architecture

    allows computer designers to talk about functions independently from the hardware that performs them.
  • Instruction length

    this can vary
  • Opcodes
    A short for Operation Code is the command to be carried out.
  • Operands
    it is the Data that the command will operate on
  • Registers
    it is the internal locations and limited in number and ability, but quick to access
  • Memory
    it is external storage which is a larger and more versatile number of locations, but slower to access
  • Addressing Mode

    it guides how to access memory location using address for fetching Instruction or Data
  • The 8086 instructions set has approximately 117 different instructions with about 300 opcodes
  • Addressing modes

    Allow us to specify where the instruction operands are located. An addressing mode can specify a constant, a register, or a memory location. The actual location of an operand is its effective address.
  • The addressing modes of any processors can be broadly classified as:
    Data addressing modes
    Program memory addressing modes
    Stack memory addressing modes
  • MOV
    Instruction is a very common and flexible instruction, it provides a basis for the explanation of the data-addressing modes.
  • The data addressing mode can be further classified as:
    ▪ Addressing modes for accessing immediate and register data
    o register, immediate
    ▪ Addressing modes for accessing data in memory (memory modes)
    o direct, register indirect, base-plus index, register-relative, and base relative-plus-index
    Addressing modes for accessing input/output ports (I/O modes)
  • Register Addressing Mode

    Transfers a copy of a byte or word from the source addressing register or contents of a memory location to the destination register or memory location.
    The microprocessor contains the following 8-bit register names used with register addressing: AH, AL, BH, BL, CH, CL, DH, and DL. Also present are the following 16-bit register names: AX, BX, CX, DX, SP, BP, SI, and DI.
  • MOV AX,BX

    copy contents of BX into AX
  • MOV CL,DH

    copy contents of DH into CL
  • Immediate Addressing Mode

    Transfers the source, an immediate byte, word, addressing doubleword, or quadword of data, into the destination register or memory location. The term immediate implies that the data immediately follow the hexadecimal opcode in the memory. Also note that immediate data are constant data, whereas the data transferred from a register or memory location are variable data.
  • MOV AX,0H

    copy/place 0000H into AX
  • MOV CL, 11001110B
    copy/place 11001110 binary into CL
  • Direct Addressing Mode

    Moves a byte or word between a memory location addressing and a register. The instruction set does not support a memory-to-memory transfer, except with the MOVS instruction. In this mode, the 16-bit effective address (EA) is taken directly from the displacement field of the instruction. The displacement (unsigned 16-bit or sign-extended 8-bit number) is stored in the location following the instruction opcode. EA is a displacement of the desired location from the segment base.
  • MOV CL,[9823H]

    this instruction will copy contents of the memory location, at a displacement of 9823H from the data segment base, into the CL register. Here, 9823H is the effective address (EA) which is written directly in the instruction.
  • MOV AL, NUMBER

    copies the byte contents of data segment memory location NUMBER into AL
  • Register Indirect Addressing Mode

    Transfers a byte or word between an addressing register and a memory location addressed by an index or base register. It allows data to be addressed at any memory location through an offset address held in any of the following index and base registers: BP, BX, DI, and SI. The data segment is used by default with register indirect addressing or any other addressing mode that uses BX, DI, or SI to address memory. If the BP register addresses memory, the stack segment is used by default.
  • MOV CX, [BX]

    copies the word contents of the data segment memory location addressed by BX into CX
  • MOV [DI], BH

    copies BH into the data segment memory location addressed by DI
  • Base-Plus-Index Addressing Mode

    Similar to indirect addressing because it indirectly addresses memory data. Base-plus-index addressing transfers a byte or word between an addressing register and the memory location addressed by a base register (BP or BX) plus an index register (DI or SI). The base register often holds the beginning location of a memory array, whereas the index register holds the relative position of an element in the array. Remember that whenever BP addresses memory data, both the stack segment register and BP generate the effective address.
  • MOV CX, [BX+DI]

    copies the word contents of the data segment memory location addressed by BX plus DI into CX
  • MOV CH, [BP+SI]

    copies the byte contents of the stack segment memory location addressed by BP plus SI into CH
  • Register Relative Addressing Mode
    Similar to base-plus-index addressing and displacement addressing. Register relative addressing moves a byte or word between a register addressing and the memory location addressed by an index or base register plus a displacement. In register relative addressing, the data in a segment of memory are addressed by adding the displacement to the contents of a base or an index register (BP, BX, DI, or SI). The displacement is a number added to the register within the [ ], or it can be a displacement is subtracted from the register, as in MOV AL,[SI–l].
  • MOV AX,[DI+100H]

    copies the word contents of the data segment memory location addressed by DI plus 100H into AX
  • MOV ARRAY[SI], BL

    copies BL into the data segment memory location addressed by ARRAY plus SI
  • Base Relative-Plus Addressing Mode

    Transfers a byte or word between an index addressing register and the memory location addressed by a base and an index register plus a displacement. The base relative-plus-index addressing mode is similar to base-plus-index addressing, but it adds a displacement, besides using a base register and an index register, to form the memory address. This type of addressing mode often addresses a two-dimensional array of memory data
  • MOV DH,[BX+DI+20H]

    copies the byte contents of the data segment memory location addressed by the sum of BX, DI and 20H into DH
  • MOV AX,FILE[BX+DI]

    copies the word contents of the data segment memory location addressed by the sum of FILE, BX and DI into AX
  • ADDRESSING MODES FOR ACCESSING INPUT/OUTPUT PORTS (I/O MODES)

    Standard I/O devices uses port addressing modes. Form memory -mapped I/O memory addressing modes are used. There are two types of port addressing modes: direct and indirect. In direct port mode, the port number is an 8-bit immediate operand. This allows fixed access to ports number 0 to 255.
  • OUT 05H,AL
    send the contents of AL to 8-bit port 05H
  • IN AX,80H

    copies 16-bit contents of port 80H
  • IN AL,DX

    if [DX] = 7890H, then it copies 8-bit content of port 7890H into AL.
  • IN AX,DX

    copies the 8-bit contents of ports 7890H and 7891H into AL and AH, respectively.
  • PROGRAM MEMORY-ADDRESSING MODES
    Program memory-addressing modes, used with the JMP (jump) and CALL instructions, consist of three distinct forms: direct, relative, and indirect.