• Processor Instructions
    • Processors can only operate using switches (transistors)
    • We give a processor instructions using binary
      • Which correlates to switches being on or off
    • We group switches into logic gates, and then logic gates into useful circuits
      • E.g. adding two numbers together
    • Logic gate circuits enable everything in modern day computing
    • We can group processor instructions into logical groups:
      • Data movement
        • Register to main memory and vice versa
      • Input and output of data
      • Arithmetic operations
      • Unconditional and conditional jump instructions
      • Compare instructions
      • Modes of addressing
    • There is a separate part of the CPU that manages calculations and logic; called the ALU
      • This handles much of the processor’s work
    • Each CPU family will have its own instruction set
      • This means that compilers and interpreters translating into binary must be written for specific operating systems and instruction sets
    • Because binary is tough for humans, we invented assembly language
      • This uses mnemonics (codes) to substitute for the equivalent binary instruction
      • Which makes it easier for humans and less prone to errors
  • Label
    • References a memory location
    • e.g. Start, End
    • On first pass the label is converted back to its memory location
  • Addressing modes
    • There are various ways to address memory
      • Immediate
        • This value is the number to be used
        • There is no link to another memory address to get the required value
        • Diagram Description automatically generated
      • Direct
        • The value represents the memory location where the required value can be found
        • Diagram, schematic Description automatically generated
      • Indirect
        • This value points to the memory address, which itself contains an address where the value can be sought
        • Diagram Description automatically generated
      • Indexed
        • This value points to an address, which must also be added to the value in the index register (IX) to retrieve the value required
        • Commonly used to reference arrays
        • Diagram Description automatically generated
      • Relative
        • This value represents an offset to the current memory address in the program counter register
          • E.g. if the PC was pointing to address 70, a relative address of 5 would retrieve from address 75
        • Commonly used when loading programs into memory by a linker
        • When writing a program there is no way of knowing where in memory your program will sit
        • Therefore, everything works by an offset
        • Diagram Description automatically generated
    • Typical instructions (provided in an exam)
    • Table Description automatically generated
  • The LMC Simulator
    • The Little Man Computer (LMC) is a simulator that has many of the basic features found in a Von Neumann architecture machine
      • Such as memory being used for instructions and data
    • Its premise is that the CPU is like a little man, fetching instructions, controlling data in and out, etc.
    • LMC uses its own instruction set and compiles the instructions, uniquely, into decimal notation for easy reference
      • It is an abstract representation so the real thing does differ (for example how values are input and output)
    • The LMC tasks will help you understand how assembly language is sequenced