Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.38_if_scmp_cond_w

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:

  • eq succeeds if and only if value1 = value2
  • ne succeeds if and only if value1 value2
  • lt succeeds if and only if value1 < value2
  • le succeeds if and only if value1 &#163; value2
  • gt succeeds if and only if value1 > value2
  • ge succeeds if and only if value1 &#8805; value2

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.

javacard/jcvm/7.5.38_if_scmp_cond_w.txt · Last modified: 2017/05/13 04:11 (external edit)