-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.inc
74 lines (62 loc) · 1.37 KB
/
macros.inc
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
macro m16 reg,value {
mov reg,(value) and $FF
orr reg,(value) and $FF00
}
macro m16eq reg,value {
moveq reg,(value) and $FF
orreq reg,(value) and $FF00
}
macro m16ne reg,value {
movne reg,(value) and $FF
orrne reg,(value) and $FF00
}
macro m16lt reg,value {
movlt reg,(value) and $FF
orrlt reg,(value) and $FF00
}
macro m16gt reg,value {
movgt reg,(value) and $FF
orrgt reg,(value) and $FF00
}
macro m32 reg,value {
mov reg,(value) and $FF
orr reg,(value) and $FF00
orr reg,(value) and $FF0000
orr reg,(value) and $FF000000
}
macro m32eq reg,value {
moveq reg,(value) and $FF
orreq reg,(value) and $FF00
orreq reg,(value) and $FF0000
orreq reg,(value) and $FF000000
}
macro m32ne reg,value {
movne reg,(value) and $FF
orrne reg,(value) and $FF00
orrne reg,(value) and $FF0000
orrne reg,(value) and $FF000000
}
macro m32lt reg,value {
movlt reg,(value) and $FF
orrlt reg,(value) and $FF00
orrlt reg,(value) and $FF0000
orrlt reg,(value) and $FF000000
}
macro m32gt reg,value {
movgt reg,(value) and $FF
orrgt reg,(value) and $FF00
orrgt reg,(value) and $FF0000
orrgt reg,(value) and $FF000000
}
macro FOR label, register, max{
mov register, max
cmp register, 0
beq label # _end$
label # _begin$:
sub register, #1
}
macro FOR_END label, register {
cmp register, #0
bne label # _begin$
label # _end$:
}