80.

prev next contents
goto_w

branch to address using wide offset

Jasmin Syntax
     goto_w <label> 
<label> is a label name. To define the location of the label, use the <label> name followed by a colon:
 <label>: 
<label> then becomes associated the address of the following instruction. Labels can only be assigned one location in a method. On the other hand, a single <label> can be the target of multiple branch instructions.

Stack

Before

After
...
...
Description

Causes execution to branch to the instruction at the address (pc + branchoffset), where pc is the address of the goto_w opcode in the bytecode and branchoffset is a 32-bit signed integer parameter that follows the goto_w opcode in the bytecode. If you are using Jasmin, branchoffset is determined for you from the address associated with <label>.

Bytecode

Type

Description
u1
goto_w opcode = 0xC8 (200)
s4
branchoffset
See Also

goto, jsr, jsr_w

Notes

1. goto_w is identical to goto, except that a 32-bit signed integer branchoffset is used instead of a 16-bit branchoffset.

2. In Jasmin, goto and goto_w are synonymous, since the Jasmin assembler automatically decides which version of the instruction to use, based on the address of the<label>.

3. Addresses are measured in bytes from the start of the bytecode - i.e. address 0 is the first byte in the bytecode of the currently executing method. The maximum address in a method is 65535.


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