Smart Card Solution
User Manual
- R502 Manual
JavaCard API Samples
- Algorithm
Java Card Specification
Knowledge Sharing
Smart Card Solution
User Manual
JavaCard API Samples
Java Card Specification
Knowledge Sharing
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:
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.