Pointer handling



      bread      bwrite      bwrite_r      dread
      dwrite      dwrite_r      fread      fwrite
      fwrite_r      iread      iwrite      iwrite_r
      mread      mwrite      mwrite_r      padd_i4
      padd_i4_r      padd_i8      padd_i8_r      padd_offset
      padd_offset_n      pread      psub      psub_i4
      psub_i8      pwrite      pwrite_r      sread
      swrite      swrite_r      ubread      usread


 bread 
  ·  OperationRead int8 from pointer
  ·  Format
bread
  ·  Direct Format
{bread}
  ·  Forms bread = 33 (0x21)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 8 bit value at pointer in memory, sign-extend it to int32 and push it onto the stack.


 bwrite 
  ·  OperationWrite int8 to pointer
  ·  Format
bwrite
  ·  Direct Format
{bwrite}
  ·  Forms bwrite = 42 (0x2A)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and int32 respectively. Truncate value to 8 bits and write it to pointer in memory.
   · Notes This instruction can also be used to write values of type uint8 to memory.


 bwrite_r 
  ·  OperationWrite int8 to pointer with reversed arguments
  ·  Format
bwrite_r
  ·  Direct Format
{bwrite_r}
  ·  Forms bwrite_r = 49 (0x31)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types int32 and ptr respectively. Truncate value to 8 bits and write it to pointer in memory.
   · Notes This instruction can also be used to write values of type uint8 to memory.


 dread 
  ·  OperationRead float64 from pointer
  ·  Format
dread
  ·  Direct Format
{dread}
  ·  Forms dread = 39 (0x27)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 64 bit float64 value at pointer in memory, extend it to native float, and push it onto the stack.


 dwrite 
  ·  OperationWrite float64 to pointer
  ·  Format
dwrite
  ·  Direct Format
{dwrite}
  ·  Forms dwrite = 46 (0x2E)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and native float respectively. Truncate value to float64 and write it to pointer in memory.


 dwrite_r 
  ·  OperationWrite float64 to pointer with reversed arguments
  ·  Format
dwrite_r
  ·  Direct Format
{dwrite_r}
  ·  Forms dwrite_r = 53 (0x35)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types native float and ptr respectively. Truncate value to float64 and write it to pointer in memory.


 fread 
  ·  OperationRead float32 from pointer
  ·  Format
fread
  ·  Direct Format
{fread}
  ·  Forms fread = 38 (0x26)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 32 bit float32 value at pointer in memory, extend it to native float, and push it onto the stack.


 fwrite 
  ·  OperationWrite float32 to pointer
  ·  Format
fwrite
  ·  Direct Format
{fwrite}
  ·  Forms fwrite = 45 (0x2D)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and native float respectively. Truncate value to float32 and write it to pointer in memory.


 fwrite_r 
  ·  OperationWrite float32 to pointer with reversed arguments
  ·  Format
fwrite_r
  ·  Direct Format
{fwrite_r}
  ·  Forms fwrite_r = 52 (0x34)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types native float and ptr respectively. Truncate value to float32 and write it to pointer in memory.


 iread 
  ·  OperationRead int32 from pointer
  ·  Format
iread
  ·  Direct Format
{iread}
  ·  Forms iread = 37 (0x25)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 32 bit int32 value at pointer in memory, and push it onto the stack.
   · Notes This instruction can also be used to read uint32 values from memory.


 iwrite 
  ·  OperationWrite int32 to pointer
  ·  Format
iwrite
  ·  Direct Format
{iwrite}
  ·  Forms iwrite = 44 (0x2C)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and int32 respectively. Write value to pointer in memory.
   · Notes This instruction can also be used to write values of type uint32 to memory.


 iwrite_r 
  ·  OperationWrite int32 to pointer with reversed arguments
  ·  Format
iwrite_r
  ·  Direct Format
{iwrite_r}
  ·  Forms iwrite_r = 51 (0x33)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types int32 and ptr respectively. Write value to pointer in memory.
   · Notes This instruction can also be used to write values of type uint32 to memory.


 mread 
  ·  OperationRead multiple bytes from pointer
  ·  Format
mread
N[1]
wide
mread
N[4]
  ·  Direct Format
{mread}
N
  ·  Forms mread = 41 (0x29)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read N bytes from pointer in memory, and push them onto the stack, aligned on a word boundary.
   · Notes The exact number of stack words that is pushed depends upon the underlying platform.


 mwrite 
  ·  OperationWrite multiple bytes to pointer
  ·  Format
mwrite
N[1]
wide
mwrite
N[4]
  ·  Direct Format
{mwrite}
N
  ·  Forms mwrite = 48 (0x30)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and uint8[N] (i.e. N bytes of data, aligned on a stack word) respectively. Write value to pointer in memory.


 mwrite_r 
  ·  OperationWrite multiple bytes to pointer with reversed arguments
  ·  Format
mwrite_r
N[1]
wide
mwrite_r
N[4]
  ·  Direct Format
{mwrite_r}
N
  ·  Forms mwrite_r = 55 (0x37)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types uint8[N] (i.e. N bytes of data, aligned on a stack word) and ptr respectively. Write value to pointer in memory.


 padd_i4 
  ·  OperationAdd int32 value to pointer
  ·  Format
padd_i4
  ·  Direct Format
{padd_i4}
  ·  Forms padd_i4 = 135 (0x87)
  ·  Stack..., pointer, value => ..., newpointer
   · Description Pop pointer and value from the stack as the types ptr and int32 respectively. Compute newpointer = pointer + value and push newpointer onto the stack.
   · Notes The padd_offset instruction is more efficient if value is constant and less than 256.


 padd_i4_r 
  ·  OperationAdd int32 value to pointer with reversed arguments
  ·  Format
padd_i4_r
  ·  Direct Format
{padd_i4_r}
  ·  Forms padd_i4_r = 136 (0x88)
  ·  Stack..., value, pointer => ..., newpointer
   · Description Pop value and pointer from the stack as the types int32 and ptr respectively. Compute newpointer = pointer + value and push newpointer onto the stack.


 padd_i8 
  ·  OperationAdd int64 value to pointer
  ·  Format
padd_i8
  ·  Direct Format
{padd_i8}
  ·  Forms padd_i8 = 137 (0x89)
  ·  Stack..., pointer, value => ..., newpointer
   · Description Pop pointer and value from the stack as the types ptr and int64 respectively. Compute newpointer = pointer + value and push newpointer onto the stack.
   · Notes The value will be truncated to 32 bits on platforms with 32 bit pointers.


 padd_i8_r 
  ·  OperationAdd int64 value to pointer with reversed arguments
  ·  Format
padd_i8_r
  ·  Direct Format
{padd_i8_r}
  ·  Forms padd_i8_r = 138 (0x8A)
  ·  Stack..., value, pointer => ..., newpointer
   · Description Pop value and pointer from the stack as the types int64 and ptr respectively. Compute newpointer = pointer + value and push newpointer onto the stack.
   · Notes The value will be truncated to 32 bits on platforms with 32 bit pointers.


 padd_offset 
  ·  OperationAdd a literal byte offset to a pointer
  ·  Format
padd_offset
N[1]
  ·  Direct Format
{padd_offset}
N
  ·  Forms padd_offset = 133 (0x85)
  ·  Stack..., pointer => ..., newpointer
   · Description Pop pointer from the stack as type ptr. Compute newpointer = pointer + N and push newpointer onto the stack.


 padd_offset_n 
  ·  OperationAdd a literal byte offset to a pointer that is several words down the stack
  ·  Format
padd_offset_n
N[1]
M[1]
wide
padd_offset_n
N[4]
M[4]
  ·  Direct Format
{padd_offset_n}
N
M
  ·  Forms padd_offset_n = 134 (0x86)
  ·  Stack..., pointer, val1, ..., valN => ..., newpointer, val1, ..., valN
   · Description Read pointer from the N positions down the stack as type ptr. Compute newpointer = pointer + M and replace pointer with newpointer. A value of N == 0 indicates the top-most stack word.
   · Notes The padd_offset instruction is more efficient if N == 0 and M < 256.


 pread 
  ·  OperationRead ptr from pointer
  ·  Format
pread
  ·  Direct Format
{pread}
  ·  Forms pread = 40 (0x28)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the ptr value at pointer in memory, and push it onto the stack.
   · Notes This instruction must not be confused with iread. Values of type int32 and ptr do not necessarily occupy the same amount of memory space on all platforms.


 psub 
  ·  OperationSubtract pointer values
  ·  Format
psub
  ·  Direct Format
{psub}
  ·  Forms psub = 139 (0x8B)
  ·  Stack..., value1, value2 => ..., result
   · Description Pop value1 and value2 from the stack as type ptr. Compute result = value1 - value2 and push result onto the stack. The type of result will be either int32 or int64, depending upon the platform.


 psub_i4 
  ·  OperationSubtract int32 from pointer
  ·  Format
psub_i4
  ·  Direct Format
{psub_i4}
  ·  Forms psub_i4 = 140 (0x8C)
  ·  Stack..., pointer, value => ..., newpointer
   · Description Pop pointer and value from the stack as the types ptr and int32 respectively. Compute newpointer = pointer - value and push newpointer onto the stack.


 psub_i8 
  ·  OperationSubtract int64 from pointer
  ·  Format
psub_i8
  ·  Direct Format
{psub_i8}
  ·  Forms psub_i8 = 141 (0x8D)
  ·  Stack..., pointer, value => ..., newpointer
   · Description Pop pointer and value from the stack as the types ptr and int64 respectively. Compute newpointer = pointer - value and push newpointer onto the stack.
   · Notes The value will be truncated to 32 bits on platforms with 32 bit pointers.


 pwrite 
  ·  OperationWrite ptr to pointer
  ·  Format
pwrite
  ·  Direct Format
{pwrite}
  ·  Forms pwrite = 47 (0x2F)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as type ptr. Write value to pointer in memory.
   · Notes This instruction must not be confused with iwrite. Values of type int32 and ptr do not necessarily occupy the same amount of memory space on all platforms.


 pwrite_r 
  ·  OperationWrite ptr to pointer with reversed arguments
  ·  Format
pwrite_r
  ·  Direct Format
{pwrite_r}
  ·  Forms pwrite_r = 54 (0x36)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as type ptr. Write value to pointer in memory.
   · Notes This instruction must not be confused with iwrite_r. Values of type int32 and ptr do not necessarily occupy the same amount of memory space on all platforms.


 sread 
  ·  OperationRead int16 from pointer
  ·  Format
sread
  ·  Direct Format
{sread}
  ·  Forms sread = 35 (0x23)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 16 bit value at pointer in memory, sign-extend it to int32 and push it onto the stack.


 swrite 
  ·  OperationWrite int16 to pointer
  ·  Format
swrite
  ·  Direct Format
{swrite}
  ·  Forms swrite = 43 (0x2B)
  ·  Stack..., pointer, value => ...
   · Description Pop pointer and value from the stack as the types ptr and int32 respectively. Truncate value to 16 bits and write it to pointer in memory.
   · Notes This instruction can also be used to write values of type uint16 to memory.


 swrite_r 
  ·  OperationWrite int16 to pointer with reversed arguments
  ·  Format
swrite_r
  ·  Direct Format
{swrite_r}
  ·  Forms swrite_r = 50 (0x32)
  ·  Stack..., value, pointer => ...
   · Description Pop value and pointer from the stack as the types int32 and ptr respectively. Truncate value to 16 bits and write it to pointer in memory.
   · Notes This instruction can also be used to write values of type uint16 to memory.


 ubread 
  ·  OperationRead uint8 from pointer
  ·  Format
ubread
  ·  Direct Format
{ubread}
  ·  Forms ubread = 34 (0x22)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 8 bit value at pointer in memory, zero-extend it to int32 and push it onto the stack.


 usread 
  ·  OperationRead uint16 from pointer
  ·  Format
usread
  ·  Direct Format
{usread}
  ·  Forms usread = 36 (0x24)
  ·  Stack..., pointer => ..., value
   · Description Pop pointer from the stack as type ptr. Read the 16 bit value at pointer in memory, zero-extend it to int32 and push it onto the stack.


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