Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual NdbInterpretedCode::sub_reg()

Description.  This method gets the difference between the values stored in any two given registers and stores the result in a third register.


int sub_reg
      Uint32 RegDest,
      Uint32 RegSource1,
      Uint32 RegSource2

Parameters.  This method takes three parameters. The first of these is the register in which the result is to be stored (RegDest). The second and third parameters (RegSource1and RegSource2) are the registers whose values are to be subtracted. In other words, the value of register RegDest is calculated as the value of the expression shown here:

(value in register RegSource1) − (value in register RegSource2)

It is possible to re-use one of the registers whose values are subtracted for storing the result; that is, RegDest can be the same as RegSource1 or RegSource2.

Return value.  0 on success; -1 on failure.