Comparison operators



      fcmpg      fcmpl      icmp      icmp_un
      lcmp      lcmp_un      pcmp      seteq
      setge      setgt      setle      setlt
      setne   


 fcmpg 
  ·  OperationCompare native float with greater result
  ·  Format
prefix
fcmpg
  ·  Direct Format
{fcmpg}
  ·  Forms fcmpg = 255, 6 (0xFF, 0x06)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type native float. The int32 result is determined as follows:
  • If either value1 or value2 is NaN, then result is 1.
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 fcmpl 
  ·  OperationCompare native float with lower result
  ·  Format
prefix
fcmpl
  ·  Direct Format
{fcmpl}
  ·  Forms fcmpl = 255, 5 (0xFF, 0x05)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type native float. The int32 result is determined as follows:
  • If either value1 or value2 is NaN, then result is -1.
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 icmp 
  ·  OperationCompare int32
  ·  Format
prefix
icmp
  ·  Direct Format
{icmp}
  ·  Forms icmp = 255, 1 (0xFF, 0x01)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 icmp_un 
  ·  OperationCompare uint32
  ·  Format
prefix
icmp_un
  ·  Direct Format
{icmp_un}
  ·  Forms icmp_un = 255, 2 (0xFF, 0x02)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type uint32. The int32 result is determined as follows:
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 lcmp 
  ·  OperationCompare int64
  ·  Format
prefix
lcmp
  ·  Direct Format
{lcmp}
  ·  Forms lcmp = 255, 3 (0xFF, 0x03)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type int64. The int32 result is determined as follows:
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 lcmp_un 
  ·  OperationCompare uint64
  ·  Format
prefix
lcmp_un
  ·  Direct Format
{lcmp_un}
  ·  Forms lcmp_un = 255, 4 (0xFF, 0x04)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type uint64. The int32 result is determined as follows:
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 pcmp 
  ·  OperationCompare ptr
  ·  Format
prefix
pcmp
  ·  Direct Format
{pcmp}
  ·  Forms pcmp = 255, 7 (0xFF, 0x07)
  ·  Stack..., value1, value2 => ..., result
   · Description Both value1 and value2 are popped from the stack as type ptr. The int32 result is determined as follows:
  • If value1 < value2, then result is -1.
  • If value1 > value2, then result is 1.
  • Otherwise, result is 0.
The result is then pushed onto the stack.


 seteq 
  ·  OperationSet if equal to zero
  ·  Format
prefix
seteq
  ·  Direct Format
{seteq}
  ·  Forms seteq = 255, 8 (0xFF, 0x08)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 == 0, then result is 1.
  • If value1 != 0, then result is 0.
The result is then pushed onto the stack.


 setge 
  ·  OperationSet if greater than or equal to zero
  ·  Format
prefix
setge
  ·  Direct Format
{setge}
  ·  Forms setge = 255, 13 (0xFF, 0x0D)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 >= 0, then result is 1.
  • If value1 < 0, then result is 0.
The result is then pushed onto the stack.


 setgt 
  ·  OperationSet if greater than zero
  ·  Format
prefix
setgt
  ·  Direct Format
{setgt}
  ·  Forms setgt = 255, 12 (0xFF, 0x0C)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 > 0, then result is 1.
  • If value1 <= 0, then result is 0.
The result is then pushed onto the stack.


 setle 
  ·  OperationSet if less than or equal to zero
  ·  Format
prefix
setle
  ·  Direct Format
{setle}
  ·  Forms setle = 255, 11 (0xFF, 0x0B)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 <= 0, then result is 1.
  • If value1 > 0, then result is 0.
The result is then pushed onto the stack.


 setlt 
  ·  OperationSet if less than zero
  ·  Format
prefix
setlt
  ·  Direct Format
{setlt}
  ·  Forms setlt = 255, 10 (0xFF, 0x0A)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 < 0, then result is 1.
  • If value1 >= 0, then result is 0.
The result is then pushed onto the stack.


 setne 
  ·  OperationSet if not equal to zero
  ·  Format
prefix
setne
  ·  Direct Format
{setne}
  ·  Forms setne = 255, 9 (0xFF, 0x09)
  ·  Stack..., value => ..., result
   · Description The value is popped from the stack as type int32. The int32 result is determined as follows:
  • If value1 != 0, then result is 1.
  • If value1 == 0, then result is 0.
The result is then pushed onto the stack.


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