# binop/lit8

## Purpose

Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
d8..e2 22b | binop/lit8 vAA, vBB, #+CC d8: add-int/lit8 d9: rsub-int/lit8 da: mul-int/lit8 db: div-int/lit8 dc: rem-int/lit8 dd: and-int/lit8 de: or-int/lit8 df: xor-int/lit8 e0: shl-int/lit8 e1: shr-int/lit8 e2: ushr-int/lit8 | `A:` destination register (8 bits) `B:` source register (8 bits) `C:` signed int constant (8 bits)

## Constraints

- Both A and B must be valid register indices in the current stackframe.
- Registers vA and vB must be defined. They must both contain integer values.
- C is an immediate, signed integer constant taken from the instruction stream (actually this means there are no special requirements for C at all).

## Behavior

- The given operation <binop> is performed according to the semantics specified in table XXX.
- Argument C is sign-extended to 32 bits before.
- The result is stored in register vA, that is, vA'=vB <binop> vC.
- As usual, neighboring registers might get undefined, if vA was part of a register pair originally.

## Exceptions

- ArithmeticException if an error occurs during the instruction.