aboutsummaryrefslogtreecommitdiff
path: root/sts/ia32/math.sts
blob: 609a21a39f40387922ac7a461d30c776d18fcdb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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