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 (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:
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.