13.07.2015 Views

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

The PowerPC 604 RISC Microprocessor - eisber.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.13 Table JumpingtableswitchAccess jump table by index and jumpSyntax:Stack . index => .rublesivitch = 170...0-3 bitedefault-offsetldefaillt•offse ►2defatilt•offtetidefaiiii•affset4lowlinty2luiv3luiv4high!high?high3high4. lung) off.tef J. .tableswitch is a variable length instruction. Immediately after the tabl eswi t ch instruction,between zero and three 0's are inserted as padding so that the next byte be gins at an address that is amultiple of four. After the padding follow a series of signed 4-byte quantities: default-offset, low, high,and then high-low+ I further signed 4-byte offsets. <strong>The</strong> high -low+ I signed 4-byte offsets are treated as a0-based jump table.<strong>The</strong> index must be an integer. If index is less than low or index is greater than high, then default-offset isadded to the address of this instruction. Otherwise, low is subtracted from index, and the index -tolu'thelement of the jump table is extracted, and added to the address of this instruction.lookupswitchAccess jump table by key match and jumpSyntax:Stack: ..., key =>rookurrivirch = 171...0-3 byte pad...defuitlt-offset Idefault-off-seadefault-offset 3default-offset4;woks Itipairs2titlars)lipulrs4..ruutch•offsetlookupswitch is a variable length instruction. Immediately after the lookunswi t eh instruction,between zero and three 0's are inserted as padding so that the next byte begins at an address that is amultiple of four.Immediately after the padding are a series of pairs of signed 4-byte quantities. <strong>The</strong> first pair is special<strong>The</strong> first item of that pair is the default offset, and the second item of that pair gives the number ofpairs that follow. Each subsequent pair consists of a snatch and an offset.<strong>The</strong> key must be an integer. <strong>The</strong> integer key on the stack is compared against each of the snatches. If it isequal to one of them, the offset is added to the address of this instruction. If the key dues not match anyof the matches, the default offset is added to the address of this instruction3.14 Manipulating Object FieldsputfieldSet field in objectSyntax:',infield = 181indexb)te Iitulexb)te2Stack . , objectref, valueORStack: ..., objectref, value - wordl, value - tvord2 =>indexbytel and andexbyte2 are used to construct an index into the constant pool of the current class. <strong>The</strong>constant pool item will be a field reference to a class name and a field name. the item is resolved to afield block pointer which has both the field width (in bytes) and the field offset (in bytes)<strong>The</strong> field at that offset from the start of the object referenced by object ref will be set to the value on thetop of the stack.This instruction deals with both 32-bit and 64•bil wide fields.If objectref is nu 1 1, a Nu). 1 Point er Except ion is generated.If the specified field is a static field, an I ncompa t ibleCI a ssChangeEr ror is thrown.Aultusi U. 1995 1AVA VillUAI Machine Specification 1AVA VilittAl Machine Atop.1 17 1555

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!