-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacro.inc
More file actions
64 lines (52 loc) · 950 Bytes
/
macro.inc
File metadata and controls
64 lines (52 loc) · 950 Bytes
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
%define pc r15
%define w r14
%define rstack r13
%define _lw 0
%macro native 3
section .data
wh_ %+ %2 : dq _lw
db 0 ; to mark the name start
db %1, 0
db %3
%define _lw wh_%+ %2
xt_ %+ %2 : dq i_ %+ %2
section .text
i_ %+ %2:
%endmacro
%macro native 2
native %1, %2, 0
%endmacro
%macro colon 3
section .data
wh_ %+ %2 : dq _lw
db 0 ; to mark the name start
str_ %+ %2: db %1, 0
db %3
%define _lw wh_ %+ %2
xt_ %+ %2 : dq i_docol
%endmacro
%macro colon 2
colon %1, %2, 0
%endmacro
%macro rpush 1
sub rstack, 8
mov qword [rstack], %1
%endmacro
%macro rpop 1
mov %1, qword [rstack]
add rstack, 8
%endmacro
%macro const 2
%defstr %%__cnst_str %1
native %%__cnst_str, %1
push qword %2
jmp next
%endmacro
%macro branch 1
dq xt_branch
dq %1
%endmacro
%macro branch0 1
dq xt_branch0
dq %1
%endmacro