Assembly Flashcards
Define INP
Inputs a value and stores it in the accumulator
Define OUT
Displays the contents of the accumulator
Define STA …
Moves the contents of the accumulator to a specified RAM address
Define LDA …
Moves the contents of a specified RAM address to the accumulator (LoaD Accumulator)
Define ADD …
Adds the contents of the accumulator to the contents of the specified RAM address
Define SUB …
Subtracts the contents of the accumulator from the contents of a specified RAM address
Define BRA
Jumps to a specified part of the code- used to
loop continuously (BRanch Always)
Define … DAT
Defines variables previously used in the code e.g the RAM addresses in the STA command. Always at the end of the code
Define HLT
Stops the processor
Code to add two numbers
INP
STA a
INP
ADD a
OUT
HLT
a DAT
Code to subtract a from b
INP
STA a
INP
STA b
LDA a
SUB b
OUT
HLT
a DAT
b DAT
3 benefits of assembly language
Less memory and execution time
Interacts directly with hardware
Suitable for time critical processes