summaryrefslogtreecommitdiff
path: root/src/sim86/sim86.mdesk
blob: 63702214cdff5cd04a80b11ceed1f22663596a98 (plain) (blame)
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
@table(name, str) sim86_flags_mapping:
{
 { Carry,          "C", }
 { Parity,         "P", }
 { AuxiliaryCarry, "A", }
 { Zero,           "Z", }
 { Sign,           "S", }
 { Overflow,       "O", }
 { Interrupt,      "I", }
 { Direction,      "D", }
 { Trap,           "T", }
}

@table_gen_flags(sim86_flags_mapping, name) flags_8086
@table_gen_data(sim86_flags_mapping, `char *`, str) flags_8086_strings

// TODO:
@table_gen_enum sim86_enum:
{
 @expand(sim86_flags_mapping mapping)
  `Sim86_$(mapping.name),`
 `Sim86_Count`
}

@table(mnemonic, encoding, clocks, name) instructions_table:
{
 { mov, [ B:100010, D, W, MOD, REG, RM ], 4, "Register/memory to/from register" }
 { mov, [ B:1100011, W, MOD, B:000, RM, ImpD:0, DATA, DATA_IF_W ], 5, "Immediate to register/memory" }
 { mov, [ B:1011, W, REG, ImpD:1 ], 3, "Immediate to register" }
}