Debian Codegraph @

macros/masm.mac

raw
1 ;; SPDX-License-Identifier: BSD-2-Clause
2 ;; Copyright 2019-2025 The NASM Authors - All Rights Reserved
3
4 ;;
5 ;; masm.mac
6 ;;
7 ;; Very limited MASM compatibility package; intended to be used
8 ;; primarily with machine-generated code. It does not include any
9 ;; "programmer friendly" shortcuts, nor does it in any way support
10 ;; ASSUME, symbol typing, or MASM-style structures.
11 ;;
12
13 USE: masm
14
15 %unimacro segment 1+
16
17 %imacro segment 0-1+.nolist
18 %define __?SECT?__ [segment %00 %1]
19 __?SECT?__
20 %endmacro
21
22 %imacro ends 0+.nolist
23 %null ends %00
24 %endmacro
25
26 %imacro proc 0-*.nolist
27 %rep %0
28 %ifidni %1,far
29 %idefine ret retf
30 %else
31 %idefine ret retn
32 %endif
33 %rotate 1
34 %endrep
35 %endmacro
36
37 %imacro endp 0.nolist
38 %null endp %00
39 %undef ret
40 %endmacro
41
42 %ifndef st
43 %idefine st(x) st %+ x
44 %endif
45
46 %idefine ptr __?masm_ptr?__
47 %idefine flat __?masm_flat?__ ; is %idefine really correct here?
48 %idefine offset
49
50 %imacro end 0+.nolist
51 ; Nothing
52 %endmacro
53
54 %idefine tbyte tword
55
56 default rel