Chapter 14 - Assembly Language Flashcards
What is a mnemonic
A mnemonic is a letter representation of machine code
What is a numeric code?
Describe 1xx
A numeric code consists of 3 characters. ADD’s numeric code is 1xx. The first character is an OP code (which defines the function of mnemonic) and the xx is the operand which describes the memory address/value the OP code functions upon.
Instruction: Add
Mnemonic: ADD
Numeric code: 1xx
Adds the contents of the memory address to the accumulator
Instruction: Subtract
Mnemonic: SUB
Numeric code: 2xx
Subtracts the contents of the memory address from the accumulator
Instruction: Store
Mnemonic: STA
Numeric code: 3xx
Stores the value in the accumulator in the memory address given
Instruction: Load
Mnemonic: LDA
Numeric code: 5xx
Load the accumulator with the contents of the memory address given.
Instruction: Branch (always) (uncondictional)
Mnemonic: BRA
Numeric code: 6xx
Branch - always uses the address given as the address of the next instruction (by changing PC).
Instruction: Branch if zero
Mnemonic: BRZ
Numeric code: 7xx
Branch to the address given if the accumulator is zero
Instruction: Branch If Positive
Mnemonic: BRP
Numeric code: 8xx
Branch to the address given if the accumulator is zero or positive
Instruction: Input
Mnemonic: INP
Numeric code: 901
Input into the accumulator
Instruction: Output
Mnemonic: OUT
Numeric code: 902
Output contents of the accumulator
Instruction: Halt
Mnemonic: HLT
Numeric code: 0
Stops the execution of the program
Instruction: Data
Mnemonic: DAT
Numeric code: n/a
Used to indicate a location that contains data.
Which LMC instructions allow you to change the Program Counter (PC)
Branch (unconditional) - BRA, Branch if zero (conditional) - BRZ, Branch if positive (conditional) - BRP.
Addressing mode (overview)
The last 2 digits within the operation code (OP code)