Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.65_isub

7.5.65 isub

Subtract int

Format

isub

Forms

isub = 68 (0x44)

Stack

…, value1.word1, value1.word2, value2.word1, value2.word2 → …, result.word1, result.word2

Description

Both value1 and value2 must be of type int. The values are popped from the operand stack. The int result is value1 - value2. The result is pushed onto the operand stack.

For int subtraction, a - b produces the same result as a + (-b). For int values, subtraction from zeros is the same as negation.

Despite the fact that overflow or underflow may occur, in which case the result may have a different sign than the true mathematical result, execution of an isub instruction never throws a runtime exception.

Notes

If a virtual machine does not support the int data type, the isub instruction will not be available.

javacard/jcvm/7.5.65_isub.txt · Last modified: 2017/05/13 04:09 (external edit)