ADD - Add X to the Accumulator Command

Adds the argument to the value currently in the accumulator value and stores it in the accumulator.

Syntax

ADD x
Where "x" is the value or memory location you want to add to the accumulator. You may use a raw value (hex or decimal), tilde memory, task port, or persistent memory.

Example

{
LDA #33    //Load a value of 1 into the accumulator
ADD #10   //Add 10 to the value in the Accumulator
STA ~4    //Store the new value of 43 into tilde memory ~4

LDA ~5    //Copy the value in tilde 5 to the Accumulator
ADD #10   //Add the fixed decimal value 10 to the value in the Accumulator

LDA ~5    //Copy the value in tilde 5 to the Accumulator
ADD #0x13 //Add the fixed decimal value 18 to the value in the Accumulator

LDA ~3    //Load the value from ~3 into the accumulator
ADD #5    //Add the fixed decimal value 5 to the value in the Accumulator
STA ~3    //Store the value of 5 plus the previous value back into ~3

LDA ~3    //Load the value from ~3 into the accumulator
ADD $14   //Add the value in persistent memory 14.
STA ~3    //Store the new value back into ~3

LDA #0    //Load the value from 0
ADD ~14   //Add the value in tilde memory 14.
STA ~3    //Store the value into ~3
}