Parent Directory | Revision Log
Revision 1.6 - (view) (download)
1 : | Isibaar | 1.1 | ;/**************************************************************************** |
2 : | ; * | ||
3 : | ; * XVID MPEG-4 VIDEO CODEC | ||
4 : | ; * - NASM common header - | ||
5 : | ; * | ||
6 : | ; * Copyright (C) 2008 Michael Militzer | ||
7 : | ; * | ||
8 : | ; * This program is free software ; you can redistribute it and/or modify | ||
9 : | ; * it under the terms of the GNU General Public License as published by | ||
10 : | ; * the Free Software Foundation ; either version 2 of the License, or | ||
11 : | ; * (at your option) any later version. | ||
12 : | ; * | ||
13 : | ; * This program is distributed in the hope that it will be useful, | ||
14 : | ; * but WITHOUT ANY WARRANTY ; without even the implied warranty of | ||
15 : | ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 : | ; * GNU General Public License for more details. | ||
17 : | ; * | ||
18 : | ; * You should have received a copy of the GNU General Public License | ||
19 : | ; * along with this program ; if not, write to the Free Software | ||
20 : | ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 : | ; * | ||
22 : | Isibaar | 1.6 | ; * $Id: nasm.inc,v 1.5 2008/12/04 18:30:36 Isibaar Exp $ |
23 : | Isibaar | 1.1 | ; * |
24 : | ; ***************************************************************************/ | ||
25 : | |||
26 : | %ifdef ARCH_IS_X86_64 | ||
27 : | |||
28 : | BITS 64 | ||
29 : | DEFAULT REL | ||
30 : | |||
31 : | %define SECTION_ALIGN 32 | ||
32 : | |||
33 : | %ifdef WINDOWS | ||
34 : | |||
35 : | %define prm1 rcx | ||
36 : | %define prm2 rdx | ||
37 : | %define prm3 r8 | ||
38 : | %define prm4 r9 | ||
39 : | %define prm5 [rsp+40] | ||
40 : | %define prm6 [rsp+48] | ||
41 : | %define prm7 [rsp+56] | ||
42 : | %define prm8 [rsp+64] | ||
43 : | |||
44 : | %define prm1d ecx | ||
45 : | %define prm2d edx | ||
46 : | %define prm3d r8d | ||
47 : | %define prm4d r9d | ||
48 : | %define prm5d dword prm5 | ||
49 : | %define prm6d dword prm6 | ||
50 : | %define prm7d dword prm7 | ||
51 : | %define prm8d dword prm8 | ||
52 : | |||
53 : | Isibaar | 1.3 | %macro PUSH_XMM6_XMM7 0 |
54 : | movdqa [_ESP+PTR_SIZE], xmm6 | ||
55 : | movdqa [_ESP+PTR_SIZE+16], xmm7 | ||
56 : | %endmacro | ||
57 : | |||
58 : | %macro POP_XMM6_XMM7 0 | ||
59 : | movdqa xmm6, [_ESP+PTR_SIZE] | ||
60 : | movdqa xmm7, [_ESP+PTR_SIZE+16] | ||
61 : | %endmacro | ||
62 : | |||
63 : | Isibaar | 1.1 | %else ; Linux |
64 : | |||
65 : | %define prm1 rdi | ||
66 : | %define prm2 rsi | ||
67 : | %define prm3 rdx | ||
68 : | %define prm4 rcx | ||
69 : | %define prm5 r8 | ||
70 : | %define prm6 r9 | ||
71 : | %define prm7 [rsp+8] | ||
72 : | %define prm8 [rsp+16] | ||
73 : | |||
74 : | %define prm1d edi | ||
75 : | %define prm2d esi | ||
76 : | %define prm3d edx | ||
77 : | %define prm4d ecx | ||
78 : | %define prm5d r8d | ||
79 : | %define prm6d r9d | ||
80 : | %define prm7d dword prm7 | ||
81 : | %define prm8d dword prm8 | ||
82 : | |||
83 : | Isibaar | 1.3 | %define PUSH_XMM6_XMM7 |
84 : | %define POP_XMM6_XMM7 | ||
85 : | |||
86 : | Isibaar | 1.1 | %endif |
87 : | |||
88 : | %define _EAX rax | ||
89 : | %define _EBX rbx | ||
90 : | %define _ECX rcx | ||
91 : | %define _EDX rdx | ||
92 : | %define _ESI rsi | ||
93 : | %define _EDI rdi | ||
94 : | %define _EBP rbp | ||
95 : | %define _ESP rsp | ||
96 : | |||
97 : | %define TMP0 r10 | ||
98 : | %define TMP1 r11 | ||
99 : | |||
100 : | %define TMP0d r10d | ||
101 : | %define TMP1d r11d | ||
102 : | |||
103 : | %define PTR_SIZE 8 | ||
104 : | %define PTR_TYPE qword | ||
105 : | |||
106 : | Isibaar | 1.4 | %ifdef __YASM_VERSION_ID__ |
107 : | Isibaar | 1.5 | %define XVID_MOVSXD movsxd |
108 : | Isibaar | 1.4 | %else |
109 : | Isibaar | 1.5 | %define XVID_MOVSXD movsx |
110 : | Isibaar | 1.4 | %endif |
111 : | Isibaar | 1.3 | |
112 : | Isibaar | 1.1 | %else |
113 : | |||
114 : | %define SECTION_ALIGN 16 | ||
115 : | |||
116 : | BITS 32 | ||
117 : | |||
118 : | %define prm1 [esp + 4] | ||
119 : | %define prm2 [esp + 8] | ||
120 : | %define prm3 [esp + 12] | ||
121 : | %define prm4 [esp + 16] | ||
122 : | %define prm5 [esp + 20] | ||
123 : | %define prm6 [esp + 24] | ||
124 : | %define prm7 [esp + 28] | ||
125 : | %define prm8 [esp + 32] | ||
126 : | |||
127 : | %define prm1d dword prm1 | ||
128 : | %define prm2d dword prm2 | ||
129 : | %define prm3d dword prm3 | ||
130 : | %define prm4d dword prm4 | ||
131 : | %define prm5d dword prm5 | ||
132 : | %define prm6d dword prm6 | ||
133 : | %define prm7d dword prm7 | ||
134 : | %define prm8d dword prm8 | ||
135 : | |||
136 : | %define _EAX eax | ||
137 : | %define _EBX ebx | ||
138 : | %define _ECX ecx | ||
139 : | %define _EDX edx | ||
140 : | %define _ESI esi | ||
141 : | %define _EDI edi | ||
142 : | %define _EBP ebp | ||
143 : | %define _ESP esp | ||
144 : | |||
145 : | %define TMP0 ecx | ||
146 : | %define TMP1 edx | ||
147 : | |||
148 : | %define TMP0d ecx | ||
149 : | %define TMP1d edx | ||
150 : | |||
151 : | %define PTR_SIZE 4 | ||
152 : | %define PTR_TYPE dword | ||
153 : | |||
154 : | Isibaar | 1.3 | %define PUSH_XMM6_XMM7 |
155 : | %define POP_XMM6_XMM7 | ||
156 : | |||
157 : | Isibaar | 1.5 | %define XVID_MOVSXD movsx |
158 : | Isibaar | 1.1 | %endif |
159 : | |||
160 : | |||
161 : | %ifdef WINDOWS | ||
162 : | %define PREFIX | ||
163 : | %endif | ||
164 : | |||
165 : | Isibaar | 1.2 | %ifdef NO_PREFIX |
166 : | %undef PREFIX | ||
167 : | %endif | ||
168 : | |||
169 : | Isibaar | 1.1 | %macro DATA 0 |
170 : | %ifdef FORMAT_COFF | ||
171 : | SECTION .rodata | ||
172 : | %else | ||
173 : | SECTION .rodata align=SECTION_ALIGN | ||
174 : | %endif | ||
175 : | %endmacro | ||
176 : | |||
177 : | Isibaar | 1.4 | %macro TEXT 0 |
178 : | Isibaar | 1.6 | %ifidn __OUTPUT_FORMAT__,macho |
179 : | SECTION .text align=SECTION_ALIGN | ||
180 : | %else | ||
181 : | Isibaar | 1.4 | SECTION .rotext align=SECTION_ALIGN |
182 : | Isibaar | 1.6 | %endif |
183 : | Isibaar | 1.4 | %endmacro |
184 : | |||
185 : | Isibaar | 1.1 | %macro cglobal 1 |
186 : | %ifdef PREFIX | ||
187 : | %ifdef MARK_FUNCS | ||
188 : | global _%1:function %1.endfunc-%1 | ||
189 : | %define %1 _%1:function %1.endfunc-%1 | ||
190 : | %define ENDFUNC .endfunc: | ||
191 : | %else | ||
192 : | global _%1 | ||
193 : | %define %1 _%1 | ||
194 : | %define ENDFUNC | ||
195 : | %endif | ||
196 : | %else | ||
197 : | %ifdef MARK_FUNCS | ||
198 : | global %1:function %1.endfunc-%1 | ||
199 : | %define ENDFUNC .endfunc: | ||
200 : | %else | ||
201 : | global %1 | ||
202 : | %define ENDFUNC | ||
203 : | %endif | ||
204 : | %endif | ||
205 : | %endmacro |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |