TianoCore EDK2 master
Loading...
Searching...
No Matches
Nasm.inc
1;------------------------------------------------------------------------------
2;
3; Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>
4; SPDX-License-Identifier: BSD-2-Clause-Patent
5;
6; Abstract:
7;
8; This file provides macro definitions for NASM files.
9;
10;------------------------------------------------------------------------------
11
12; NASM provides built-in macros STRUC and ENDSTRUC for structure definition.
13; For example, to define a structure called mytype containing a longword,
14; a word, a byte and a string of bytes, you might code
15;
16; struc mytype
17;
18; mt_long: resd 1
19; mt_word: resw 1
20; mt_byte: resb 1
21; mt_str: resb 32
22;
23; endstruc
24;
25; Below macros are help to map the C types and the RESB family of pseudo-instructions.
26; So that the above structure definition can be coded as
27;
28; struc mytype
29;
30; mt_long: CTYPE_UINT32 1
31; mt_word: CTYPE_UINT16 1
32; mt_byte: CTYPE_UINT8 1
33; mt_str: CTYPE_CHAR8 32
34;
35; endstruc
36%define CTYPE_UINT64 resq
37%define CTYPE_INT64 resq
38%define CTYPE_UINT32 resd
39%define CTYPE_INT32 resd
40%define CTYPE_UINT16 resw
41%define CTYPE_INT16 resw
42%define CTYPE_BOOLEAN resb
43%define CTYPE_UINT8 resb
44%define CTYPE_CHAR8 resb
45%define CTYPE_INT8 resb
46
47%define CTYPE_UINTN resd
48%define CTYPE_INTN resd