Cards (35)

  • What is the mnemonic for loading to the accumulator in LMC?
    LDA
  • What is the numerical/machine code for loading to the accumulator?
    5
  • What does the LOAD instruction do in LMC?
    Loads mailbox contents to the accumulator
  • What is the mnemonic for storing from the accumulator?
    STA
  • What is the numerical/machine code for storing from the accumulator?
    3
  • What does the STORE instruction do in LMC?
    Stores accumulator contents to a mailbox
  • What is the mnemonic for the ADD instruction?
    ADD
  • What is the numerical/machine code for the ADD instruction?
    1
  • What does the ADD instruction do in LMC?
    Adds mailbox contents to the accumulator
  • What happens if the ADD instruction results in a sum larger than 3 digits?
    The actions of the accumulator are undefined
  • What is the mnemonic for the SUBTRACT instruction?
    SUB
  • What is the numerical/machine code for the SUBTRACT instruction?
    2
  • What does the SUBTRACT instruction do in LMC?
    Subtracts mailbox contents from the accumulator
  • What happens if the SUBTRACT instruction results in a negative result?
    A negative flag will be set
  • What is the mnemonic for the INPUT instruction?

    INP
  • What is the numerical/machine code for the INPUT instruction?
    901
  • What does the INPUT instruction do in LMC?
    Copies value from "in box" to accumulator
  • What is the mnemonic for the OUTPUT instruction?
    OUT
  • What is the numerical/machine code for the OUTPUT instruction?
    902
  • What does the OUTPUT instruction do in LMC?
    Copies accumulator value to "out box"
  • What is the mnemonic for the END program instruction?
    HLT
  • What is the numerical/machine code for the END program instruction?
    000
  • What does the HLT instruction do in LMC?
    Stops executing the program
  • What is the mnemonic for the BRANCH IF ZERO instruction?
    BRZ
  • What is the numerical/machine code for the BRANCH IF ZERO instruction?
    7
  • What does the BRZ instruction do in LMC?
    Branches if accumulator is zero
  • What is the mnemonic for the BRANCH IF ZERO OR POSITIVE instruction?
    BRP
  • What is the numerical/machine code for the BRANCH IF ZERO OR POSITIVE instruction?
    8
  • What does the BRP instruction do in LMC?
    Branches if accumulator is zero or positive
  • What is the mnemonic for the BRANCH ALWAYS instruction?
    BRA
  • What is the numerical/machine code for the BRANCH ALWAYS instruction?
    6
  • What does the BRA instruction do in LMC?
    Branches to the given address
  • What is the mnemonic for the DATA LOCATION instruction?
    DAT
  • What does the DAT instruction do in LMC?
    Reserves the next mailbox for data storage
  • What is the summary of LMC instructions and their codes?
    • Load: LDA, 5xx
    • Store: STA, 3xx
    • Add: ADD, 1xx
    • Subtract: SUB, 2xx
    • Input: INP, 901
    • Output: OUT, 902
    • End: HLT, 000
    • Branch if zero: BRZ, 7xx
    • Branch if zero or positive: BRP, 8xx
    • Branch always: BRA, 6xx
    • Data storage: DAT