Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.39_if_cond

7.5.39 if<cond>

Branch if short comparison with zero succeeds

Format

if

branch

Forms

ifeq = 96 (0x60) ifne = 97 (0x61) iflt = 98 (0x62) ifge = 99 (0x63) ifgt = 100 (0x64) ifle = 101 (0x65)

Stack

…, value → …

Description

The value must be of type short. It is popped from the operand stack and compared against zero. All comparisons are signed. The results of the comparisons are as follows:

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

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 instruction. The target address must be that of an opcode of an instruction within the method that contains this if instruction.

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

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