diff options
Diffstat (limited to 'standard.mac')
-rw-r--r-- | standard.mac | 159 |
1 files changed, 84 insertions, 75 deletions
diff --git a/standard.mac b/standard.mac index 727de87..0b79896 100644 --- a/standard.mac +++ b/standard.mac @@ -14,7 +14,7 @@ ;; copyright notice, this list of conditions and the following ;; disclaimer in the documentation and/or other materials provided ;; with the distribution. -;; +;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -56,101 +56,109 @@ %define __LINE__ %define __BITS__ -%define __SECT__ ; it ought to be defined, even if as nothing +%define __SECT__ ; it ought to be defined, even if as nothing %imacro section 1+.nolist -%define __SECT__ [section %1] - __SECT__ + %define __SECT__ [section %1] + __SECT__ %endmacro + %imacro segment 1+.nolist -%define __SECT__ [segment %1] - __SECT__ + %define __SECT__ [segment %1] + __SECT__ %endmacro + %imacro sectalign 1.nolist - [sectalign %1] + [sectalign %1] %endmacro %imacro absolute 1+.nolist -%define __SECT__ [absolute %1] - __SECT__ + %define __SECT__ [absolute %1] + __SECT__ %endmacro %imacro struc 1-2.nolist 0 -%push -%define %$strucname %1 -[absolute %2] -%$strucname: ; allow definition of `.member' to work sanely -%endmacro + %push + %define %$strucname %1 + [absolute %2] + %$strucname: ; allow definition of `.member' to work sanely + %endmacro + %imacro endstruc 0.nolist -%{$strucname}_size equ ($-%$strucname) -%pop -__SECT__ + %{$strucname}_size equ ($-%$strucname) + %pop + __SECT__ %endmacro %imacro istruc 1.nolist -%push -%define %$strucname %1 -%$strucstart: + %push + %define %$strucname %1 + %$strucstart: %endmacro + %imacro at 1-2+.nolist - times (%1-%$strucname)-($-%$strucstart) db 0 - %2 + times (%1-%$strucname)-($-%$strucstart) db 0 + %2 %endmacro + %imacro iend 0.nolist - times %{$strucname}_size-($-%$strucstart) db 0 -%pop + times %{$strucname}_size-($-%$strucstart) db 0 + %pop %endmacro %imacro align 1-2+.nolist nop - sectalign %1 - times (((%1) - (($-$$) % (%1))) % (%1)) %2 + sectalign %1 + times (((%1) - (($-$$) % (%1))) % (%1)) %2 %endmacro + %imacro alignb 1-2+.nolist - sectalign %1 - %ifempty %2 - resb (((%1) - (($-$$) % (%1))) % (%1)) - %else - times (((%1) - (($-$$) % (%1))) % (%1)) %2 - %endif + sectalign %1 + %ifempty %2 + resb (((%1) - (($-$$) % (%1))) % (%1)) + %else + times (((%1) - (($-$$) % (%1))) % (%1)) %2 + %endif %endmacro %imacro extern 1-*.nolist -%rep %0 -[extern %1] -%rotate 1 -%endrep + %rep %0 + [extern %1] + %rotate 1 + %endrep %endmacro %imacro bits 1+.nolist -[bits %1] + [bits %1] %endmacro %imacro use16 0.nolist -[bits 16] + [bits 16] %endmacro + %imacro use32 0.nolist -[bits 32] + [bits 32] %endmacro + %imacro use64 0.nolist -[bits 64] + [bits 64] %endmacro %imacro global 1-*.nolist -%rep %0 -[global %1] -%rotate 1 -%endrep + %rep %0 + [global %1] + %rotate 1 + %endrep %endmacro %imacro common 1-*.nolist -%rep %0 -[common %1] -%rotate 1 -%endrep + %rep %0 + [common %1] + %rotate 1 + %endrep %endmacro %imacro cpu 1+.nolist -[cpu %1] + [cpu %1] %endmacro %define __FLOAT_DAZ__ nodaz @@ -158,37 +166,38 @@ __SECT__ ; __FLOAT__ contains the whole floating-point configuration so it can ; be saved and restored %define __FLOAT__ __FLOAT_DAZ__,__FLOAT_ROUND__ + %imacro float 1-*.nolist -%rep %0 -[float %1] -%ifidni %1,daz -%define __FLOAT_DAZ__ daz -%elifidni %1,nodaz -%define __FLOAT_DAZ__ nodaz -%elifidni %1,near -%define __FLOAT_ROUND__ near -%elifidni %1,up -%define __FLOAT_ROUND__ up -%elifidni %1,down -%define __FLOAT_ROUND__ down -%elifidni %1,zero -%define __FLOAT_ROUND__ zero -%elifidni %1,default -%define __FLOAT_DAZ__ nodaz -%define __FLOAT_ROUND__ near -%endif -%rotate 1 -%endrep + %rep %0 + [float %1] + %ifidni %1,daz + %define __FLOAT_DAZ__ daz + %elifidni %1,nodaz + %define __FLOAT_DAZ__ nodaz + %elifidni %1,near + %define __FLOAT_ROUND__ near + %elifidni %1,up + %define __FLOAT_ROUND__ up + %elifidni %1,down + %define __FLOAT_ROUND__ down + %elifidni %1,zero + %define __FLOAT_ROUND__ zero + %elifidni %1,default + %define __FLOAT_DAZ__ nodaz + %define __FLOAT_ROUND__ near + %endif + %rotate 1 + %endrep %endmacro %imacro default 1+.nolist -[default %1] + [default %1] %endmacro %imacro incbin 1-2+.nolist 0 -%push -%pathsearch %$dep %1 -%depend %$dep - %? %$dep,%2 -%pop + %push + %pathsearch %$dep %1 + %depend %$dep + %? %$dep,%2 + %pop %endmacro |