Tuesday, 6 November 2007

Assembly Language

  • Second generation low-level language
  • Consists of four parts: [Label]-[Op Code]-[Operands]-[Comments]
    eg [Start:]-[mov]-[bx,80h]-[;Load character count]
  • Label: Used as a reference and good for calculating relative jumps.
  • Operation Code: Contains mnemonic which describes operation.
  • Operands: Describe source and destination of the data to be operated on.
  • Comments: Used for convenience of programmer. Helps readability.
  • Advantages: Can be quicker than some high level languages.
    - can access registers and exact memory addresses.

    Addressing Modes:

  • Register addressing
    - Data is transferred from a source register to a destination register
    ----
  • Immediate addressing
    - The data to be addressed is in the op code.
    ----
  • Direct addressing
    - Data is copied from a specified location in memory to the register.
    ----
  • Indirect addressing
    - Uses a number inside the register to point to location in memory.
    ----
  • Indexed addressing
    - Number within a register is used in combination with another number in another register to point to a location in memory.
    ----
  • No comments: