From 405c4f104975e5456ce6b28ad31fd996d3f4b657 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 16 Oct 2020 12:45:33 +0300 Subject: Initial --- ia32/arithmetic.sts | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 ia32/arithmetic.sts (limited to 'ia32/arithmetic.sts') 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 -- cgit v1.2.3