Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.40_if_cond_w

7.5.40 if<cond>_w

Branch if short comparison with zero succeeds (wide index)

Format

if_w

branchbyte1

branchbyte2

Forms

ifeq_w = 152 (0x98) ifne_w = 153 (0x99) iflt_w = 154 (0x9a) ifge_w = 155 (0x9b) ifgt_w = 156 (0x9c) ifle_w = 157 (0x9d)

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, 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_w instruction.

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

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