-
Notifications
You must be signed in to change notification settings - Fork 0
/
x86_instructions.txt
154 lines (122 loc) · 2.28 KB
/
x86_instructions.txt
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# x86 native code sequences for reflect_ilc.
# still a work in progress.
add : I4, I4 -> I4
pop eax
pop ebx
add eax, ebx
push eax
ldc.i4, ldc.i4.s : () -> I4
mov eax, %imm
push eax
ldloc, ldloc.s : () -> %local_type[%imm]
mov eax, [ebp - %local_offset[%imm]]
push eax
ldloca, ldloca.s : () -> I4
lea eax, ebp - %local_offset[%imm]
stloc, stloc.s : %local_type[%imm] -> ()
pop eax
mov eax, [ebp - %local_offset[%imm]]
ldarg, ldarg.s : () -> %arg_type[%imm]
mov eax, [ebp + %arg_offset[%imm]]
push eax
and : I4, I4 -> I4
pop eax
pop ebx
and eax, ebx
push eax
beq, beq.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
je %targ
bge, bge.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jge %targ
bge.un, bge.un.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jae %targ
bgt, bgt.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jg %targ
bgt.un, bgt.un.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
ja %targ
ble, ble.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jle %targ
ble.un, ble.un.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jbe %targ
blt, blt.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jl %targ
blt.un, blt.un.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jb %targ
bne, bne.s : I4, I4 -> ()
pop eax
pop ebx
cmp eax, ebx
jne %targ
br, br.s : () -> ()
jmp %targ
break : () -> ()
int 3
brfalse, brfalse.s : I4 -> ()
pop eax
cmp eax, 0
jz %targ
brtrue, brtrue.s : I4 -> ()
pop eax
cmp eax, 0
jnz %targ
# todo: call, calli, ceq, cgt, cgt.un, ckfinite, clt, clt.un
call : %tok_args -> %tok_ret
call %tok_symbol
add esp, %tok_args_size
push eax
conv.u1 : I4 -> I4
pop eax
movsz eax, al
push eax
dup : %top -> %top, %top
pop eax
push eax
push eax
stfld : %tok_decltype, %tok_type -> ()
pop eax
pop ebx
mov [ebx + %tok_fieldofs], ebx
stfld : I4, %tok_type -> ()
pop eax
pop ebx
mov [ebx + %tok_fieldofs], ebx
ret : I4 -> ()
pop eax
ret
ret : Ref -> ()
pop eax
ret
ret : () -> ()
ret
ret : %top -> ()
*** don't actually know how to return valuetype yet ***
newobj : %tok_args -> %tok_ret
xor eax, eax # todo: allocate memory, call ctor
push eax