OpenCores
URL https://opencores.org/ocsvn/1664/1664/trunk

Subversion Repositories 1664

[/] [1664/] [trunk/] [arci/] [amd64/] [macro/] [macro.inc] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mrdmkg
%ifndef globalmacroincluded
2
%define globalmacroincluded
3
 
4
%macro hst 1
5
db 0x3e
6
%1
7
%endmacro
8
 
9
%macro hwnt 1
10
db 0x2e
11
%1
12
%endmacro
13
 
14
%macro call_return_redirect 2
15
lea rax,[rel %2]
16
push rax
17
jmp %1
18
%endmacro
19
 
20
%macro code_local 1
21
section .text
22
%1
23
%endmacro
24
 
25
%macro codigi_global 1
26
section .text
27
%1
28
global %1
29
%endmacro
30
 
31
%macro code_global 1
32
section .text
33
%1
34
global %1
35
%endmacro
36
 
37
%macro code_global_ 1 ;skip text section declaration (just in case)
38
;section .text
39
%1
40
global %1
41
%endmacro
42
 
43
%macro bphere 0
44
%ifdef bpenable
45
db 0xcc
46
%endif
47
%endmacro
48
 
49
%macro mcall 1+
50
%if %0>6
51
mov [rsp+0x28],%7
52
%endif
53
%if %0>5
54
mov [rsp+0x20],%6
55
%endif
56
%if %0>4
57
mov r9,%5
58
%endif
59
%if %0>3
60
mov r8%4
61
%endif
62
%if %0>2
63
mov rdx,%3
64
%endif
65
%if %0>1
66
mov rcx,%2
67
%endif
68
call %1
69
%endmacro
70
 
71
%macro shortmov 2
72
push %2
73
pop %1
74
%endmacro
75
 
76
%macro msyscall 1+
77
%if %0>6
78
mov r9,%7
79
%endif
80
%if %0>5
81
mov r8,%6
82
%endif
83
%if %0>4
84
mov r10,%5
85
%endif
86
%if %0>3
87
mov rdx,%4
88
%endif
89
%if %0>2
90
mov rsi,%3
91
%endif
92
%if %0>1
93
mov rdi,%2
94
%endif
95
;shortmov rax,%1
96
push %1
97
pop rax
98
 
99
syscall
100
%endmacro
101
 
102
%macro msyscallc 1+ ; C code
103
%if %0>6
104
mov r9,%7
105
%endif
106
%if %0>5
107
mov r8,%6
108
%endif
109
%if %0>4
110
mov rcx,%5
111
%endif
112
%if %0>3
113
mov rdx,%4
114
%endif
115
%if %0>2
116
mov rsi,%3
117
%endif
118
%if %0>1
119
mov rdi,%2
120
%endif
121
;shortmov rax,%1
122
push %1
123
pop rax
124
 
125
syscall
126
%endmacro
127
 
128
%macro zeroextend8 1
129
db %1
130
align 0x08 db 0
131
%endmacro
132
 
133
%macro definedcall 1
134
%ifndef using_%1
135
%define using_%1
136
%endif
137
call _%1
138
%endmacro
139
 
140
%macro using 1 ;requires 2x %endif
141
%ifdef using_%1
142
%ifndef used_%1
143
%define used_%1
144
%endmacro
145
 
146
%macro endusing 0 ;yasm bug
147
%endif
148
%endif
149
%endmacro
150
 
151
%endif ;macro include end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.