+=                Add an immediate value or a variable to another variable

Syntax                        

VAR16 += value16

add to VAR16 value16

VAR16D += VAR16S

add to VAR16D the VAR16S value

VAR32 += value32

add to VAR32 value32

VAR32D += VAR32S

add to VAR32D the VAR32S value

 

OperandsVAR16D: destination integer variable

VAR16S: source integer variable

VAR32D: destination long/fixed variable

VAR32D: source long/fixed variable

value16:  16-bit immediate integer value

value32:  32-bit immediate long value

PlaceTMLOnline

Binary code

DescriptionAdds a 16-bit / 32-bit immediate value or the value of the 16-bit / 32-bit source variable to the 16-bit / 32-bit destination variable. The instructions use a 9-bit short address for the destination variable. Bit value X specifies the destination address range:

Addressrange

 

Execution        Destination variable = destination variable + immediate value or source variable

       

Example                

int Var1, Var2, Var3;

               long Var10, Var11, Var12;

               ...

Var1 +=  125;

Var3 += Var2;

Var10 += 128000;

Var12 += Var11;

 

Before instruction

 

After instruction

Var1

1256

 

Var1

1381

Var2

-22450

 

Var2

-22450

Var3

22500

 

Var3

50

Var10

-1201

 

Var10

126799

Var11

25

 

Var11

25

Var12

12500

 

Var12

12525