39
12
; X contains 12, Y contains 16
-
; X contains 4, Y contains 10
*
Usage:
*
The instruction * removes the top two numbers on the stack (X and Y) and places the product of these numbers at the top of the
stack (X).
Example:
10
; X contains 10
16
; X contains 16, Y contains 10
12
; X contains 12, Y contains 16
*
; X contains 192, Y contains 10
/
Usage:
/
The instruction / removes the top two numbers on the stack (X and Y) and places the quotient of these numbers, Y/X, at the top
of the stack (X). The remainder is truncated.
Example:
10
; X contains 10
166
; X contains 166, Y contains 10
12
; X contains 12, Y contains 166
/
; X contains 13 (166/12 = 13.833…), Y contains 10
Mod
Usage:
Mod
The instruction Mod removes the top two numbers on the stack (X and Y) and places the remainder of the integral quotient Y/X
on the top of the stack (X).
Example:
145
; X contains 145
12
; X contains 12, Y contains 145
Mod
; X contains 1 (145/12 = 12 + 1/12, i.e., the remainder is 1)
ChS
Usage:
ChS
The instruction ChS changes the sign of the value in X. The rest of the stack is unaffected.
Example:
10
; X contains 10
ChS
; X contains -10
ChS
; X contains 10
Abs
Usage:
Abs
Abs replaces the value in X with its absolute value. The rest of the stack is unaffected.
Example:
-10
; X contains -10
Abs
; X contains 10
Abs
; X contains 10