summaryrefslogtreecommitdiff
path: root/register.c
blob: fe1a7181c432dbca54f14dcf99efc2ba593484dc (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
#include "register.h"

const struct reg RAX = {
    .qword = "rax",
    .dword = "eax",
    .word = "ax",
    .byte = "al",
};
const struct reg RDI = {
    .qword = "rdi",
    .dword = "edi",
    .word = "di",
    .byte = "dil",
};
const struct reg RSI = {
    .qword = "rsi",
    .dword = "esi",
    .word = "si",
    .byte = "sil",
};
const struct reg RDX = {
    .qword = "rdx",
    .dword = "edx",
    .word = "dx",
    .byte = "dl",
};
const struct reg R10 = {
    .qword = "r10",
    .dword = "r10d",
    .word = "r10w",
    .byte = "r10b",
};
const struct reg R9 = {
    .qword = "r9",
    .dword = "r9d",
    .word = "r9w",
    .byte = "r9b",
};
const struct reg R8 = {
    .qword = "r8",
    .dword = "r8d",
    .word = "r8w",
    .byte = "r8b",
};

const struct reg* const CALLING_CONV[] = {&RDI, &RSI, &RDX, &R10, &R9, &R8};
const unsigned char CC_N_REGS =
    sizeof(CALLING_CONV) / sizeof(const struct reg* const);