Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2007-10-09 21:03:43 +0000
committerDarin Wright2007-10-09 21:03:43 +0000
commit07f1e796ae8a43d56d3010bd3e85063b318a0ad3 (patch)
tree35f7610d1674c644f814f9a8b8bb8a858feffd39 /org.eclipse.debug.examples.core/samples
parent50371b66ac350e9f64991048058ad251a191c90d (diff)
downloadeclipse.platform.debug-07f1e796ae8a43d56d3010bd3e85063b318a0ad3.tar.gz
eclipse.platform.debug-07f1e796ae8a43d56d3010bd3e85063b318a0ad3.tar.xz
eclipse.platform.debug-07f1e796ae8a43d56d3010bd3e85063b318a0ad3.zip
release of original PDA code base
Diffstat (limited to 'org.eclipse.debug.examples.core/samples')
-rw-r--r--org.eclipse.debug.examples.core/samples/counter.pda11
-rw-r--r--org.eclipse.debug.examples.core/samples/drop.pda12
-rw-r--r--org.eclipse.debug.examples.core/samples/example.pda35
-rw-r--r--org.eclipse.debug.examples.core/samples/fibonacci.pda32
-rw-r--r--org.eclipse.debug.examples.core/samples/structures.pda8
5 files changed, 98 insertions, 0 deletions
diff --git a/org.eclipse.debug.examples.core/samples/counter.pda b/org.eclipse.debug.examples.core/samples/counter.pda
new file mode 100644
index 000000000..9b2b73100
--- /dev/null
+++ b/org.eclipse.debug.examples.core/samples/counter.pda
@@ -0,0 +1,11 @@
+push 0
+:main
+var n
+pop $n
+push $n
+push 1
+add
+dup
+push $n
+output
+branch_not_zero main \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/samples/drop.pda b/org.eclipse.debug.examples.core/samples/drop.pda
new file mode 100644
index 000000000..84f60fee0
--- /dev/null
+++ b/org.eclipse.debug.examples.core/samples/drop.pda
@@ -0,0 +1,12 @@
+call one
+:one
+call two
+:two
+call three
+:three
+call four
+:four
+push DONE
+output
+
+
diff --git a/org.eclipse.debug.examples.core/samples/example.pda b/org.eclipse.debug.examples.core/samples/example.pda
new file mode 100644
index 000000000..a95886358
--- /dev/null
+++ b/org.eclipse.debug.examples.core/samples/example.pda
@@ -0,0 +1,35 @@
+push "hello"
+output
+call foobar
+push 3
+:label
+dup
+push 4
+push 5
+add
+add
+output
+dec
+dup
+branch_not_zero label
+call foobar
+push "end"
+output
+halt
+:foobar
+var a
+var b
+call barfoo
+push "first"
+push "second"
+pop $a
+pop $b
+push $a
+push $b
+output
+output
+return
+:barfoo
+push "barfoo"
+output
+return
diff --git a/org.eclipse.debug.examples.core/samples/fibonacci.pda b/org.eclipse.debug.examples.core/samples/fibonacci.pda
new file mode 100644
index 000000000..e39595a98
--- /dev/null
+++ b/org.eclipse.debug.examples.core/samples/fibonacci.pda
@@ -0,0 +1,32 @@
+push 6
+call fibonacci
+output
+halt
+#
+# f(n) = f(n-1) + f(n-2)
+# f(0) = 1
+# f(1) = 1
+#
+:fibonacci
+var n
+pop $n
+push $n
+branch_not_zero gt0
+push 1
+return
+:gt0
+push $n
+dec
+branch_not_zero gt1
+push 1
+return
+:gt1
+push $n
+dec
+call fibonacci
+push $n
+dec
+dec
+call fibonacci
+add
+return
diff --git a/org.eclipse.debug.examples.core/samples/structures.pda b/org.eclipse.debug.examples.core/samples/structures.pda
new file mode 100644
index 000000000..97858b079
--- /dev/null
+++ b/org.eclipse.debug.examples.core/samples/structures.pda
@@ -0,0 +1,8 @@
+push one two three
+push 1 2 3
+var x
+var y
+pop $x
+pop $y
+push Done
+output \ No newline at end of file

Back to the top