summaryrefslogtreecommitdiff
path: root/macros/altreg.mac
blob: 16134cdc78e11eed3b4bd21a2cb8696012d3eee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
;; --------------------------------------------------------------------------
;;   
;;   Copyright 1996-2009 The NASM Authors - All Rights Reserved
;;   See the file AUTHORS included with the NASM distribution for
;;   the specific copyright holders.
;;
;;   Redistribution and use in source and binary forms, with or without
;;   modification, are permitted provided that the following
;;   conditions are met:
;;
;;   * Redistributions of source code must retain the above copyright
;;     notice, this list of conditions and the following disclaimer.
;;   * Redistributions in binary form must reproduce the above
;;     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
;;     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;;     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
;;     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;;     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
;;     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;;     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
;;     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;;     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
;;     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
;;     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
;; --------------------------------------------------------------------------

;;
;; altreg.mac
;;
;; Alternate register names for 64-bit mode
;;

USE: altreg

;;
;; Intel documents R8L-R15L instead of R8B-R15B
;; (Warning: this may confuse people with an AT&T-style assembly
;; background, where "r8l" means R8D, etc.)
;;
%idefine r8l  r8b
%idefine r9l  r9b
%idefine r10l r10b
%idefine r11l r11b
%idefine r12l r12b
%idefine r13l r13b
%idefine r14l r14b
%idefine r15l r15b

;;
;; Numeric register names for the lower 8 registers
;;
%idefine r0  rax
%idefine r1  rcx
%idefine r2  rdx
%idefine r3  rbx
%idefine r4  rsp
%idefine r5  rbp
%idefine r6  rsi
%idefine r7  rdi

%idefine r0d eax
%idefine r1d ecx
%idefine r2d edx
%idefine r3d ebx
%idefine r4d esp
%idefine r5d ebp
%idefine r6d esi
%idefine r7d edi

%idefine r0w ax
%idefine r1w cx
%idefine r2w dx
%idefine r3w bx
%idefine r4w sp
%idefine r5w bp
%idefine r6w si
%idefine r7w di

%idefine r0b al
%idefine r1b cl
%idefine r2b dl
%idefine r3b bl
%idefine r4b spl
%idefine r5b bpl
%idefine r6b sil
%idefine r7b dil

%idefine r0l al
%idefine r1l cl
%idefine r2l dl
%idefine r3l bl
%idefine r4l spl
%idefine r5l bpl
%idefine r6l sil
%idefine r7l dil

%idefine r0h ah
%idefine r1h ch
%idefine r2h dh
%idefine r3h bh