Assembly Theory and Addressing Modes

Cards (28)

  • What is one reason to use a low-level language?
    It reflects the design of the processor
  • What is a characteristic of machine code?
    It uses binary notation
  • How is machine code specific to a processor?
    It depends on the hardware design of the processor
  • What do instructions in machine code operate on?
    Bytes of data
  • What are the differences between machine code and assembly language?
    • Machine code: written in binary and hexadecimal
    • Assembly language: includes mnemonics
    • Machine code: no translation needed
    • Assembly language: translated by an assembler
    • Machine code: very difficult to write
    • Assembly language: easier than machine code, harder than high-level languages
  • What steps do assemblers perform to produce machine code?
    1. Reserves storage for instructions & data
    2. Replaces mnemonic opcodes with machine codes
    3. Replaces symbolic addresses with numeric addresses
    4. Creates a symbol table for labels & addresses
    5. Checks syntax and provides error diagnostics
  • What is a mnemonic in assembly language?
    A three-letter code for an instruction
  • What does an opcode indicate?
    What operation the instruction is to perform
  • What is the purpose of an operand in an instruction?
    It holds data for the operation specified
  • What is flow control in programming?
    The order in which instructions are executed
  • What is symbolic addressing?
    Using characters to represent memory addresses
  • How is a jump command executed?
    By changing the contents of the PC
  • What happens when an instruction arrives in the processor?
    • The processor decodes the instruction
    • Determines the addressing mode to access data
    • Multiple versions of each instruction may exist
  • What does #ADD signify in addressing modes?
    Addition using direct addressing
  • What does %ADD signify in addressing modes?
    Addition using immediate addressing
  • What does $ADD signify in addressing modes?
    Addition using indirect addressing
  • If the Accumulator equals 5 and we %ADD 6, what is the result?
    11
  • If the Accumulator equals 5 and we #ADD 2, what is the result?
    6
  • If the Accumulator equals 5 and we $ADD 4, what is the result?
    6
  • What is immediate addressing?
    • Operand is the value to be used
    • Used in assembly language
  • What is direct addressing?
    • Operand is the memory location of data
    • Simplest and most common method of addressing
  • What is indirect addressing?
    • Operand is a memory location holding a value
    • Increases the memory locations that can be addressed
  • What is indexed addressing?
    • Operand is added to contents of Index Register
    • Allows efficient access to a range of memory locations
  • Why can't we only use direct addressing?
    Addresses are limited by the address field size
  • What is an indexed register?
    • Used in indexed addressing
    • Stores a number to modify an address
    • Allows access to a range of memory locations
  • Compare direct addressing and indirect addressing.
    • Direct: simplest method, uses address field directly
    • Indirect: uses address field as a pointer, increases addressable memory
  • What is relative addressing?
    • Calculates a real address from a base address
    • Uses an offset as a relative address
    • Useful for arrays and branching
  • What does indexed addressing modify?
    • Modifies the address by adding a number
    • Uses the index register to determine the final address