standard.mac
资源名称:nasm-0.98.zip [点击查看]
上传用户:yuppie_zhu
上传日期:2007-01-08
资源大小:535k
文件大小:2k
源码类别:
编译器/解释器
开发平台:
C/C++
- ; Standard macro set for NASM 0.98 -*- nasm -*-
- ; Note that although some user-level forms of directives are defined
- ; here, not all of them are: the user-level form of a format-specific
- ; directive should be defined in the module for that directive.
- %define __NASM_MAJOR__ 0
- %define __NASM_MINOR__ 98
- ; These two need to be defined, though the actual definitions will
- ; be constantly updated during preprocessing.
- %define __FILE__
- %define __LINE__
- %define __SECT__ ; it ought to be defined, even if as nothing
- %imacro section 1+.nolist
- %define __SECT__ [section %1]
- __SECT__
- %endmacro
- %imacro segment 1+.nolist
- %define __SECT__ [segment %1]
- __SECT__
- %endmacro
- %imacro absolute 1+.nolist
- %define __SECT__ [absolute %1]
- __SECT__
- %endmacro
- %imacro struc 1.nolist
- %push struc
- %define %$strucname %1
- [absolute 0]
- %$strucname: ; allow definition of `.member' to work sanely
- %endmacro
- %imacro endstruc 0.nolist
- %{$strucname}_size:
- %pop
- __SECT__
- %endmacro
- %imacro istruc 1.nolist
- %push istruc
- %define %$strucname %1
- %$strucstart:
- %endmacro
- %imacro at 1-2+.nolist
- times %1-($-%$strucstart) db 0
- %2
- %endmacro
- %imacro iend 0.nolist
- times %{$strucname}_size-($-%$strucstart) db 0
- %pop
- %endmacro
- %imacro align 1-2+.nolist nop
- times ($$-$) & ((%1)-1) %2
- %endmacro
- %imacro alignb 1-2+.nolist resb 1
- times ($$-$) & ((%1)-1) %2
- %endmacro
- %imacro extern 1-*.nolist
- %rep %0
- [extern %1]
- %rotate 1
- %endrep
- %endmacro
- %imacro bits 1+.nolist
- [bits %1]
- %endmacro
- %imacro global 1-*.nolist
- %rep %0
- [global %1]
- %rotate 1
- %endrep
- %endmacro
- %imacro common 1-*.nolist
- %rep %0
- [common %1]
- %rotate 1
- %endrep
- %endmacro