From df0d6a4503a26508553510b4050eaa79f52e4e4e Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Sun, 18 Oct 2020 18:22:31 +0300 Subject: Another step to release. --- sts/ia32/math.sts | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sts/ia32/math.sts (limited to 'sts/ia32/math.sts') diff --git a/sts/ia32/math.sts b/sts/ia32/math.sts new file mode 100644 index 0000000..609a21a --- /dev/null +++ b/sts/ia32/math.sts @@ -0,0 +1,68 @@ +defasm + + # 58 ?' ; pop eax + # 01 ?' # 04 ?' # 24 ?' ; add [esp], eax +next + +defasm - + # 58 ?' ; pop eax + # 29 ?' # 04 ?' # 24 ?' ; sub [esp], eax +next + +defasm mul + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # f7 ?' # e3 ?' ; mul ebx + # 50 ?' ; push eax +next + +defasm mod + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 31 ?' # d2 ?' ; xor edx, edx + # f7 ?' # f3 ?' ; div ebx + # 52 ?' ; push edx +next + +defasm div + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 31 ?' # d2 ?' ; xor edx, edx + # f7 ?' # f3 ?' ; div ebx + # 50 ?' ; push eax +next + +defasm = + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 39 ?' # d8 ?' ; cmp eax, ebx + # 0f ?' # 94 ?' # c0 ?' ; sete al + # 0f ?' # b6 ?' # c0 ?' ; movzx eax, al + # 50 ?' ; push eax +next + +defasm != + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 39 ?' # d8 ?' ; cmp eax, ebx + # 0f ?' # 95 ?' # c0 ?' ; setne al + # 0f ?' # b6 ?' # c0 ?' ; movzx eax, al + # 50 ?' ; push eax +next + +defasm < + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 39 ?' # d8 ?' ; cmp eax, ebx + # 0f ?' # 92 ?' # c0 ?' ; setb al + # 0f ?' # b6 ?' # c0 ?' ; movzx eax, al + # 50 ?' ; push eax +next + +defasm > + # 5b ?' ; pop ebx + # 58 ?' ; pop eax + # 39 ?' # d8 ?' ; cmp eax, ebx + # 0f ?' # 97 ?' # c0 ?' ; seta al + # 0f ?' # b6 ?' # c0 ?' ; movzx eax, al + # 50 ?' ; push eax +next -- cgit v1.2.3