]>
Commit | Line | Data |
---|---|---|
68edd7db JY |
1 | ;------------------------------------------------------------------------------\r |
2 | ;\r | |
bbaa00dd | 3 | ; Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent\r |
68edd7db JY |
5 | ;\r |
6 | ; Abstract:\r | |
7 | ;\r | |
8 | ; This file provides macro definitions for NASM files.\r | |
9 | ;\r | |
10 | ;------------------------------------------------------------------------------\r | |
11 | \r | |
5a7cbd54 BS |
12 | ;\r |
13 | ; Macro for the PVALIDATE instruction, defined in AMD APM volume 3.\r | |
14 | ; NASM feature request URL: https://bugzilla.nasm.us/show_bug.cgi?id=3392753\r | |
15 | ;\r | |
16 | %macro PVALIDATE 0\r | |
17 | DB 0xF2, 0x0F, 0x01, 0xFF\r | |
18 | %endmacro\r | |
19 | \r | |
2b5b2ff0 TL |
20 | ;\r |
21 | ; Macro for the RMPADJUST instruction, defined in AMD APM volume 3.\r | |
22 | ; NASM feature request URL: https://bugzilla.nasm.us/show_bug.cgi?id=3392754\r | |
23 | ;\r | |
24 | %macro RMPADJUST 0\r | |
25 | DB 0xF3, 0x0F, 0x01, 0xFE\r | |
26 | %endmacro\r | |
27 | \r | |
e59760f8 RN |
28 | ; NASM provides built-in macros STRUC and ENDSTRUC for structure definition.\r |
29 | ; For example, to define a structure called mytype containing a longword,\r | |
30 | ; a word, a byte and a string of bytes, you might code\r | |
31 | ;\r | |
32 | ; struc mytype\r | |
33 | ;\r | |
34 | ; mt_long: resd 1\r | |
35 | ; mt_word: resw 1\r | |
36 | ; mt_byte: resb 1\r | |
37 | ; mt_str: resb 32\r | |
38 | ;\r | |
39 | ; endstruc\r | |
40 | ;\r | |
41 | ; Below macros are help to map the C types and the RESB family of pseudo-instructions.\r | |
42 | ; So that the above structure definition can be coded as\r | |
43 | ;\r | |
44 | ; struc mytype\r | |
45 | ;\r | |
46 | ; mt_long: CTYPE_UINT32 1\r | |
47 | ; mt_word: CTYPE_UINT16 1\r | |
48 | ; mt_byte: CTYPE_UINT8 1\r | |
49 | ; mt_str: CTYPE_CHAR8 32\r | |
50 | ;\r | |
51 | ; endstruc\r | |
52 | %define CTYPE_UINT64 resq\r | |
53 | %define CTYPE_INT64 resq\r | |
54 | %define CTYPE_UINT32 resd\r | |
55 | %define CTYPE_INT32 resd\r | |
56 | %define CTYPE_UINT16 resw\r | |
57 | %define CTYPE_INT16 resw\r | |
58 | %define CTYPE_BOOLEAN resb\r | |
59 | %define CTYPE_UINT8 resb\r | |
60 | %define CTYPE_CHAR8 resb\r | |
61 | %define CTYPE_INT8 resb\r | |
62 | \r | |
63 | %define CTYPE_UINTN resq\r | |
64 | %define CTYPE_INTN resq\r |