SCI Decoding - Opcode glossary

# Opcode glossary

## (bytecodes)

    bnot (boolean not)
       Effectuates a 'boolean not' on the accumulator.

       Pseudo: acc = acc XOR 00FFh

    add (addition)
       Pops a value from the stack and adds it to the accumulator.

       Pseudo: acc = acc + pop

    sub (substraction)
       Pops a value from the stack and substracts the accumulator with it.

       Pseudo: acc = acc - pop

    mul (multiplication)
       Pops a value from the stack and multiplies the accumulator with it.

       Pseudo: acc = acc * pop

    div (division)
       Pops a value from the stack, divides it with the value in the accumulator
       and put the result in the accumulator.

       Pseudo: acc = pop / acc

    mod (modulo)
       Pops a value from the stack, effectuates a modulo on it with the value in
       the accumulator and puts the result in the accumulator.

       Pseudo: acc = pop MODULO acc

    shr (shift right)
       Pops a value from the stack, shift its value right by the number of bits
       specified in the accumulator and puts the result in the accumulator.

       Pseudo: acc = pop SHR acc

    shl (shift left)
       Pops a value from the stack, shift its value left by the number of bits
       specified in the accumulator and puts the result in the accumulator.

       Pseudo: acc = pop SHL acc

    xor (exclusive or)
       Pops a value from the stack and effectuates an exclusive OR on the
       accumulator with it.

       Pseudo: acc = acc XOR pop

    and
       Pops a value from the stack and effectuates a AND on the accumulator
       with it.

       Pseudo: acc = acc AND pop

    or
       Pops a value from the stack and effectuates a OR on the accumulator
       with it.

       Pseudo: acc = acc OR pop

    neg (negate)
       Negates the accumulator.

       Pseudo: acc = -acc

    not
       If the value of the accumulator is not zero then it puts 0 (false) in the
       accumulator, else it puts 1 (true) in the accumulator.

       Pseudo: if acc <> 0 then
                  acc = 0
               else
                  acc = 1

    eq? (equal?)
       Pops a value from the stack, if it is equal to the value of the accumulator
       then it puts 1 (true) in the accumulator, else it puts 0 (false) in the
       accumulator.

       Pseudo: if acc = pop then
                  acc = 1
               else
                  acc = 0

    ne? (not equal?)
       Pops a value from the stack, if it is not equal to the value in the
       accumulator then it puts 1 (true) in the accumulator, else it puts
       0 (false) in the accumulator.

       Pseudo: if acc <> pop then
                  acc = 1
               else
                  acc = 0

    gt? (greater than?)
       Pops a value from the stack, if it is greater than the value in the
       accumulator then it puts 1 (true) in the accumulator, else it puts
       0 (false) in the accumulator.

       Pseudo: if pop > acc then
                  acc = 1
               else
                  acc = 0

    ge? (greater or equal?)
       Pops a value from the stack, if it is greater or equal than the value in
       the accumulator then it puts 1 (true) in the accumulator, else it puts
       0 (false) in the accumulator.

       Pseudo: if pop >= acc then
                  acc = 1
               else
                  acc = 0

    lt? (less than?)
       Pops a value from the stack, if it is less than the value in the
       accumulator then it puts 1 (true) in the accumulator, else it puts
       0 (false) in the accumulator.

       Pseudo: if pop < acc then
                  acc = 1
               else
                  acc = 0

    le? (less or equal?)
       Pops a value from the stack, if it is less or equal than the value in the
       accumulator then it puts 1 (true) in the accumulator, else it puts
       0 (false) in the accumulator.

       Pseudo: if pop <= acc then
                  acc = 1
               else
                  acc = 0

    ugt? (unsigned greater than?)
       Same as gt?, except that the comparison is done on unsigned numbers.

    uge? (unsigned greater or equal?)
       Same as ge?, except that the comparison is done on unsigned numbers.

    ult? (unsigned less than?)
       Same as lt?, except that the comparison is done on unsigned numbers.

    ule? (unsigned less or equal?)
       Same as le?, except that the comparison is done on unsigned numbers.

    bt (boolean true)
       If the accumulator is true (not equal to 0) then jumps to the specified
       address.

       Pseudo: if acc <> 0 then goto destination address

    bnt (boolean not true)
       If the accumulator is not true (equal to 0) then jumps to the specified
       address.

       Pseudo: if acc = 0 then goto destination address

    jmp (jump)
       Jumps to the specified address.

    ldi (load immediate)
       Loads the accumulator with a specified value.

       Pseudo: acc = immediate value

    push
       Pushes the value of the accumulator on the stack.

    pushi (push immediate)
       Pushes a specified value on the stack.

    toss
       Pops a value from the stack and tosses it.

    dup
       Duplicates the value at the top of the stack. In other words, pushes the
       value at the top of the stack on the stack.

    link
       Creates a specified number of temporary variables.

    call
       Calls a script subroutine.

    callk (call kernel)
       Calls a kernel (interpreter) function.

    callb (call begin)
       Calls a script subroutine situated in script 0.

    calle (call external)
       Calls a script subroutine situated in another (external) script.

    ret (return)
       Returns from a call, callb, calle, send, self or super instruction.

    send
       Accesses one or more variables or calls one or more functions of an object.

    class
       Loads the class address of a specified class number in the accumulator.

       Pseudo: acc = class address

    self
       Calls one or more functions of the current object.

    super
       Accesses one or more variables or calls one or more functions of the class
       (superclass) from which the current object inherits.

    &rest
       Unknown bytecode. It seems to push value on the stack...

    lea (load effective address)
       Unknown bytecode.

    selfID
       Puts the address of the current object in the accumulator.

    pprev (push previous)
       Pushes the result of the last comparison bytecode (eq?, lt?, etc.) on the
       stack.

    pToa (pointer To accumulator)
       Copies the value of the selector (at the pointer) of the current object in
       the accumulator.

    aTop (accumulator To pointer)
       Copies the value of the accumulator in the selector (at the pointer) of the
       current object.

    pTos (pointer To stack)
       Pushes the value of the selector (at the pointer) of the current object on
       the stack.

    sTop (stack To pointer)
       Pops the value on the stack and puts it in the selector (at the pointer)
       of the current object.

    ipToa (increment pointer To accumulator)
       Increments the value of the selector (at the pointer) of the current object
       and copies it in the accumulator.

    dpToa (decrement pointer To accumalator)
       Decrements the value of the selector (at the pointer) of the current object
       and copies it in the accumulator.

    ipTos (increment pointer To stack)
       Increments the value of the selector (at the pointer) of the current object
       and pushes it on the stack.

    dpTos (decrement pointer To stack)
       Decrements the value of the selector (at the pointer) of the current object
       and pushes it on the stack.

    lofsa (load offset accumulator)
       Calculates an address from an offset and puts it in the accumulator.

    lofss (load offset stack)
       Calculates an address from an offset and pushes it on the stack.

    push0 (push 0)
       Pushes the value 0 on the stack.

    push1 (push 1)
       Pushes the value 1 on the stack.

    push2 (push 2)
       Pushes the value 2 on the stack.

    pushSelf (push Self)
       Pushes the address of the current object on the stack.

    lag (load accumulator global)
       Loads a specified global variable in the accumulator.

    lal (load accumulator local)
       Loads a specified local variable in the accumulator.

    lat (load accumulator temporary)
       Loads a specified temporary variable in the accumulator.

    lap (load accumulator parameter)
       Loads a specified function parameter variable in the accumulator.

    lsg (load stack global)
       Pushes a specified global variable on the stack.

    lsl (load stack local)
       Pushes a specified local variable on the stack.

    lst (load stack temporary)
       Pushes a specified temporary variable on the stack.

    lsp (load stack parameter)
       Pushes a specified function parameter variable on the stack.

    lagi (load accumulator global index)
       Loads a specified indexed global variable in the accumulator.

    lali (load accumulator local index)
       Loads a specified indexed local variable in the accumulator.

    lati (load accumulator temporary index)
       Loads a specified indexed temporary variable in the accumulator.

    lapi (load accumulator parameter index)
       Loads a specified indexed function parameter variable in the accumulator.

    lsgi (load stack global index)
       Pushes a specified indexed global variable on the stack.

    lsli (load stack local index)
       Pushes a specified indexed local variable on the stack.

    lsti (load stack temporary index)
       Pushes a specified indexed temporary variable on the stack.

    lspi (load stack parameter index)
       Pushes a specified indexed function parameter variable on the stack.

    sag (store accumulator global)
       Stores the value of the accumulator in a specified global variable.

    sal (store accumulator local)
       Stores the value of the accumulator in a specified local variable.

    sat (store accumulator temporary)
       Stores the value of the accumulator in a specified temporary variable.

    sap (store accumulator parameter)
       Stores the value of the accumulator in a specified function parameter
       variable.

    ssg (store stack global)
       Pops a value from the stack and puts it in a specified global variable.

    ssl (store stack local)
       Pops a value from the stack and puts it in a specified local variable.

    sst (store stack temporary)
       Pops a value from the stack and puts it in a specified temporary variable.

    ssp (store stack parameter)
       Pops a value from the stack and puts it in a specified function parameter
       variable.

    sagi (store accumulator global index)
       Stores the value of the accumulator in a specified indexed global variable.

    sali (store accumulator local index)
       Stores the value of the accumulator in a specified indexed local variable.

    sati (store accumulator temporary index)
       Stores the value of the accumulator in a specified indexed temporary
       variable.

    sapi (store accumulator parameter index)
       Stores the value of the accumulator in a specified indexed function
       parameter variable.

    ssgi (store stack global index)
       Pops a value from the stack and puts it in a specified indexed global
       variable.

    ssli (store stack local index)
       Pops a value from the stack and puts it in a specified indexed local
       variable.

    ssti (store stack temporary index)
       Pops a value from the stack and puts it in a specified indexed temporary
       variable.

    sspi (store stack parameter index)
       Pops a value from the stack and puts it in a specified indexed function
       parameter variable.

    +ag (+accumulator global)
       Increments a specified global variable and loads it in the accumulator.

    +al (+accumulator local)
       Increments a specified local variable and loads it in the accumulator.

    +at (+accumulator temporary)
       Increments a specified temporary variable and loads it in the accumulator.

    +ap (+accumulator parameter)
       Increments a specified function parameter variable and loads it in the
       accumulator.

    +sg (+stack global)
       Increments a specified global variable and pushes it on the stack.

    +sl (+stack local)
       Increments a specified local variable and pushes it on the stack.

    +st (+stack temporary)
       Increments a specified temporary variable and pushes it on the stack.

    +sp (+stack parameter)
       Increments a specified function parameter variable and pushes it on the
       stack.

    +agi (+accumulator global index)
       Increments a specified indexed global variable and loads it in the
       accumulator.

    +ali (+accumulator local index)
       Increments a specified indexed local variable and loads it in the
       accumulator.

    +ati (+accumulator temporary index)
       Increments a specified indexed temporary variable and loads it in the
       accumulator.

    +api (+accumulator parameter index)
       Increments a specified indexed function parameter variable and loads it in
       the accumulator.

    +sgi (+stack global index)
       Increments a specified indexed global variable and pushes it on the stack.

    +sli (+stack local index)
       Increments a specified indexed local variable and pushes it on the stack.

    +sti (+stack temporary index)
       Increments a specified indexed temporary variable and pushes it on the
       stack.

    +spi (+stack parameter index)
       Increments a specified indexed function parameter variable and pushes it on
       the stack.

    -ag (-accumulator global)
       Decrements a specified global variable and loads it in the accumulator.

    -al (-accumulator local)
       Decrements a specified local variable and loads it in the accumulator.

    -at (-accumulator temporary)
       Decrements a specified temporary variable and loads it in the accumulator.

    -ap (-accumulator parameter)
       Decrements a specified function parameter variable and loads it in the
       accumulator.

    -sg (-stack global)
       Decrements a specified global variable and pushes it on the stack.

    -sl (-stack local)
       Decrements a specified local variable and pushes it on the stack.

    -st (-stack temporary)
       Decrements a specified temporary variable and pushes it on the stack.

    -sp (-stack parameter)
       Decrements a specified function parameter variable and pushes it on the
       stack.

    -agi (-accumulator global index)
       Decrements a specified indexed global variable and loads it in the
       accumulator.

    -ali (-accumulator local index)
       Decrements a specified indexed local variable and loads it in the
       accumulator.

    -ati (-accumulator temporary index)
       Decrements a specified indexed temporary variable and loads it in the
       accumulator.

    -api (-accumulator parameter index)
       Decrements a specified indexed function parameter variable and loads it in
       the accumulator.

    -sgi (-stack global index)
       Decrements a specified indexed global variable and pushes it on the stack.

    -sli (-stack local index)
       Decrements a specified indexed local variable and pushes it on the stack.

    -sti (-stack temporary index)
       Decrements a specified indexed temporary variable and pushes it on the
       stack.

    -spi (-stack parameter index)
       Decrements a specified indexed function parameter variable and pushes it on
       the stack.

Return to the main page