-=                Subtract an immediate value or a variable from another variable

Syntax                        

VAR16 -= value16

subtract from VAR16 value16

VAR16D -= VAR16S

subtract from VAR16D VAR16S value

VAR32 -= value32

subtract from VAR32 value32

VAR32D -= VAR32S

subtract from VAR32D VAR32S value

 

OperandsVAR16D: destination integer variable

       VAR16S: source integer variable

VAR32D: destination long/fixed variable

VAR32S: source long/fixed variable

value16:  16-bit immediate integer value

value32:  32-bit immediate long value

PlaceTMLOnline

Binary code

 

DescriptionSubtracts a 16-bit / 32-bit immediate value or the value of the 16-bit / 32-bit source variable from 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

1131

Var2

-22450

 

Var2

-22450

Var3

22500

 

Var3

44950

Var10

-1201

 

Var10

-129201

Var11

25

 

Var11

25

Var12

12500

 

Var12

12475