forked from qwordAtGitHub/SmplMath
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSmplReg.inc
687 lines (619 loc) · 18.8 KB
/
SmplReg.inc
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
;/************************************************************
; * This file is an extension of the SmplMath macros-system. *
; * *
; * Copyright by HSE, 2019-2022 *
; * *
; * https://github.com/ASMHSE/SmplMath/ *
; * *
; * Further Copyright and Legal statements are located *
; * in the documentation (Documentation.pdf). *
; * *
; ************************************************************/
IFDEF __SMPLREG__
.err <SmplReg: double inclusion of SmplReg.inc>
freg_glb_error = 1
ELSE
__SMPLREG__ TEXTEQU <010001>
freg_glb_error = 0
ENDIF
IFNDEF BOOLEAN_BYTE
BOOLEAN_BYTE typedef BYTE
ENDIF
IFNDEF REAL2_BYTE
REAL2_BYTE typedef WORD
ENDIF
IFNDEF REAL4_BYTE
REAL4_BYTE typedef DWORD
ENDIF
IFNDEF REAL8_BYTE
REAL8_BYTE typedef REAL8
ENDIF
IFNDEF OWORD_BYTE
OWORD_BYTE typedef OWORD
ENDIF
unique_reg_cntr = 0
maximum_reg_cntr = 0
counter_reg_cntr = 0
freg_reset macro
ifndef counter_reg_cntr
counter_reg_cntr = 0
else
counter_reg_cntr = counter_reg_cntr + 1
endif
endm
get_unique_reglbl macro name:req
ifndef counter_reg_cntr
counter_reg_cntr = 0
endif
unique_reg_cntr = unique_reg_cntr + 1
EXITM @CatStr(<&name>,%unique_reg_cntr,<@>,counter_reg_cntr)
endm
get_last_reglbl macro name:req
EXITM @CatStr(<&name>,%unique_reg_cntr,<@>,counter_reg_cntr)
endm
set_previous_reglbl macro
unique_reg_cntr = unique_reg_cntr - 1
endm
@fregTLS_warning macro
%echo @FileCur: WARNING: code not thread save: line @CatStr(%@Line)
endm
fregTLS_curr_line = -1
freg_tls_curr_used = 0
freg_tls_name TEXTEQU <>
freg_tls_cb = 0
freg_tls_last TEXTEQU <>
freg_tls_last_size = 0
freg_tls_byte = 0
freg_tls_alloc_line = 0
@freg_TLS? macro
IFB freg_tls_name
EXITM <0>
% ELSEIFDEF freg_tls_name
EXITM <1>
ENDIF
EXITM <0>
endm
@fregTLS_line_alloc macro _type:req
IFB freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG17] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
% ELSEIFNDEF freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG18] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
ENDIF
;IF fregTLS_curr_line NE @Line
; fregTLS_curr_line = @Line
; freg_tls_curr_used = 0
; freg_tls_byte = 0
;ELSE
; freg_tls_curr_used = 0
;ENDIF
fsta_size = sizeof _type
IFE fsta_size
freg_glb_error_msg TEXTEQU <[#CG19] invalid type qualifier / type not supported by current back end: _type>
freg_glb_error = 1
% .err freg_glb_error_msg
EXITM freg_retval@error(_type)
ENDIF
IF fsta_size EQ 12
fsta_align = 4
ELSE
fsta_align = fsta_size
ENDIF
IF fsta_align GT @WordSize
fsta_align = @WordSize
ENDIF
IF ((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align))+fsta_size GT freg_tls_cb
% .err <[#CG20] TLS: buffer to small - increase size at line @CatStr(%freg_tls_alloc_line) : fregTLS[,@CatStr(%((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align))+fsta_size)]>
freg_glb_error = 1
freg_tls_curr_used = ((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align)) + fsta_size
EXITM freg_retval@error(_type)
ENDIF
fsta_var TEXTEQU <&_type ptr >,freg_tls_name,<[>,%((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align)),<]>
freg_tls_curr_used = ((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align)) + fsta_size
EXITM fsta_var
endm
@fregTLS_line_retrieve macro _type:req
IFB freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG17] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
% ELSEIFNDEF freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG18] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
ENDIF
;IF fregTLS_curr_line NE @Line
; fregTLS_curr_line = @Line
; freg_tls_curr_used = 0
; freg_tls_byte = 0
;ELSE
; freg_tls_curr_used = 0
;ENDIF
fsta_size = sizeof _type
IFE fsta_size
freg_glb_error_msg TEXTEQU <[#CG19] invalid type qualifier / type not supported by current back end: _type>
freg_glb_error = 1
% .err freg_glb_error_msg
EXITM freg_retval@error(_type)
ENDIF
IF fsta_size EQ 12
fsta_align = 4
ELSE
fsta_align = fsta_size
ENDIF
IF fsta_align GT @WordSize
fsta_align = @WordSize
ENDIF
fsta_var TEXTEQU <&_type ptr >,freg_tls_name,<[>,%((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align))- fsta_size,<]>
freg_tls_curr_used = ((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align)) - fsta_size
EXITM fsta_var
endm
@fregTLS_line_access macro _type:req
IFB freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG17] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
% ELSEIFNDEF freg_tls_name
freg_glb_error_msg TEXTEQU <[#CG18] thread local storage not initialized>
freg_glb_error = 1
EXITM freg_retval@error(_type)
ENDIF
;IF fregTLS_curr_line NE @Line
; fregTLS_curr_line = @Line
; freg_tls_curr_used = 0
; freg_tls_byte = 0
;ELSE
; freg_tls_curr_used = 0
;ENDIF
fsta_size = sizeof _type
IFE fsta_size
freg_glb_error_msg TEXTEQU <[#CG19] invalid type qualifier / type not supported by current back end: _type>
freg_glb_error = 1
% .err freg_glb_error_msg
EXITM freg_retval@error(_type)
ENDIF
IF fsta_size EQ 12
fsta_align = 4
ELSE
fsta_align = fsta_size
ENDIF
IF fsta_align GT @WordSize
fsta_align = @WordSize
ENDIF
fsta_var TEXTEQU <&_type ptr >,freg_tls_name,<[>,%((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align))- fsta_size,<]>
; freg_tls_curr_access = ((freg_tls_curr_used+(fsta_align-1))AND(-fsta_align)) - fsta_size
EXITM fsta_var
endm
freg_retval@error macro _type
LOCAL lbl
.data?
lbl _type ?
.code
EXITM <lbl>
endm
;------------------------------------------------------------------------------
unique_reg_cntr = 0
get_unique_reglbl macro name:req
unique_reg_cntr = unique_reg_cntr + 1
EXITM @CatStr(<&name>,%unique_reg_cntr)
endm
get_last_reglbl macro name:req
EXITM @CatStr(<&name>,%unique_reg_cntr)
endm
set_previous_reglbl macro; name:req
unique_reg_cntr = unique_reg_cntr - 1
EXITM
endm
freg_correction macro val1:req
freg_tls_curr_used = freg_tls_curr_used &val1 *@WordSize
EXITM
endm
;------------------------------------------------------------------------------
freg_push macro reg:REQ
IFNDEF freg_line
freg_line = @Line
ENDIF
IFE @freg_TLS?()
@fregTLS_warning
freg_bool_byte TEXTEQU get_unique_reglbl(<freg_bool_byte_>)
if unique_reg_cntr GT maximum_reg_cntr
IF freg_line NE @Line
freg_line = @Line
.data?
align 4
.code
ENDIF
.data?
freg_bool_byte db 8 dup (?)
.code
maximum_reg_cntr = unique_reg_cntr
endif
ELSE
if TYPE(reg) eq BYTE
freg_bool_byte TEXTEQU @fregTLS_line_alloc(BOOLEAN_BYTE)
elseif TYPE(reg) eq WORD
freg_bool_byte TEXTEQU @fregTLS_line_alloc(REAL2_BYTE)
elseif TYPE(reg) eq DWORD
freg_bool_byte TEXTEQU @fregTLS_line_alloc(REAL4_BYTE)
elseif TYPE(reg) eq QWORD
freg_bool_byte TEXTEQU @fregTLS_line_alloc(REAL8_BYTE)
elseif TYPE(reg) eq OWORD
freg_bool_byte TEXTEQU @fregTLS_line_alloc(OWORD_BYTE)
else
if @WordSize eq 8
freg_bool_byte TEXTEQU @fregTLS_line_alloc(REAL8_BYTE)
else
freg_bool_byte TEXTEQU @fregTLS_line_alloc(REAL4_BYTE)
endif
endif
ENDIF
if TYPE(reg) eq BYTE
mov byte ptr freg_bool_byte , reg
elseif TYPE(reg) eq WORD
mov word ptr freg_bool_byte , reg
elseif TYPE(reg) eq DWORD
mov dword ptr freg_bool_byte , reg
elseif TYPE(reg) eq QWORD
mov qword ptr freg_bool_byte , reg
elseif TYPE(reg) eq OWORD
movdqa oword ptr freg_bool_byte , reg
else
if @WordSize eq 8
mov qword ptr freg_bool_byte , reg
else
mov dword ptr freg_bool_byte , reg
endif
;.err reg is more than qword
endif
endm
freg_pop macro reg:REQ
IFE @freg_TLS?()
freg_bool_byte TEXTEQU get_last_reglbl(<freg_bool_byte_>)
set_previous_reglbl
ELSE
if TYPE(reg) eq BYTE
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(BOOLEAN_BYTE)
elseif TYPE(reg) eq WORD
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(REAL2_BYTE)
elseif TYPE(reg) eq DWORD
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(REAL4_BYTE)
elseif TYPE(reg) eq QWORD
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(REAL8_BYTE)
elseif TYPE(reg) eq OWORD
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(OWORD_BYTE)
else
if @WordSize eq 8
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(REAL8_BYTE)
else
freg_bool_byte TEXTEQU @fregTLS_line_retrieve(REAL4_BYTE)
endif
endif
ENDIF
if TYPE(reg) eq BYTE
mov reg, byte ptr freg_bool_byte
elseif TYPE(reg) eq WORD
mov reg, word ptr freg_bool_byte
elseif TYPE(reg) eq DWORD
mov reg, dword ptr freg_bool_byte
elseif TYPE(reg) eq QWORD
mov reg, qword ptr freg_bool_byte
elseif TYPE(reg) eq OWORD
movdqa reg, oword ptr freg_bool_byte
else
if @WordSize eq 8
mov reg,qword ptr freg_bool_byte
else
mov reg,dword ptr freg_bool_byte
endif
;.err reg is more than qword
endif
endm
freg_peek macro reg:REQ
IFE @freg_TLS?()
freg_bool_byte TEXTEQU get_last_reglbl(<freg_bool_byte_>)
; set_previous_reglbl
ELSE
if TYPE(reg) eq BYTE
freg_bool_byte TEXTEQU @fregTLS_line_access(BOOLEAN_BYTE)
elseif TYPE(reg) eq WORD
freg_bool_byte TEXTEQU @fregTLS_line_access(REAL2_BYTE)
elseif TYPE(reg) eq DWORD
freg_bool_byte TEXTEQU @fregTLS_line_access(REAL4_BYTE)
elseif TYPE(reg) eq QWORD
freg_bool_byte TEXTEQU @fregTLS_line_access(REAL8_BYTE)
elseif TYPE(reg) eq OWORD
freg_bool_byte TEXTEQU @fregTLS_line_access(OWORD_BYTE)
else
if @WordSize eq 8
freg_bool_byte TEXTEQU @fregTLS_line_access(REAL8_BYTE)
else
freg_bool_byte TEXTEQU @fregTLS_line_access(REAL4_BYTE)
endif
endif
ENDIF
if TYPE(reg) eq BYTE
mov reg, byte ptr freg_bool_byte
elseif TYPE(reg) eq WORD
mov reg, word ptr freg_bool_byte
elseif TYPE(reg) eq DWORD
mov reg,dword ptr freg_bool_byte
elseif TYPE(reg) eq QWORD
mov reg,qword ptr freg_bool_byte
elseif TYPE(reg) eq OWORD
movdqa reg,oword ptr freg_bool_byte
else
if @WordSize eq 8
mov reg,qword ptr freg_bool_byte
else
mov reg,dword ptr freg_bool_byte
endif
;.err reg is more than qword
endif
endm
fregTLS macro name:=<freg_tls>,cb:=<4*@WordSize>
; IFB FSBE_ENTITY
; EXITM <&name&[1]:BYTE>
; ELSEIF freg_glb_error
; EXITM <&name&[1]:BYTE>
; ENDIF
% IFDEF freg_tls_name
.err <TLS duplication>
ELSE
freg_tls_curr_used = 0 ; 04/10/2020 HSE
freg_tls_alloc_line = @Line
freg_tls_cb = 0; FSBE_FNC(%FSBE_ENTITY,%FSEN_TLS_SIZE)
IF freg_tls_cb NE 0 AND freg_tls_cb GT cb
freg_tls_cb = (freg_tls_cb+15) AND (-16)
ELSE
freg_tls_cb = (cb+15) AND (-16)
ENDIF
freg_tls_name TEXTEQU @TrimStr(<&name>)
EXITM @CatStr(<&name&[freg_tls_cb]:BYTE>)
ENDIF
endm
freg_pushv macro var:REQ, reg
ifnb <reg>
mov ®, &var
freg_push ®
else
if @WordSize eq 4
mov eax, &var
freg_push eax
else
mov r10, &var
freg_push r10
endif
endif
endm
freg_popv macro var:REQ, reg
ifnb <reg>
freg_pop ®
mov &var, ®
else
if @WordSize eq 4
freg_pop eax
mov &var, eax
else
freg_pop r10
mov &var, r10
endif
endif
endm
freg_peekv macro var:REQ, reg
ifnb <reg>
freg_peek ®
mov &var, ®
else
if @WordSize eq 4
freg_peek eax
mov &var, eax
else
freg_peek r10
mov &var, r10
endif
endif
endm
freg_pushad macro
if @WordSize eq 4
freg_push EAX
freg_push ECX
freg_push EDX
freg_push EBX
freg_push ESP
freg_push EBP
freg_push ESI
freg_push EDI
else
freg_push RAX
freg_push RCX
freg_push RDX
freg_push RBX
freg_push RSP
freg_push RBP
freg_push RSI
freg_push RDI
endif
endm
freg_popad macro
if @WordSize eq 4
freg_pop EDI
freg_pop ESI
freg_pop EBP
freg_pop ESP
freg_pop EBX
freg_pop EDX
freg_pop ECX
freg_pop EAX
else
freg_pop RDI
freg_pop RSI
freg_pop RBP
freg_pop RSP
freg_pop RBX
freg_pop RDX
freg_pop RCX
freg_pop RAX
endif
endm
;
;
; freg_PushAll, freg_PopAll, freg_PushAllRev and freg_PopAllRev
; are adaptations from
; PushAll, PopAll, PushAllRev and PopAllRev in
; Title: System.inc
; Author: G. Friedrich
; Version: C.1.0
; Purpose: ObjAsm collection of useful macros.
; Notes: Version C.1.0, October 2017
; - First release.
; ObjAsm Homepage = http://objasm.x10host.com/
; ObjAsm Development repository = https://github.com/ObjAsm
; ObjAsm Online documentation = https://biterider.gitbook.io/objasm/
;
; Macro: freg_PushAll
; Purpose: Push recursively all arguments on stack.
; Arguments: Arg1: List of arguments.
; Returns: Nothing.
freg_PushAll macro ArgList:vararg
$$EaxUsed = FALSE
%for $$Arg, <ArgList>
ifnb <$$Arg>
$$UArg textequ $Upper($$Arg)
if $$EaxUsed ne FALSE
$$IsEax = FALSE
$$EaxPos InStr 1, $$UArg, <RAX>
if $$EaxPos ne 0
$$IsEax = TRUE
if $$EaxPos gt 1
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos - 1, 1)) gt 0
$$IsEax = FALSE
endif
endif
if ( $$EaxPos ne 0 and $$EaxPos le @SizeStr(%$$UArg) - 3)
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos + 3, 1)) gt 0
$$IsEax = FALSE
endif
endif
endif
if $$IsEax ne FALSE
.err <RAX register already in use.>
exitm
else
$$EaxPos InStr 1, $$UArg, <EAX>
if $$EaxPos ne 0
$$IsEax = TRUE
if $$EaxPos gt 1
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos - 1, 1)) gt 0
$$IsEax = FALSE
endif
endif
if ( $$EaxPos ne 0 and $$EaxPos le @SizeStr(%$$UArg) - 3)
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos + 3, 1)) gt 0
$$IsEax = FALSE
endif
endif
endif
endif
if $$IsEax ne FALSE
.err <EAX register already in use.>
exitm
else
$$EaxPos InStr 1, $$UArg, <AX>
if $$EaxPos ne 0
$$IsEax = TRUE
if $$EaxPos gt 1
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos - 1, 1)) gt 0
$$IsEax = FALSE
endif
endif
if ($$EaxPos ne 0 and $$EaxPos le @SizeStr(%$$UArg) - 2)
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos + 2, 1)) gt 0
$$IsEax = FALSE
endif
endif
endif
endif
if $$IsEax ne FALSE
.err <AX register already in use.>
exitm
else
$$EaxPos InStr 1, $$UArg, <AL>
if $$EaxPos ne 0
$$IsEax = TRUE
if $$EaxPos gt 1
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos - 1, 1)) gt 0
$$IsEax = FALSE
endif
endif
if ($$EaxPos ne 0 and $$EaxPos le @SizeStr(%$$UArg) - 2)
if @InStr(1, %??WordChars, @SubStr(%$$UArg, $$EaxPos + 2, 1)) gt 0
$$IsEax = FALSE
endif
endif
endif
endif
if $$IsEax ne FALSE
.err <AL register already in use.>
exitm
endif
endif
$$Pos1 InStr 1, $$UArg, <ADDR >
if $$Pos1 eq 1
$$Attributes = opattr(@SubStr($$Arg, $$Pos1 + 5))
if ($$Attributes eq (OAT_RELOCATABLE or OAT_NO_ERROR)) or \
($$Attributes eq (OAT_RELOCATABLE or OAT_NO_ERROR or OAT_SS_RELATIVE))
$$EaxUsed = TRUE
lea xax, @SubStr($$Arg, 6)
freg_push xax
else
if @InStr(6, $$Arg, <[>)
$$EaxUsed = TRUE
lea xax, @SubStr($$Arg, 6)
freg_push xax
else
freg_push offset(@SubStr($$Arg, 6))
endif
endif
else
if $IsFloat($$Arg)
db 68h
REAL4 $$Arg ;;push REAL4 value
else
freg_push $$Arg ;;push one argument and repeat
endif
endif
endif
endm
endm
;
; Macro: freg_PopAll
; Purpose: Pop a list of arguments of the stack.
; Arguments: Arg1: List of arguments.
; Returns: Nothing.
freg_PopAll macro ArgList:vararg
%for $$Arg, <ArgList>
freg_pop $$Arg ;;push one argument and repeat
endm
endm
;
; Macro: freg_PushAllRev
; Purpose: Push all arguments on stack in reverse order.
; Arguments: Arg1: List of arguments.
; Returns: Nothing.
freg_PushAllRev macro ArgList:vararg
freg_PushAll $ArgRev(ArgList)
endm
;
; Macro: freg_PopAllRev
; Purpose: Pop recursively all arguments on stack in reverse order.
; Arguments: Arg1: List of arguments.
; Returns: Nothing.
freg_PopAllRev macro ArgList:vararg
$$ArgList textequ $ArgRev(ArgList)
%for $$Arg, <$$ArgList>
freg_pop $$Arg ;;pop one argument and repeat
endm
endm