Difference between revisions of "Instruction set: CIL"
From ScienceZero
Line 1: | Line 1: | ||
− | |||
==Arithmetic== | ==Arithmetic== | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 32: | Line 31: | ||
|- | |- | ||
|Sub.Ovf.Un || Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. | |Sub.Ovf.Un || Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | ==Logical and shift== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Description | ||
+ | |- | ||
+ | |And || Computes the bitwise AND of two values and pushes the result onto the evaluation stack. | ||
+ | |- | ||
+ | |Or || Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack. | ||
+ | |- | ||
+ | |Not || Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type. | ||
+ | |- | ||
+ | |Xor || Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack. | ||
+ | |- | ||
+ | |Shl || Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack. | ||
+ | |- | ||
+ | |Shr || Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack. | ||
+ | |- | ||
+ | |Shr.Un || Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack. | ||
+ | |} | ||
+ | |||
+ | |||
+ | ==Branching== | ||
+ | Add ".S" for short form. | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Description | ||
+ | |- | ||
+ | |Br || Unconditionally transfers control to a target instruction. | ||
+ | |- | ||
+ | |Beq || Transfers control to a target instruction if two values are equal. | ||
+ | |- | ||
+ | |Bge || Transfers control to a target instruction if the first value is greater than or equal to the second value. | ||
+ | |- | ||
+ | |Bge.Un || Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. | ||
+ | |- | ||
+ | |Bgt || Transfers control to a target instruction if the first value is greater than the second value. | ||
+ | |- | ||
+ | |Bgt.Un || Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. | ||
+ | |- | ||
+ | |Ble || Transfers control to a target instruction if the first value is less than or equal to the second value. | ||
+ | |- | ||
+ | |Ble.Un || Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values. | ||
+ | |- | ||
+ | |Blt || Transfers control to a target instruction if the first value is less than the second value. | ||
+ | |- | ||
+ | |Blt.Un || Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values. | ||
+ | |- | ||
+ | |Bne.Un || Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal. | ||
+ | |- | ||
+ | |Brfalse || Transfers control to a target instruction if value is false, a null reference (Nothing in Visual Basic), or zero. | ||
+ | |- | ||
+ | |Brtrue || Transfers control to a target instruction if value is true, not null, or non-zero. | ||
|} | |} | ||
[[Category:Computing]] | [[Category:Computing]] |
Revision as of 02:58, 9 October 2007
Arithmetic
Name | Description |
---|---|
Add | Adds two values and pushes the result onto the evaluation stack. |
Add.Ovf | Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack. |
Add.Ovf.Un | Adds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack. |
Div | Divides two values and pushes the result as a floating-point (type F) or quotient (type int32) onto the evaluation stack. |
Div.Un | Divides two unsigned integer values and pushes the result (int32) onto the evaluation stack. |
Mul | Multiplies two values and pushes the result on the evaluation stack. |
Mul.Ovf | Multiplies two integer values, performs an overflow check, and pushes the result onto the evaluation stack. |
Mul.Ovf.Un | Multiplies two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack. |
Neg | Negates a value and pushes the result onto the evaluation stack. |
Rem | Divides two values and pushes the remainder onto the evaluation stack. |
Rem.Un | Divides two unsigned values and pushes the remainder onto the evaluation stack. |
Sub | Subtracts one value from another and pushes the result onto the evaluation stack. |
Sub.Ovf | Subtracts one integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. |
Sub.Ovf.Un | Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. |
Logical and shift
Name | Description |
---|---|
And | Computes the bitwise AND of two values and pushes the result onto the evaluation stack. |
Or | Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack. |
Not | Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type. |
Xor | Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack. |
Shl | Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack. |
Shr | Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack. |
Shr.Un | Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack. |
Branching
Add ".S" for short form.
Name | Description |
---|---|
Br | Unconditionally transfers control to a target instruction. |
Beq | Transfers control to a target instruction if two values are equal. |
Bge | Transfers control to a target instruction if the first value is greater than or equal to the second value. |
Bge.Un | Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. |
Bgt | Transfers control to a target instruction if the first value is greater than the second value. |
Bgt.Un | Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. |
Ble | Transfers control to a target instruction if the first value is less than or equal to the second value. |
Ble.Un | Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values. |
Blt | Transfers control to a target instruction if the first value is less than the second value. |
Blt.Un | Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values. |
Bne.Un | Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal. |
Brfalse | Transfers control to a target instruction if value is false, a null reference (Nothing in Visual Basic), or zero. |
Brtrue | Transfers control to a target instruction if value is true, not null, or non-zero. |