Local variable handling



      bfixup      bload      bstore      dfixup
      ffixup      iload      iload_<n>      istore
      istore_<n>      maddr      mk_local_1      mk_local_2
      mk_local_3      mk_local_n      mload      mstore
      pload      pload_<n>      pstore      pstore_<n>
      sfixup      waddr  


 bfixup 
  ·  OperationFix up int8 variable
  ·  Format
bfixup
N[1]
wide
bfixup
N[4]
  ·  Direct Format
{bfixup}
N
  ·  Forms bfixup = 25 (0x19)
   · Description Retrieve the contents of position N in the local variable frame, truncate the value to 8 bits and write it back to the same variable. The destination is aligned at the start of the stack word that contains the variable.
   · Notes This instruction is used to align int8 and uint8 values that were passed as arguments to the current method.

The result is guaranteed to be aligned on the start of a stack word so that waddr M will push the correct address of the byte.

This instruction is not normally required on little-endian platforms, but it is definitely required on big-endian platforms.

The contents of an int8 argument can be fetched using waddr N, bread once bfixup has been used to align its contents.



 bload 
  ·  OperationLoad uint8 variable onto the stack
  ·  Format
bload
N[1]
  ·  Direct Format
{bload}
N
  ·  Forms bload = 250 (0xFA)
  ·  Stack... => ..., value
   · Description Load the uint8 variable from position N in the local variable frame and push its value onto the stack.
   · Notes This instruction is a quicker variant of waddr N, bread.

This instruction can also be used to load bool values onto the stack.



 bstore 
  ·  OperationStore the top of stack into uint8 variable
  ·  Format
bstore
N[1]
  ·  Direct Format
{bstore}
N
  ·  Forms bstore = 251 (0xFB)
  ·  Stack..., value => ...
   · Description Pop value from the stack as type int32 and store it at position N in the local variable frame, truncated to the type uint8.
   · Notes This instruction is a quicker variant of waddr N, bwrite_r.

This instruction can also be used to store bool values from the stack.



 dfixup 
  ·  OperationFix up float64 variable
  ·  Format
dfixup
N[1]
wide
dfixup
N[4]
  ·  Direct Format
{dfixup}
N
  ·  Forms dfixup = 28 (0x1C)
   · Description Retrieve the contents of position N in the local variable frame as type native float, truncate the value to float64 and write it back to the same variable. The destination is aligned at the start of the stack word that contains the variable.
   · Notes This instruction is used to convert native float values that were passed as arguments to the current method into the float64 for internal local variable access.

The result is guaranteed to be aligned on the start of a stack word so that waddr M will push the correct address of the float64 value.

The contents of a float64 argument can be fetched using waddr N, dread once dfixup has been used to convert its contents.



 ffixup 
  ·  OperationFix up float32 variable
  ·  Format
ffixup
N[1]
wide
ffixup
N[4]
  ·  Direct Format
{ffixup}
N
  ·  Forms ffixup = 27 (0x1B)
   · Description Retrieve the contents of position N in the local variable frame as type native float, truncate the value to float32 and write it back to the same variable. The destination is aligned at the start of the stack word that contains the variable.
   · Notes This instruction is used to convert native float values that were passed as arguments to the current method into the float32 for internal local variable access.

The result is guaranteed to be aligned on the start of a stack word so that waddr M will push the correct address of the float32 value.

The contents of a float32 argument can be fetched using waddr N, fread once ffixup has been used to convert its contents.



 iload 
  ·  OperationLoad int32 variable onto the stack
  ·  Format
iload
N[1]
wide
iload
N[4]
  ·  Direct Format
{iload}
N
  ·  Forms iload = 5 (0x05)
  ·  Stack... => ..., value
   · Description Load the int32 variable from position N in the local variable frame and push its value onto the stack.
   · Notes This instruction can also be used to load variables of type uint32 onto the stack.


 iload_<n> 
  ·  OperationLoad int32 variable n onto the stack
  ·  Format
iload_<n>
  ·  Direct Format
{iload_<n>}
  ·  Forms iload_0 = 1 (0x01)
iload_1 = 2 (0x02)
iload_2 = 3 (0x03)
iload_3 = 4 (0x04)
  ·  Stack... => ..., value
   · Description Load the int32 variable from position n in the local variable frame and push its value onto the stack.
   · Notes These instructions can also be used to load variables of type uint32 onto the stack.


 istore 
  ·  OperationStore the top of stack into int32 variable
  ·  Format
istore
N[1]
wide
istore
N[4]
  ·  Direct Format
{istore}
N
  ·  Forms istore = 15 (0x0F)
  ·  Stack..., value => ...
   · Description Pop value from the stack as type int32 and store it at position N in the local variable frame.
   · Notes This instruction can also be used to store to variables of type uint32.


 istore_<n> 
  ·  OperationStore the top of stack into int32 variable n
  ·  Format
istore_<n>
  ·  Direct Format
{istore_<n>}
  ·  Forms istore_0 = 11 (0x0B)
istore_1 = 12 (0x0C)
istore_2 = 13 (0x0D)
istore_3 = 14 (0x0E)
  ·  Stack..., value => ...
   · Description Pop value from the stack as type int32 and store it at position n in the local variable frame.
   · Notes These instructions can also be used to store to variables of type uint32.


 maddr 
  ·  OperationLoad the address of a stack word onto the stack
  ·  Format
maddr
N[1]
wide
maddr
N[4]
  ·  Direct Format
{maddr}
N
  ·  Forms maddr = 24 (0x18)
  ·  Stack... => ..., pointer
   · Description Set pointer to the address of the word at N positions down the stack. Push pointer onto the stack as type ptr. N == 1 indicates the address of the top-most stack word prior to the operation.
   · Notes This instruction is typically used to get the address of a managed value on the stack, so that the value can be manipulated with pointer operations.


 mk_local_1 
  ·  OperationMake one local variable slot
  ·  Format
mk_local_1
  ·  Direct Format
{mk_local_1}
  ·  Forms mk_local_1 = 29 (0x1D)
  ·  Stack... => ..., zero
   · Description Push a single zeroed word onto the stack.
   · Notes This instruction is used to allocate local variable space at the start of a method.


 mk_local_2 
  ·  OperationMake two local variable slots
  ·  Format
mk_local_2
  ·  Direct Format
{mk_local_2}
  ·  Forms mk_local_2 = 30 (0x1E)
  ·  Stack... => ..., zero1, zero2
   · Description Push two zeroed words onto the stack.
   · Notes This instruction is used to allocate local variable space at the start of a method.


 mk_local_3 
  ·  OperationMake three local variable slots
  ·  Format
mk_local_3
  ·  Direct Format
{mk_local_3}
  ·  Forms mk_local_3 = 31 (0x1F)
  ·  Stack... => ..., zero1, zero2, zero3
   · Description Push three zeroed words onto the stack.
   · Notes This instruction is used to allocate local variable space at the start of a method.


 mk_local_n 
  ·  OperationMake N local variable slots
  ·  Format
mk_local_n
N[1]
wide
mk_local_n
N[4]
  ·  Direct Format
{mk_local_n}
N
  ·  Forms mk_local_n = 32 (0x20)
  ·  Stack... => ..., zero1, ..., zeroN
   · Description Push N zeroed words onto the stack.
   · Notes This instruction is used to allocate local variable space at the start of a method.


 mload 
  ·  OperationLoad multiple stack words from a variable onto the stack
  ·  Format
mload
N[1]
M[1]
wide
mload
N[4]
M[4]
  ·  Direct Format
{mload}
N
M
  ·  Forms mload = 21 (0x15)
  ·  Stack... => ..., value1, ..., valueM
   · Description Load the M stack words from position N in the local variable frame and push them onto the stack.


 mstore 
  ·  OperationStore multiple stack words from the stack to a variable
  ·  Format
mstore
N[1]
M[1]
wide
mstore
N[4]
M[4]
  ·  Direct Format
{mstore}
N
M
  ·  Forms mstore = 22 (0x16)
  ·  Stack..., value1, ..., valueM => ...
   · Description Pop the M stack words from the top of the stack and store them at position N in the local variable frame.


 pload 
  ·  OperationLoad ptr variable onto the stack
  ·  Format
pload
N[1]
wide
pload
N[4]
  ·  Direct Format
{pload}
N
  ·  Forms pload = 10 (0x0A)
  ·  Stack... => ..., value
   · Description Load the ptr variable from position N in the local variable frame and push its value onto the stack.
   · Notes This instruction must not be confused with iload. Values of type int32 and ptr do not necessarily occupy the same amount of space in a stack word on all platforms.


 pload_<n> 
  ·  OperationLoad ptr variable n onto the stack
  ·  Format
pload_<n>
  ·  Direct Format
{pload_<n>}
  ·  Forms pload_0 = 6 (0x06)
pload_1 = 7 (0x07)
pload_2 = 8 (0x08)
pload_3 = 9 (0x09)
  ·  Stack... => ..., value
   · Description Load the ptr variable from position n in the local variable frame and push its value onto the stack.
   · Notes These instructions must not be confused with the iload_<n> instructions. Values of type int32 and ptr do not necessarily occupy the same amount of space in a stack word on all platforms.


 pstore 
  ·  OperationStore the top of stack into ptr variable
  ·  Format
pstore
N[1]
wide
pstore
N[4]
  ·  Direct Format
{pstore}
N
  ·  Forms pstore = 20 (0x14)
  ·  Stack..., value => ...
   · Description Pop value from the stack as type ptr and store it at position N in the local variable frame.
   · Notes This instructions must not be confused with istore. Values of type int32 and ptr do not necessarily occupy the same amount of space in a stack word on all platforms.


 pstore_<n> 
  ·  OperationStore the top of stack into ptr variable n
  ·  Format
pstore_<n>
  ·  Direct Format
{pstore_<n>}
  ·  Forms pstore_0 = 16 (0x10)
pstore_1 = 17 (0x11)
pstore_2 = 18 (0x12)
pstore_3 = 19 (0x13)
  ·  Stack..., value => ...
   · Description Pop value from the stack as type ptr and store it at position n in the local variable frame.
   · Notes These instructions must not be confused with the istore_<n> instructions. Values of type int32 and ptr do not necessarily occupy the same amount of space in a stack word on all platforms.


 sfixup 
  ·  OperationFix up int16 variable
  ·  Format
sfixup
N[1]
wide
sfixup
N[4]
  ·  Direct Format
{sfixup}
N
  ·  Forms sfixup = 26 (0x1A)
   · Description Retrieve the contents of position N in the local variable frame, truncate the value to 16 bits and write it back to the same variable. The destination is aligned at the start of the stack word that contains the variable.
   · Notes This instruction is used to align int16 and uint16 values that were passed as arguments to the current method.

The result is guaranteed to be aligned on the start of a stack word so that waddr M will push the correct address of the 16 bit value.

This instruction is not normally required on little-endian platforms, but it is definitely required on big-endian platforms.

The contents of an int16 argument can be fetched using waddr N, sread once sfixup has been used to align its contents.



 waddr 
  ·  OperationLoad the address of a variable onto the stack
  ·  Format
waddr
N[1]
wide
waddr
N[4]
  ·  Direct Format
{waddr}
N
  ·  Forms waddr = 23 (0x17)
  ·  Stack... => ..., pointer
   · Description Set pointer to the address of the word at position N in the local variable frame. Push pointer onto the stack as type ptr.


Copyright © Southern Storm Software Pty Ltd 2002
Licensed under GNU FDL