aboutsummaryrefslogtreecommitdiff
path: root/ia32/arithmetic.sts
diff options
context:
space:
mode:
Diffstat (limited to 'ia32/arithmetic.sts')
-rw-r--r--ia32/arithmetic.sts103
1 files changed, 103 insertions, 0 deletions
diff --git a/ia32/arithmetic.sts b/ia32/arithmetic.sts
new file mode 100644
index 0000000..c9b4bf8
--- /dev/null
+++ b/ia32/arithmetic.sts
@@ -0,0 +1,103 @@
+defasm +
+; pop eax
+# 58 ?'
+; add [esp], eax
+# 01 ?' # 04 ?' # 24 ?'
+next
+
+defasm -
+; pop eax
+# 58 ?'
+; sub [esp], eax
+# 29 ?' # 04 ?' # 24 ?'
+next
+
+defasm /
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; xor edx, edx
+# 31 ?' # d2 ?'
+; div ebx
+# f7 ?' # f3 ?'
+; push edx
+# 52 ?'
+; push eax
+# 50 ?'
+next
+
+defasm =
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; cmp eax, ebx
+# 39 ?' # d8 ?'
+; sete al
+# 0f ?' # 94 ?' # c0 ?'
+; movzx eax, al
+# 0f ?' # b6 ?' # c0 ?'
+; push eax
+# 50 ?'
+next
+
+defasm !=
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; cmp eax, ebx
+# 39 ?' # d8 ?'
+; sete al
+# 0f ?' # 95 ?' # c0 ?'
+; movzx eax, al
+# 0f ?' # b6 ?' # c0 ?'
+; push eax
+# 50 ?'
+next
+
+defasm !=
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; cmp eax, ebx
+# 39 ?' # d8 ?'
+; sete al
+# 0f ?' # 95 ?' # c0 ?'
+; movzx eax, al
+# 0f ?' # b6 ?' # c0 ?'
+; push eax
+# 50 ?'
+next
+
+defasm <
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; cmp eax, ebx
+# 39 ?' # d8 ?'
+; setb al
+# 0f ?' # 92 ?' # c0 ?'
+; movzx eax, al
+# 0f ?' # b6 ?' # c0 ?'
+; push eax
+# 50 ?'
+next
+
+defasm >
+; pop ebx
+# 5b ?'
+; pop eax
+# 58 ?'
+; cmp eax, ebx
+# 39 ?' # d8 ?'
+; seta al
+# 0f ?' # 97 ?' # c0 ?'
+; movzx eax, al
+# 0f ?' # b6 ?' # c0 ?'
+; push eax
+# 50 ?'
+next