LMC + addressing Flashcards
ADD xx
Add the number at location xx to the accumulator
SUB xx
Subtract number at location xx from accumulator
STA xx
Store the number in the accumulator in location xx
LDA xx
load the number in location xx to the accumulator
BRA xx
BRANCH: Jump the PC to the new memory location
BRZ xx
Branch if the number in the accumulator is zero
BRP xx
Branch if the number in the accumulator is positive
INPUT
Move data from INPUT into the accumulator
OUTPUT
Move data from the accumulator into OUTPUT
HLT
HALT stop the program
DAT xx is not a command what does it mean?
DAT tells you that the location is holding data not instructions
The programmer must make sure the program halts or jumps over any data
Explain how named locations can be used in LMC programs
alternate to numbered memory locations
any location can be given a short name
the names can be used instead of location numbers in the program. this makes it easier to write.
immediate addressing
the data itself
direct addressing
memory location
indirect addressing
location holds a pointer to somwhere else in RAM