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
|
/* ========================================================================
(C) Copyright 2023 by Molly Rocket, Inc., All Rights Reserved.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Please see https://computerenhance.com for more information
======================================================================== */
char const *OpcodeMnemonics[] =
{
"",
#define INST(Mnemonic, ...) #Mnemonic,
#define INSTALT(...)
#include "sim86_instruction_table.inl"
};
static char const *GetMnemonic(operation_type Op)
{
char const *Result = "";
if(Op < Op_Count)
{
Result = OpcodeMnemonics[Op];
}
return Result;
}
static char const *GetRegName(register_access Reg)
{
char const *Names[][3] =
{
{"", "", ""},
{"al", "ah", "ax"},
{"bl", "bh", "bx"},
{"cl", "ch", "cx"},
{"dl", "dh", "dx"},
{"sp", "sp", "sp"},
{"bp", "bp", "bp"},
{"si", "si", "si"},
{"di", "di", "di"},
{"es", "es", "es"},
{"cs", "cs", "cs"},
{"ss", "ss", "ss"},
{"ds", "ds", "ds"},
{"ip", "ip", "ip"},
{"flags", "flags", "flags"},
{"", "", ""}
};
char const *Result = Names[Reg.Index % ArrayCount(Names)][(Reg.Count == 2) ? 2 : Reg.Offset&1];
return Result;
}
|