Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.37_if_scmp_cond

7.5.37 if_scmp<cond>

Branch if short comparison succeeds

Format

if_scmp

branch

Forms

if_scmpeq = 106 (0x6a) if_scmpne = 107 (0x6b) if_scmplt = 108 (0x6c) if_scmpge = 109 (0x6d) if_scmpgt = 110 (0x6e) if_scmple = 111 (0x6f)

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, branch is used as signed 8-bit offset, and execution proceeds at that offset from the address of the opcode of this if_scmp instruction. The target address must be that of an opcode of an instruction within the method that contains this if_scmp instruction.

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

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