7.5.38 if_scmp<cond>_w

Branch if short comparison succeeds (wide index)

Format

if_scmp_w

branchbyte1

branchbyte2

Forms

if_scmpeq_w = 162 (0xa2) if_scmpne_w = 163 (0xa3) if_scmplt_w = 164 (0xa4) if_scmpge_w = 165 (0xa5) if_scmpgt_w = 166 (0xa6) if_scmple_w = 167 (0xa7)

Stack

…, value1, value2 → …

Description

Both value1 and value2 must be of type short. They are both popped from the operand stack and compared. All comparisons are signed. The results of the comparisons are as follows:

If the comparison succeeds, the unsigned bytes branchbyte1 and branchbyte2 are used to construct a signed 16-bit branchoffset, where branchoffset is (branchbyte1 _w instruction. The target address must be that of an opcode of an instruction within the method that contains this if_scmp_w instruction.

Otherwise, execution proceeds at the address of the instruction following this if_scmp_w instruction.