Chapter 14 - Assembly Language
暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。
卡片预览 (18 张)
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 Adds the contents of the memory address to the accumulator
Instruction: Subtract
Mnemonic: SUB Subtracts the contents of the memory address from the accumulator
Instruction: Store
Mnemonic: STA Stores the value in the accumulator in the memory address given
Instruction: Load
Mnemonic: LDA Load the accumulator with the contents of the memory address given.
Instruction: Branch (always) (uncondictional)
Mnemonic: BRA Branch - always uses the address given as the address of the next instruction (by changing PC).
Instruction: Branch if zero
Mnemonic: BRZ Branch to the address given if the accumulator is zero
Instruction: Branch If Positive
Mnemonic: BRP Branch to the address given if the accumulator is zero or positive
Instruction: Input
Mnemonic: INP Input into the accumulator
Instruction: Output
Mnemonic: OUT Output contents of the accumulator
Instruction: Halt
Mnemonic: HLT Stops the execution of the program
Instruction: Data
Mnemonic: DAT 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)
Addressing mode (detail)
intermediate addressing: the operand is the actual value upon which the instruction is to be performed upon direct addressing: the operand holds the memory address location of the value to be operated upon (only mode available in LMC) indirect addressing: the operand is the location (typically a register) which holds the address we want - a larger range of accessible locations indexed addressing: the address of the operand is obtained by adding the contents of a general register (index register) to a constant value. Included in istruction code and used to access arrays with successive order
General use of LMC
When you write something in LMC, the specific line you write it on means that it gets stored within that memory address location in RAM.
Explain the buses and registers when the line SUB ONE is executed (exam question).