# binop

## Purpose

Perform the identified binary operation on the two source registers, storing the result in the first source register.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
90..af 23x | binop vAA, vBB, vCC 90: add-int 91: sub-int 92: mul-int 93: div-int 94: rem-int 95: and-int 96: or-int 97: xor-int 98: shl-int 99: shr-int 9a: ushr-int 9b: add-long 9c: sub-long 9d: mul-long 9e: div-long 9f: rem-long a0: and-long a1: or-long a2: xor-long a3: shl-long a4: shr-long a5: ushr-long a6: add-float a7: sub-float a8: mul-float a9: div-float aa: rem-float ab: add-double ac: sub-double ad: mul-double ae: div-double af: rem-double | `A:` destination register or pair (8 bits) `B:` first source register or pair (8 bits) `C:` second source register or pair (8 bits)

## Constraints

- All A, B and C must be valid register indices in the current stackframe.
- For the -long and -double variants, also A+1, B+1 and C+1 must be valid register indices.
- Registers vB and vC must be defined. They must both contain values that match the variant of the instruction (it's probably better to split this up into multiple pages again).

## Behavior

- The given operation <binop> is performed according to the semantics specified in table XXX.
- The result is stored in register vA, that is, vA'=<biop> vB.
- For the -double and -long variants, (vA+1) is also affected.
- As usual, neighboring registers might get undefined, if vA (and vA+1) were part of a register pair originally.

## Exceptions

- ArithmeticException if an error occurs during the instruction.