aboutsummaryrefslogtreecommitdiff
path: root/sts/ia32/stack.sts
diff options
context:
space:
mode:
Diffstat (limited to 'sts/ia32/stack.sts')
-rw-r--r--sts/ia32/stack.sts41
1 files changed, 41 insertions, 0 deletions
diff --git a/sts/ia32/stack.sts b/sts/ia32/stack.sts
new file mode 100644
index 0000000..e884098
--- /dev/null
+++ b/sts/ia32/stack.sts
@@ -0,0 +1,41 @@
+defasm top
+ # 54 ?' ; push esp
+next
+
+defasm ref
+ # 58 ?' ; pop eax
+ # c1 ?' # e0 ?' # 2 ?' ; shl eax, 2
+ # 01 ?' # e0 ?' ; add eax, esp
+ # 50 ?' ; push eax
+next
+
+defasm get
+ # 58 ?' ; pop eax
+ # 8b ?' # 4 ?' # 84 ?' ; mov eax, [esp + 4 * eax]
+ # 50 ?' ; push eax
+next
+
+defasm set
+ # 5b ?' ; pop ebx
+ # 58 ?' ; pop eax
+ # 89 ?' # 04 ?' # 9c ?' ; mov [esp + 4 * ebx], eax
+next
+
+defasm drop
+ # 58 ?' ; pop eax
+next
+
+defasm dup
+ # ff ?' # 34 ?' # 24 ?' ; push dword [esp]
+next
+
+defasm over
+ # ff ?' # 74 ?' # 24 ?' # 4 ?' ; push dword [esp + 4]
+next
+
+defasm swap
+ # 58 ?' ; pop eax
+ # 5b ?' ; pop ebx
+ # 50 ?' ; push eax
+ # 53 ?' ; push ebx
+next