82.

prev next contents
i2c

convert integer to character

Jasmin Syntax
     i2c 
Stack

Before

After
value
result
...
...
Description

Converts an integer to a 16-bit unsigned char. A 32-bit int is popped off the stack, the top 16 bits are set to zero and the resulting int value is pushed back onto the stack.

i2c is used in Java when there is an explicit cast between an int and a char. Notice that i2c produces an unsigned value - any sign bit for the original number is lost. For example, in the code:

     int x = -1;     char c = (char)x; 
The value of c is positive 0xFFFF.

Bytecode

Type

Description
u1
i2c opcode = 0x92 (146)
See Also

i2b, i2s


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