Sitemap | Search || Zen Spider Website
/ Satori
/ The Satori Project
/ Primitive Specifications
Primitive Specifications
- intAdd <Primitive 1>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their addition.
- intSub <Primitive 2>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their subtraction.
- intLessThan <Primitive 3>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the boolean result of less than.
- intGreaterThan <Primitive 4>
- This primitive takes two variables, the receiver and the argument. the receiver and argument must be SmallIntegers. It returns the boolean result of greater than.
- intLessThanEq <Primitive 5>
- This primitive takes two variables, the receiver and the argument. the receiver and argument must be SmallIntegers. It returns the boolean result of less than or equal to.
- intGreaterThanEq <Primitive 6>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the boolean result of greater than or equal to.
- intEquality <Primitive 7>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the boolean result of the logical equality.
- intInEquality <Primitive 8>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the boolean result of logical inequality.
- intMult <Primitive 9>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their multiplication.
- intDiv <Primitive 10>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their division. NOTE: we need to find out which way this primitive rounds the result if it is negative.
- intMod <Primitive 11>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of integer modulus.
- intDiv2 <Primitive 12>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their division. NOTE: we need to find out which way this primitive rounds the result if it is negative.
- intQuo <Primitive 13>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of their quotient. NOTE: This does the same thing as intDiv and intDiv2 - need to look up how it differs.
- intBitAnd <Primitive 14>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of a "bitwise and".
- intBitOr <Primitive 15>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of a "bitwise or".
- intBitXor <Primitive 16>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of a "bitwise Xor".
- intBitshift <Primitive 17>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be SmallIntegers. It returns the result of bitshifting the receiver left the number of bits equal to the argument.
- intAsFloat <Primitive 40>
- This primitive takes one variable, the receiver. The receiver must be a SmallInteger. The primitive returns the receiver converted to a Float.
- floatAdd <Primitive 41>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the result of their addition.
- floatSub <Primitive 42>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the result of their subtraction.
- floatLessThan <Primitive 43>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of less than.
- floatGreaterThan <Primitive 44>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of greater than.
- floatLessThanEq <Primitive 45>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of less than or equal to.
- floatGreaterThanEq <Primitive 46>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of greater than or equal to.
- floatEquality <Primitive 47>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of logical equality.
- floatInEquality <Primitive 48>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the boolean result of logical inequality.
- floatMult <Primitive 49>
- This primitive takes two variables, the reveiver and the argument. The receiver and argument must be Floats. It returns the result of their multiplication.
- floatDiv <Primitive 50>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. It returns the result of their division.
- floatTruncated <Primitive 51>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the receiver converted to a SmallInteger, this has the side effect of truncating it.
- floatFractionPart <Primitive 52>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the fractional part of the receiver.
- floatExponent <Primitive 53>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the exponent part of the receiver.
- floatTimesTwoPower <Primitive 54>
- This primitive takes two variables, the receiver and the argument. The receiver and argument must be Floats. The primtive returns the result of the receiver times two to the power of the argument.
- objectAt <Primitive 60>
- This primitive takes two variables, the receiver and the argument. The receiver may be of any type. The argument must be a SmallInteger. The primitive returns the object in the slot of the receiver referenced by the argument.
- objectAtPut <Primitive 61>
- This primitive takes three variables, the receiver and two arguments. The receiver may be of any type. The first argument must be a SmallInteger and the second argument may be of any type. The primitive puts the second argument into the slot of the receiver indexed by the first argument. The primitive returns the second argument.
- objectSize <Primitive 62>
- This primitive takes one variable, the receiver. The receiver may be of any type. The primitive returns the number of slots contained by its receiver. This primitive should not fail.
- byteObjectSize <Primitive 255>
- This primitive takes one variable, the receiver. The receiver may be of any type. The primitive returns the size of the receiver in bytes. This primitive should not fail.
- stringAt <Primitive 63>
- This primitive takes two variables, the receiver and the argument. The receiver may be of any type and the argument must be a SmallInteger. The primitive returns the Character object contained in the receiver at the slot indexed by the argument.
- stringAtPut <Primitive 64>
- This primitive takes three variables, the receiver and two arguments. The receiver may be of any type. The first argument must be a SmallInteger and the second argument may be of any type. The primitive puts the second argument into the slot of the receiver that is indexed by the first argument. This primitive returns the second argument.
- compiledMethodAt <Primitive 68>
- This primitive takes two variables, the receiver and the argument. The receiver must be a Method and the argument must be a SmallInteger. This primitive returns the object contained in the slot of the receiver indexed by the argument.
- compiledMethodAtPut <Primitive 69>
- This primitive takes three variables, the receiver and two arguments. The receiver must be a Method, the first argument must be a SmallInteger, the second argument may be of any type. This primitive puts the second argument into the slot of the receiver indexed by the first argument. The primitive returns the second argument.
- instVarAt <Primitive 73>
- This primitive takes two variables, the receiver and the argument. The receiver may be of any type. The argument must be a SmallInteger. The primitive returns the object in the slot of the receiver referenced by the argument.
- instVarAtPut <Primitive 74>
- This primitive takes three variables, the receiver and two arguments. The receiver may be of any type. The first argument must be a SmallInteger and the second argument may be of any type. The primitive puts the second argument into the slot of the receiver indexed by the first argument. The primitive returns the second argument.
- smallIntegerAsObject <Primitive 76>
- This primitive takes one variable, the receiver. In this implementation, the primitive returns the reciever without changes because our SmallIntegers are objects and do not need to be converted to be used.
- secondClock <Primitive 98>
- This primitive takes one variable, the receiver. The receiver may be of any type as it is discarded. The primitive queries the operating system for the number of seconds since Jan. 1, 1970. The primitive returns the result of this as a SmallInteger.
- millisecondClock <Primitive 99>
- Primitive not implemented due to cross platform implementation concerns. This primitive takes one variable, the receiver. The receiver may be of any type as it is discarded. The primitive queries the operating system for the number of milliseconds since midnight. The primitive returns the result of this as a SmallInteger.
- equality <Primitive 110>
- This primitive takes two variables, the receiver and the argument. The receiver and argument may be of any type. If they are both characters, the primitive compares their values. If the variables are not characters, the primitive compares their addresses. The primitive returns the boolean result of this comparison. This primitive should not fail.
- objectClass <Primitive 111>
- This primitive takes one variable, the receiver. The receiver may be of any type. The primitive returns the class of the receiver.
- dictionaryAt <Primitive 128>
- This primitive takes two variables, the receiver and the argument. The receiver must be a dictionary. The argument may be of any type. The primitive returns the value in the dictionary referenced by the argument. If no value with a matching argument key is found, the primitive returns gNil.
- dictionaryAtPut <Primitive 129>
- This primitive takes three variables, the receiver and two arguments. The receiver must be a dictionary. The first argument must be a SmallInteger and the second argument may be of any type. The primitive places the second argument into the association in the dictonary with a key matching the first argument. If no matching key is found, a new association is created in the dictionary using the first argument as the key and the second argument as the value. This primitive returns the second argument.
- characterValue <Primitive 132>
- This primitive takes one variable, the receiver. The receiver must be a SmallInteger. The primitive returns the receiver converted into a Character.
- characterASCIIValue <Primitive 133>
- This primitive takes one variable, the receiver. The receiver must be a Character. This primitive returns the receiver converted to a SmallInteger.
- floatExp <Primitive 160>
- This primitive takes one variable, the receiver. The receiver must be a Float and must be greater than or equal to zero. This primitive returns the value of e^(receiver).
- floatLn <Primitive 161>
- This primitive takes one veriable, the receiver. The receiver must be a float and must be greater than zero. This primitive returns the value of ln(receiver).
- floatRaisedTo <Primitive 164>
- This primitive takes two variables, the receiver and the argument. Both the receiver and the argument must be Floats. The primitive returns the value of (receiver)^(argument).
- floatSqrt <Primitive 166>
- This primitive takes one variable, the receiver. The receiver must be a Float. This primitive returns the square root of the receiver.
- floatCeiling <Primitive 168>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the ceiling of the receiver.
- floatFloor <Primitive 169>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the ceiling of the receiver.
- floatSin <Primitive 176>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the sine of the receiver.
- floatCos <Primitive 177>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the cosine of the receiver.
- floatTan <Primitive 178>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the tangent of the receiver.
- floatArcSin <Primitive 179>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the arc sine of the receiver.
- floatArcCos <Primitive 180>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the arc cosine of the receiver.
- floatArcTan <Primitive 181>
- This primitive takes one variable, the receiver. The receiver must be a Float. The primitive returns the arc tangent of the receiver.
- blockCopy <primitive 80>
- This primitive checks to verify that the receiver is a valid ContextPtr and the first argument is a SmallInteger. It then discards the first object and creates a new ContextPtr object using the second object. The address of the new ContextPtr is then pushed onto the stack. If the original objects are not valid types they are restored to the top of the stack unchanged. In the future the first argument should be stored in the context to facilitate checking the number of arguments to the value message.
- blockValue <primitive 81>
- I am the primtive that makes a block active. That means I have to set up the insertion variables so the interpreter can access them. I should only affect the context stack. I modify the temporary frame of the receiver by adding an extension array to it that contains all of the insertion variables that were given to me as arguments.
- quitPrimitive <primitive 113>
- This primitive prepares the system for shutdown by setting the returning context to nil. This primitive should not fail.
- doesNotUnderstand <primitive 130>
- I am responsible for showing that a method couldn't be found. I do so by displaying the error and my argument ( the selector that couldn't be found ) as well as invoking a traceback.
- error <primitive 131>
- I am responsible for displaying an error message and letting the interpreter shut down nicely. My argument should be a string containing the error.
- backTrace <primitive 140>
- This pops the receiver ( hopefully the systemDictionary ) off the data stack and then invokes the traceBack method of the interpreter.
- executionTrace <primitive 141>
- This allows the smalltalker to turn on tracing of message sends as they occur. The argument is a Boolean. If it is gTrue, we turn on tracing, if it is gFalse, we turn tracing off.
- ClassDescComment <primitive 143>
- receiver is a class description and the only argument is a string. The receivers comment member is set to the string. If argument is not a string, the primitive fails.
- verboseTrace <primitive 233>
- in conjunction with executionTrace, this sets the tracing to a terse mode if the argument is gfalse, and sets it to a verbose mode if it is gtrue.
- charString <primtive: 246>
- This is used to coerce a character to a string so that it can be printed or manipulated as a string. If the receiver is a valid character, a string is created from it and pushed onto the data stack.
- basicPrint <primitive 252>
- (Satori Extension) This primitive's receiver should be a String. If it is, print it to stdout. If not, fail.
Sitemap | Search || Zen Spider Website
/ Satori
/ The Satori Project
/ Primitive Specifications