summaryrefslogtreecommitdiff
path: root/projects/12/MathTest/Math.vm
diff options
context:
space:
mode:
Diffstat (limited to 'projects/12/MathTest/Math.vm')
-rw-r--r--projects/12/MathTest/Math.vm26
1 files changed, 26 insertions, 0 deletions
diff --git a/projects/12/MathTest/Math.vm b/projects/12/MathTest/Math.vm
index dad8ff5..513fc1a 100644
--- a/projects/12/MathTest/Math.vm
+++ b/projects/12/MathTest/Math.vm
@@ -44,6 +44,32 @@ push constant 0
eq
not
return
+function Math.sign 0
+push argument 0
+push constant 0
+gt
+if-goto IF_TRUE0
+goto IF_FALSE0
+label IF_TRUE0
+push constant 1
+return
+goto IF_END0
+label IF_FALSE0
+push argument 0
+push constant 0
+lt
+if-goto IF_TRUE1
+goto IF_FALSE1
+label IF_TRUE1
+push constant 1
+neg
+return
+goto IF_END1
+label IF_FALSE1
+push constant 0
+return
+label IF_END1
+label IF_END0
function Math.abs 0
push argument 0
push constant 0