Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleh...
[gecko.git] / other-licenses / 7zstub / src / Asm / x86 / 7zAsm.asm
blob8c30d7b7e380f7fbc86f9dbc194a95f5a74a3c64
1 ; 7zAsm.asm -- ASM macros
2 ; 2018-02-03 : Igor Pavlov : Public domain
4 MY_ASM_START macro
5 ifdef x64
6 .code
7 else
8 .386
9 .model flat
10 _TEXT$00 SEGMENT PARA PUBLIC 'CODE'
11 endif
12 endm
14 MY_PROC macro name:req, numParams:req
15 align 16
16 proc_numParams = numParams
17 ifdef x64
18 proc_name equ name
19 else
20 proc_name equ @CatStr(@,name,@, %numParams * 4)
21 endif
22 proc_name PROC
23 endm
25 MY_ENDP macro
26 ifdef x64
27 ret
28 else
29 if proc_numParams LT 3
30 ret
31 else
32 ret (proc_numParams - 2) * 4
33 endif
34 endif
35 proc_name ENDP
36 endm
38 ifdef x64
39 REG_SIZE equ 8
40 REG_LOGAR_SIZE equ 3
41 else
42 REG_SIZE equ 4
43 REG_LOGAR_SIZE equ 2
44 endif
46 x0 equ EAX
47 x1 equ ECX
48 x2 equ EDX
49 x3 equ EBX
50 x4 equ ESP
51 x5 equ EBP
52 x6 equ ESI
53 x7 equ EDI
55 x0_W equ AX
56 x1_W equ CX
57 x2_W equ DX
58 x3_W equ BX
60 x5_W equ BP
61 x6_W equ SI
62 x7_W equ DI
64 x0_L equ AL
65 x1_L equ CL
66 x2_L equ DL
67 x3_L equ BL
69 x0_H equ AH
70 x1_H equ CH
71 x2_H equ DH
72 x3_H equ BH
74 ifdef x64
75 x5_L equ BPL
76 x6_L equ SIL
77 x7_L equ DIL
79 r0 equ RAX
80 r1 equ RCX
81 r2 equ RDX
82 r3 equ RBX
83 r4 equ RSP
84 r5 equ RBP
85 r6 equ RSI
86 r7 equ RDI
87 x8 equ r8d
88 x9 equ r9d
89 x10 equ r10d
90 x11 equ r11d
91 x12 equ r12d
92 x13 equ r13d
93 x14 equ r14d
94 x15 equ r15d
95 else
96 r0 equ x0
97 r1 equ x1
98 r2 equ x2
99 r3 equ x3
100 r4 equ x4
101 r5 equ x5
102 r6 equ x6
103 r7 equ x7
104 endif
106 MY_PUSH_4_REGS macro
107 push r3
108 push r5
109 push r6
110 push r7
111 endm
113 MY_POP_4_REGS macro
114 pop r7
115 pop r6
116 pop r5
117 pop r3
118 endm
121 ifdef x64
123 ; for WIN64-x64 ABI:
125 REG_PARAM_0 equ r1
126 REG_PARAM_1 equ r2
127 REG_PARAM_2 equ r8
128 REG_PARAM_3 equ r9
130 MY_PUSH_PRESERVED_REGS macro
131 MY_PUSH_4_REGS
132 push r12
133 push r13
134 push r14
135 push r15
136 endm
139 MY_POP_PRESERVED_REGS macro
140 pop r15
141 pop r14
142 pop r13
143 pop r12
144 MY_POP_4_REGS
145 endm
147 endif