-
Notifications
You must be signed in to change notification settings - Fork 12
/
vmasm.mac
161 lines (126 loc) · 1.46 KB
/
vmasm.mac
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
155
156
157
158
159
160
; vim: ft=nasm
%macro nop 0
db 0x00
%endmacro
%macro dup 0
db 0x01
%endmacro
%macro dsc 0
db 0x02
%endmacro
%macro exit 1
db 0x22
db %1
db 0x00
db 0x03
%endmacro
%macro add 0
db 0x10
%endmacro
%macro sub 0
db 0x11
%endmacro
%macro mul 0
db 0x12
%endmacro
%macro div 0
db 0x13
%endmacro
%macro mod 0
db 0x14
%endmacro
%macro mmd 0
db 0x15
%endmacro
%macro mmod 1
load %1
mmd
%endmacro
%macro neq 0
db 0x16
%endmacro
%macro sig 0
db 0x17
%endmacro
%macro in 0
db 0x20
%endmacro
%macro out 0
db 0x21
%endmacro
%macro load 1
db 0x22
dw %1
%endmacro
%macro print 1
load %1
out
%endmacro
%macro jump 1
load %1
db 0x30
%endmacro
%macro jiz 1
load %1
db 0x31
%endmacro
%macro jnz 1
load %1
db 0x32
%endmacro
%macro jlt 1
load %1
db 0x33
%endmacro
%macro jgt 1
load %1
db 0x34
%endmacro
%macro jle 1
load %1
db 0x35
%endmacro
%macro jge 1
load %1
db 0x36
%endmacro
%macro sto 0
db 0x40
%endmacro
%macro stor 1
load %1
db 0x40
%endmacro
%macro store 2
ims %1
stor %2
%endmacro
%macro ret 0
db 0x41
%endmacro
%macro return 1
ims %1
ret
dms %1
%endmacro
%macro imp 0
db 0x50
%endmacro
%macro dmp 0
db 0x51
%endmacro
%macro ims 1
load %1
db 0x52
%endmacro
%macro dms 1
load %1
db 0x53
%endmacro
%macro loadinp 0
load 0x0020
in
sub
sto
imp
%endmacro