442
Under the Hood
M
T
W
R
F
S
S
DAY
DAY
21
P2/V4 /sqc7 TY Java in 21 Days 030-4 Casey 12.29.95 Ch21 LP#4
isub ..., v1, v2 => ..., result
lsub ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
fsub ..., v1, v2 => ..., result
dsub ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
v1 and v2 must be <type>s. v2 is subtracted from v1, and both vs are replaced on the stack by
their
<type> difference. <type> is, in turn, int, long, float, and double.
imul ..., v1, v2 => ..., result
lmul ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
fmul ..., v1, v2 => ..., result
dmul ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
v1 and v2 must be <type>s. Both vs are replaced on the stack by their <type> product. <type> is,
in turn,
int, long, float, and double.
idiv ..., v1, v2 => ..., result
ldiv ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
fdiv ..., v1, v2 => ..., result
ddiv ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
v1 and v2 must be <type>s. v2 is divided by v1, and both vs are replaced on the stack by their
<type> quotient. An attempt to divide by zero results in an ArithmeticException being thrown.
<type> is, in turn, int, long, float, and double.
irem ..., v1, v2 => ..., result
lrem ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
frem ..., v1, v2 => ..., result
drem ..., v1-word1, v1-word2, v2-word1, v2-word2 => ..., r-word1, r-word2
v1 and v2 must be <type>s. v2 is divided by v1, and both vs are replaced on the stack by their
<type> remainder. An attempt to divide by zero results in an ArithmeticException being
thrown.
<type> is, in turn, int, long, float, and double.
ineg ..., value => ..., result
lneg ..., value-word1, value-word2 => ..., result-word1, result-word2
fneg ..., value => ..., result
dneg ..., value-word1, value-word2 => ..., result-word1, result-word2
value must be a <type>. It is replaced on the stack by its arithmetic negation. <type> is, in turn,
int, long, float, and double.
Note: Now that you’re familiar with the look of the bytecodes, the summaries that
follow will become shorter and shorter (for space reasons). You can always get any
desired level of detail from the full virtual machine specification in the latest Java
release.
030-4s CH21.i 1/29/96, 1:13 PM442