![LabSmith HVS448 User Manual Download Page 40](http://html1.mh-extra.com/html/labsmith/hvs448/hvs448_user-manual_3205695040.webp)
40
X^2
Usage
X^2
X^2 replaces the value in X with the square of the value. The rest of the stack is unaffected.
Example:
-10
; X contains -10
X^2
; X contains 100
Sqrt
Usage
Sqrt
The instruction Sqrt replaces the value in X with the square root of the value. The remainder is truncated. The rest of the stack is
unaffected.
Example:
112
; X contains 112
Sqrt ; X contains 10 (the exact number is ~10.583005)
Conditional Tests
Conditional tests examine the values of the stack registers.
X Register Tests
Usage:
X<0?; etc.
These instructions test the value of the number in X with 0
:
X<0?:
X is less than 0?
X <=0?: X is less than or equal to 0?
X= 0?:
X is equal to 0?
X!=0?:
X is not equal to 0?
X>=0?:
X is greater than or equal to 0?
X>0?:
X is greater than 0?
If the test is true, the next instruction is executed; if false, the next instruction is skipped.
Example:
10
; X contains 10
X=0?
; False
Goto Initialize
; Does not execute this instruction
X>0?
; True
Goto Inject ; Executes this instruction
X and Y Register Comparisons
Usage:
X<Y?; etc.
These instructions test the values of the numbers in X and Y:
X<Y?:
X is less than Y?
X <=Y?:
X is less than or equal to Y?
X= Y?:
X is equal to Y?
X!=Y?:
X is not equal to Y?
X>=Y?:
X is greater than or equal to Y?
X>Y?:
X is greater than Y?
If the test is true, the next instruction is executed; if false, the next instruction is skipped.
Example: