110.

prev next contents
lcmp

long integer comparison

Jasmin Syntax
     lcmp 
Stack

Before

After
value1-word1
int-result
value1-word2
...
value2-word1

value2-word2

...

Description

Takes two two-word long integers off the stack and compares them. If the two integers are the same, the int 0 is pushed onto the stack. If value2 is greater than value1, the int 1 is pushed onto the stack. If value1 is greater than value2, the int -1 is pushed onto the stack.

Example

 ; This is like the Java expression: ;     (x > 0) ; where x is a long. lload_1       ; push the long int in local variable 1 lconst_0      ; push the long integer 0 onto the stack lcmp          ; compare the two long integers ; The integer result on the stack is: ;     0 if local variable 1 equals 0 ;     -1 if local variable 1 is less than 0 ;     1 if local variable 1 is greater than 0 
Bytecode

Type

Description
u1
lcmp opcode = 0x94 (148)
See Also

fcmpl, fcmpg, dcmpl, dcmpg


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates


Java Virtual Machine
Java Virtual Machine (Java Series)
ISBN: 1565921941
EAN: 2147483647
Year: 1996
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net