done for now, doing validation suite next.

This commit is contained in:
ed
2026-09-09 17:01:22 -04:00
parent 7daa333a71
commit 2a89a342df
7 changed files with 147 additions and 230 deletions
+11 -20
View File
@@ -95,24 +95,23 @@ x8616_decode_opcode(X8616_DecodePlan const* plan, U1 header)
if (plan->flags & x8616_plan_has_sr) field_mask |= x8616_field_mask(plan->sr_shift, X8616_OPCODE_SR_WIDTH); if (plan->flags & x8616_plan_has_sr) field_mask |= x8616_field_mask(plan->sr_shift, X8616_OPCODE_SR_WIDTH);
if (plan->flags & x8616_plan_has_alu) field_mask |= x8616_field_mask(plan->alu_shift, X8616_OPCODE_ALU_TTT_WIDTH); if (plan->flags & x8616_plan_has_alu) field_mask |= x8616_field_mask(plan->alu_shift, X8616_OPCODE_ALU_TTT_WIDTH);
if (plan->flags & x8616_plan_has_cc) field_mask |= x8616_field_mask(plan->cc_shift, X8616_OPCODE_CC_WIDTH); if (plan->flags & x8616_plan_has_cc) field_mask |= x8616_field_mask(plan->cc_shift, X8616_OPCODE_CC_WIDTH);
if (plan->flags & x8616_plan_has_pair) field_mask |= x8616_field_mask(plan->pair_shift, X8616_OPCODE_PAIR_WIDTH); if (field_mask == 0) return C_(X8616_Opcode, header);
if (field_mask == 0) return 0;
U1 opcode_mask = u1_(~field_mask); U1 opcode_mask = u1_(~field_mask);
if (opcode_mask == 0) return 0; if (opcode_mask == 0) return C_(X8616_Opcode, header);
return C_(X8616_Opcode, (header & opcode_mask) >> count_trailing_zeros_u4(opcode_mask)); return C_(X8616_Opcode, (header & opcode_mask) >> count_trailing_zeros_u4(opcode_mask));
} }
internal void internal void
x8616_decode_apply_prefix(X8616_DecodePlex_R plex, X8616_DecodePlan_R plan, U1 opcode) { x8616_decode_apply_prefix(X8616_DecodePlex_R plex, X8616_DecodePlan_R plan, U1 header) {
plex->prefixes.count += 1; plex->prefixes.count += 1;
plex->prefixes.lock |= plan->prefix_kind == x8616_prefix_lock; plex->prefixes.lock |= plan->prefix_kind == x8616_prefix_lock;
if (plan->prefix_kind == x8616_prefix_repeat) { if (plan->prefix_kind == x8616_prefix_repeat) {
plex->prefixes.has_repeat = 1; plex->prefixes.has_repeat = 1;
plex->prefixes.repeat = C_(X8616_Repeat, x8616_bit_field_extract(opcode, (X8616_BitField){ plan->z_shift, X8616_OPCODE_BIT_WIDTH })); plex->prefixes.repeat = C_(X8616_Repeat, x8616_bit_field_extract(header, (X8616_BitField){ plan->z_shift, X8616_OPCODE_BIT_WIDTH }));
} }
if (plan->prefix_kind == x8616_prefix_segment) { if (plan->prefix_kind == x8616_prefix_segment) {
plex->prefixes.has_segment = 1; plex->prefixes.has_segment = 1;
plex->prefixes.segment = C_(X8616_Segment, x8616_bit_field_extract(opcode, (X8616_BitField){ plan->sr_shift, X8616_OPCODE_SR_WIDTH })); plex->prefixes.segment = C_(X8616_Segment, x8616_bit_field_extract(header, (X8616_BitField){ plan->sr_shift, X8616_OPCODE_SR_WIDTH }));
} }
} }
@@ -121,18 +120,18 @@ x8616_decode_one_plex(X8616_DecodePlex* plex)
{ {
U4 prefix_at = 0; U4 prefix_at = 0;
// Prefix pass. Ambiguous/group opcodes are never prefixes, so only direct // Prefix pass. LOCK / REP / segment are prior bytes. Encodings that need a
// dispatch entries participate in this loop. // second byte (aux dispatch) are never prefixes.
while (prefix_at < plex->source_size) while (prefix_at < plex->source_size)
{ {
U1 prefix_opcode = plex->source[prefix_at]; U1 prefix_header = plex->source[prefix_at];
U2 prefix_dispatch = x8616_decode_dispatch[prefix_opcode]; U2 prefix_dispatch = x8616_decode_dispatch[prefix_header];
if (prefix_dispatch == false || (prefix_dispatch & X8616_DECODE_AUX_BIT)) break; if (prefix_dispatch == false || (prefix_dispatch & X8616_DECODE_AUX_BIT)) break;
X8616_DecodePlan_R prefix_plan = x8616_decode_plans + prefix_dispatch; X8616_DecodePlan_R prefix_plan = x8616_decode_plans + prefix_dispatch;
if ((prefix_plan->flags & x8616_plan_is_prefix) == false) break; if ((prefix_plan->flags & x8616_plan_is_prefix) == false) break;
x8616_decode_apply_prefix(plex, prefix_plan, prefix_opcode); x8616_decode_apply_prefix(plex, prefix_plan, prefix_header);
++ prefix_at; ++ prefix_at;
} }
@@ -200,7 +199,7 @@ x8616_decode_one_plex(X8616_DecodePlex* plex)
plex->plan = x8616_decode_plans + plex->plan_idx; plex->plan = x8616_decode_plans + plex->plan_idx;
// A direct-dispatch plan may still have a constrained second byte. // A direct-dispatch plan may still have a constrained second byte.
// Group opcodes with multiple candidates were already resolved through aux. // Headers with multiple catalog rows were already resolved through aux.
if (plex->plan_idx && (plex->plan->flags & (x8616_plan_has_modrm | x8616_plan_has_post_opcode))) if (plex->plan_idx && (plex->plan->flags & (x8616_plan_has_modrm | x8616_plan_has_post_opcode)))
{ {
if (body_source_size < 2) if (body_source_size < 2)
@@ -440,14 +439,6 @@ x8616_decode_one_plex(X8616_DecodePlex* plex)
plex->instruction.op = x8616_op_from_alu[digit]; plex->instruction.op = x8616_op_from_alu[digit];
} }
else if (plan->digit_kind == x8616_digit_shift) plex->instruction.op = x8616_op_from_shift[digit]; else if (plan->digit_kind == x8616_digit_shift) plex->instruction.op = x8616_op_from_shift[digit];
else if (plan->digit_kind == x8616_digit_g3) plex->instruction.op = x8616_op_from_g3[digit];
else if (plan->digit_kind == x8616_digit_ff) plex->instruction.op = x8616_op_from_ff[digit];
else if (plan->digit_kind == x8616_digit_incdec) plex->instruction.op = x8616_op_from_incdec[digit];
}
if (plan->flags & x8616_plan_has_pair) {
U1 bit = x8616_bit_field_extract(plex->header, (X8616_BitField){ plan->pair_shift, X8616_OPCODE_PAIR_WIDTH });
if (plan->pair_kind == x8616_pair_incdec) plex->instruction.op = x8616_op_from_incdec[bit];
if (plan->pair_kind == x8616_pair_pushpop) plex->instruction.op = x8616_op_from_pushpop[bit];
} }
plex->instruction.flags = plan->encoding_flags; plex->instruction.flags = plan->encoding_flags;
plex->instruction.decode_flags = (plex->encoding_invalid ? x8616_decode_invalid : 0) | (plex->classification_truncated ? x8616_decode_truncated : 0); plex->instruction.decode_flags = (plex->encoding_invalid ? x8616_decode_invalid : 0) | (plex->classification_truncated ? x8616_decode_truncated : 0);
-3
View File
@@ -93,7 +93,6 @@ typedef Enum_(U2, X8616_DecodePlanFlags) {
Bit_(x8616_plan_is_prefix, 11), Bit_(x8616_plan_is_prefix, 11),
Bit_(x8616_plan_has_alu, 12), Bit_(x8616_plan_has_alu, 12),
Bit_(x8616_plan_has_cc, 13), Bit_(x8616_plan_has_cc, 13),
Bit_(x8616_plan_has_pair, 14),
}; };
typedef Enum_(U1, X8616_DecodePayload) { typedef Enum_(U1, X8616_DecodePayload) {
@@ -140,9 +139,7 @@ typedef Struct_(X8616_DecodePlan) {
U1 alu_shift; U1 alu_shift;
U1 cc_shift; U1 cc_shift;
U1 pair_shift;
X8616_DigitKind digit_kind; X8616_DigitKind digit_kind;
X8616_PairKind pair_kind;
}; };
enum { enum {
+18 -22
View File
@@ -26,7 +26,7 @@ typedef Struct_(X8616_DecodeGen) {
U1 aux[X8616_DECODE_GEN_MAX_AUX]; U1 aux[X8616_DECODE_GEN_MAX_AUX];
U4 aux_count; U4 aux_count;
U4 ambiguous_opcode_count; U4 ambiguous_header_count;
U4 verified_count; U4 verified_count;
X8616_InfoList msgs; X8616_InfoList msgs;
@@ -35,7 +35,7 @@ typedef Struct_(X8616_DecodeGen) {
typedef Struct_(X8616_DecodeGenInfo) { typedef Struct_(X8616_DecodeGenInfo) {
U4 plan_count; U4 plan_count;
U4 aux_count; U4 aux_count;
U4 ambiguous_opcode_count; U4 ambiguous_header_count;
U4 verified_count; U4 verified_count;
X8616_InfoList msgs; X8616_InfoList msgs;
@@ -99,9 +99,7 @@ x8616_decode_gen_plan(X8616_Encoding_R encoding, U4 encoding_idx, X8616_InfoList
if (encoding->fields.sr.width) { plan.flags |= x8616_plan_has_sr; plan.sr_shift = encoding->fields.sr.shift; } if (encoding->fields.sr.width) { plan.flags |= x8616_plan_has_sr; plan.sr_shift = encoding->fields.sr.shift; }
if (encoding->fields.alu.width) { plan.flags |= x8616_plan_has_alu; plan.alu_shift = encoding->fields.alu.shift; } if (encoding->fields.alu.width) { plan.flags |= x8616_plan_has_alu; plan.alu_shift = encoding->fields.alu.shift; }
if (encoding->fields.cc.width) { plan.flags |= x8616_plan_has_cc; plan.cc_shift = encoding->fields.cc.shift; } if (encoding->fields.cc.width) { plan.flags |= x8616_plan_has_cc; plan.cc_shift = encoding->fields.cc.shift; }
if (encoding->fields.pair.width){ plan.flags |= x8616_plan_has_pair; plan.pair_shift = encoding->fields.pair.shift; }
plan.digit_kind = encoding->digit_kind; plan.digit_kind = encoding->digit_kind;
plan.pair_kind = encoding->pair_kind;
if (x8616_decode_gen_operand_uses_rm(encoding->operands[0]) || x8616_decode_gen_operand_uses_rm(encoding->operands[1])) if (x8616_decode_gen_operand_uses_rm(encoding->operands[0]) || x8616_decode_gen_operand_uses_rm(encoding->operands[1]))
plan.flags |= x8616_plan_uses_rm; plan.flags |= x8616_plan_uses_rm;
@@ -145,8 +143,8 @@ x8616_decode_gen_plan(X8616_Encoding_R encoding, U4 encoding_idx, X8616_InfoList
return plan; return plan;
} }
FI_ B4 x8616_decode_gen_encoding_matches_opcode(X8616_Encoding_R encoding, U1 opcode) { FI_ B4 x8616_decode_gen_encoding_matches_header(X8616_Encoding_R encoding, U1 header) {
return (opcode & encoding->header.mask) == encoding->header.bits; return (header & encoding->header.mask) == encoding->header.bits;
} }
FI_ B4 x8616_decode_gen_plan_matches_second(X8616_DecodePlan_R plan, U1 byte) { FI_ B4 x8616_decode_gen_plan_matches_second(X8616_DecodePlan_R plan, U1 byte) {
@@ -163,22 +161,22 @@ internal void x8616_decode_gen_pass_plans(X8616_DecodeGen* gen, FArena_R info_sc
internal void internal void
x8616_decode_gen_pass_dispatch(X8616_DecodeGen* gen, FArena_R info_scratch) x8616_decode_gen_pass_dispatch(X8616_DecodeGen* gen, FArena_R info_scratch)
{ {
for (U4 opcode = 0; opcode < 256; ++ opcode) for (U4 header = 0; header < 256; ++ header)
{ {
U1 candidates[X8616_ENCODING_COUNT]; U1 candidates[X8616_ENCODING_COUNT];
U4 candidate_count = 0; U4 candidate_count = 0;
for (U4 encoding_idx = 0; encoding_idx < X8616_ENCODING_COUNT; ++ encoding_idx) for (U4 encoding_idx = 0; encoding_idx < X8616_ENCODING_COUNT; ++ encoding_idx)
if (x8616_decode_gen_encoding_matches_opcode(x8616_encodings + encoding_idx, C_(U1, opcode))) if (x8616_decode_gen_encoding_matches_header(x8616_encodings + encoding_idx, C_(U1, header)))
candidates[candidate_count ++] = C_(U1, encoding_idx + 1); candidates[candidate_count ++] = C_(U1, encoding_idx + 1);
if (candidate_count == 0) continue; if (candidate_count == 0) continue;
if (candidate_count == 1) { gen->dispatch[opcode] = candidates[0]; continue; } if (candidate_count == 1) { gen->dispatch[header] = candidates[0]; continue; }
if (gen->aux_count + 256 > X8616_DECODE_GEN_MAX_AUX) { if (gen->aux_count + 256 > X8616_DECODE_GEN_MAX_AUX) {
x8616_info_push(info_scratch, & gen->msgs, x8616_info_error x8616_info_push(info_scratch, & gen->msgs, x8616_info_error
, x8616_info_gen_aux_cap_exceeded , x8616_info_gen_aux_cap_exceeded
, opcode , header
, 0 , 0
, X8616_DECODE_GEN_MAX_AUX , X8616_DECODE_GEN_MAX_AUX
, gen->aux_count + 256 , gen->aux_count + 256
@@ -187,9 +185,9 @@ x8616_decode_gen_pass_dispatch(X8616_DecodeGen* gen, FArena_R info_scratch)
} }
U4 base = gen->aux_count; U4 base = gen->aux_count;
gen->dispatch[opcode] = C_(U2, X8616_DECODE_AUX_BIT | base); gen->dispatch[header] = C_(U2, X8616_DECODE_AUX_BIT | base);
gen->aux_count += 256; gen->aux_count += 256;
gen->ambiguous_opcode_count += 1; gen->ambiguous_header_count += 1;
for (U4 second = 0; second < 256; ++ second) for (U4 second = 0; second < 256; ++ second)
{ {
@@ -202,7 +200,7 @@ x8616_decode_gen_pass_dispatch(X8616_DecodeGen* gen, FArena_R info_scratch)
if (selected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error if (selected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error
, x8616_info_gen_ambiguous_decode , x8616_info_gen_ambiguous_decode
, (opcode << 8) | second , (header << 8) | second
, 0 , 0
, selected , selected
, plan_idx , plan_idx
@@ -218,27 +216,27 @@ x8616_decode_gen_pass_dispatch(X8616_DecodeGen* gen, FArena_R info_scratch)
internal void internal void
x8616_decode_gen_pass_validate(X8616_DecodeGen_R gen, FArena_R info_scratch) x8616_decode_gen_pass_validate(X8616_DecodeGen_R gen, FArena_R info_scratch)
{ {
for (U4 opcode = 0; opcode < 256; ++ opcode) for (U4 header = 0; header < 256; ++ header)
for (U4 second = 0; second < 256; ++ second) for (U4 second = 0; second < 256; ++ second)
{ {
U1 expected = 0; U1 expected = 0;
for (U4 encoding_idx = 0; encoding_idx < X8616_ENCODING_COUNT; ++ encoding_idx) for (U4 encoding_idx = 0; encoding_idx < X8616_ENCODING_COUNT; ++ encoding_idx)
{ {
X8616_Encoding_R encoding = x8616_encodings + encoding_idx; X8616_Encoding_R encoding = x8616_encodings + encoding_idx;
if (x8616_decode_gen_encoding_matches_opcode(encoding, C_(U1, opcode)) == false) continue; if (x8616_decode_gen_encoding_matches_header(encoding, C_(U1, header)) == false) continue;
X8616_DecodePlan_R plan = gen->plans + encoding_idx + 1; X8616_DecodePlan_R plan = gen->plans + encoding_idx + 1;
if (x8616_decode_gen_plan_matches_second(plan, C_(U1, second)) == false) continue; if (x8616_decode_gen_plan_matches_second(plan, C_(U1, second)) == false) continue;
if (expected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error if (expected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error
, x8616_info_gen_ambiguous_decode , x8616_info_gen_ambiguous_decode
, (opcode << 8) | second, 0 , (header << 8) | second, 0
, expected, encoding_idx + 1 , expected, encoding_idx + 1
); );
expected = C_(U1, encoding_idx + 1); expected = C_(U1, encoding_idx + 1);
} }
U2 dispatch = gen->dispatch[opcode]; U2 dispatch = gen->dispatch[header];
U1 actual = 0; U1 actual = 0;
if (dispatch & X8616_DECODE_AUX_BIT) { if (dispatch & X8616_DECODE_AUX_BIT) {
@@ -253,7 +251,7 @@ x8616_decode_gen_pass_validate(X8616_DecodeGen_R gen, FArena_R info_scratch)
if (actual != expected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error if (actual != expected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error
, x8616_info_gen_dispatch_mismatch , x8616_info_gen_dispatch_mismatch
, (opcode << 8) | second, 0 , (header << 8) | second, 0
, expected, actual , expected, actual
); );
++ gen->verified_count; ++ gen->verified_count;
@@ -270,7 +268,7 @@ x8616_decode_table_generate(X8616_DecodeGen* gen, FArena_R info_scratch) {
X8616_DecodeGenInfo result = { X8616_DecodeGenInfo result = {
.plan_count = X8616_ENCODING_COUNT + 1, .plan_count = X8616_ENCODING_COUNT + 1,
.aux_count = gen->aux_count, .aux_count = gen->aux_count,
.ambiguous_opcode_count = gen->ambiguous_opcode_count, .ambiguous_header_count = gen->ambiguous_header_count,
.verified_count = gen->verified_count, .verified_count = gen->verified_count,
.msgs = gen->msgs, .msgs = gen->msgs,
}; };
@@ -334,7 +332,7 @@ x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan_R plan) { defer_rewin
<d_shift>, <w_shift>, <s_shift>, <v_shift>, <z_shift>, <reg_shift>, <sr_shift>, <d_shift>, <w_shift>, <s_shift>, <v_shift>, <z_shift>, <reg_shift>, <sr_shift>,
{<mod_rm.bits>, <mod_rm.mask>}, {<mod_rm.bits>, <mod_rm.mask>},
{<post_opcode.bits>, <post_opcode.mask>}, {<post_opcode.bits>, <post_opcode.mask>},
<alu_shift>, <cc_shift>, <pair_shift>, <digit_kind>, <pair_kind>, <alu_shift>, <cc_shift>, <digit_kind>,
},\n },\n
); );
KTL_Slot_Str8 tbl[] = { KTL_Slot_Str8 tbl[] = {
@@ -360,9 +358,7 @@ x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan_R plan) { defer_rewin
entry("post_opcode.mask", hex_u1(plan->post_opcode.mask)), entry("post_opcode.mask", hex_u1(plan->post_opcode.mask)),
entry("alu_shift", dec(plan->alu_shift)), entry("alu_shift", dec(plan->alu_shift)),
entry("cc_shift", dec(plan->cc_shift)), entry("cc_shift", dec(plan->cc_shift)),
entry("pair_shift", dec(plan->pair_shift)),
entry("digit_kind", dec(plan->digit_kind)), entry("digit_kind", dec(plan->digit_kind)),
entry("pair_kind", dec(plan->pair_kind)),
}; };
str8gen_append_fmt(out, template, ktl_str8_from_arr(tbl)); str8gen_append_fmt(out, template, ktl_str8_from_arr(tbl));
}} }}
+19 -86
View File
@@ -11,12 +11,12 @@
Fields = d, w, s, v, z, reg, sr (Table 4-11). Packed into that same byte. Fields = d, w, s, v, z, reg, sr (Table 4-11). Packed into that same byte.
Header = byte 1 as stored: opcode bits sitting in position, field bits OR'd in. Header = byte 1 as stored: opcode bits sitting in position, field bits OR'd in.
BytePattern matches a header byte: .bits = opcode << field_width (fields zero), BytePattern matches a header byte: .bits = expected bits in position,
.mask = bits of the header that are opcode. */ .mask = bits that must match (opcode bits, plus any fixed literals). */
typedef Struct_(X8616_BytePattern) { U1 bits; U1 mask; }; typedef Struct_(X8616_BytePattern) { U1 bits; U1 mask; };
typedef Struct_(X8616_BitField) { U1 shift; U1 width; }; typedef Struct_(X8616_BitField) { U1 shift; U1 width; };
typedef Struct_(X8616_OpcodeFields) { typedef Struct_(X8616_HeaderFields) {
X8616_BitField d; X8616_BitField d;
X8616_BitField w; X8616_BitField w;
X8616_BitField s; X8616_BitField s;
@@ -26,7 +26,6 @@ typedef Struct_(X8616_OpcodeFields) {
X8616_BitField sr; X8616_BitField sr;
X8616_BitField alu; X8616_BitField alu;
X8616_BitField cc; X8616_BitField cc;
X8616_BitField pair;
}; };
#define x8616_field_mask(shift, width) u1_(((1u << (width)) - 1u) << (shift)) #define x8616_field_mask(shift, width) u1_(((1u << (width)) - 1u) << (shift))
@@ -165,15 +164,6 @@ typedef Enum_(U1, X8616_DigitKind) {
x8616_digit_none = 0x0, x8616_digit_none = 0x0,
x8616_digit_alu = 0x1, x8616_digit_alu = 0x1,
x8616_digit_shift = 0x2, x8616_digit_shift = 0x2,
x8616_digit_g3 = 0x3,
x8616_digit_ff = 0x4,
x8616_digit_incdec = 0x5,
};
typedef Enum_(U1, X8616_PairKind) {
x8616_pair_none = 0x0,
x8616_pair_incdec = 0x1,
x8616_pair_pushpop = 0x2,
}; };
/* header: Byte 1 match (opcode bits aligned, field bits masked). Not the opcode. /* header: Byte 1 match (opcode bits aligned, field bits masked). Not the opcode.
@@ -188,12 +178,11 @@ typedef Struct_(X8616_Encoding) {
X8616_BytePattern header; X8616_BytePattern header;
X8616_BytePattern mod_rm; X8616_BytePattern mod_rm;
X8616_BytePattern post_opcode; X8616_BytePattern post_opcode;
X8616_OpcodeFields fields; X8616_HeaderFields fields;
X8616_Operand operands[2]; X8616_Operand operands[2];
X8616_WidthMode width; X8616_WidthMode width;
X8616_EncodingFlags flags; X8616_EncodingFlags flags;
X8616_DigitKind digit_kind; X8616_DigitKind digit_kind;
X8616_PairKind pair_kind;
X8616_Op op; X8616_Op op;
}; };
@@ -345,43 +334,6 @@ RO_ global X8616_Op x8616_op_from_shift[] = {
[x8616_sar] = x8616_op_sar, [x8616_sar] = x8616_op_sar,
}; };
RO_ global X8616_Op x8616_op_from_g3[] = {
[x8616_g3_test] = x8616_op_test,
[0b001] = x8616_op_invalid,
[x8616_g3_not] = x8616_op_not,
[x8616_g3_neg] = x8616_op_neg,
[x8616_g3_mul] = x8616_op_mul,
[x8616_g3_imul] = x8616_op_imul,
[x8616_g3_div] = x8616_op_div,
[x8616_g3_idiv] = x8616_op_idiv,
};
RO_ global X8616_Op x8616_op_from_ff[] = {
[0b000] = x8616_op_invalid,
[0b001] = x8616_op_invalid,
[x8616_ff_call_near] = x8616_op_call,
[x8616_ff_call_far] = x8616_op_call,
[x8616_ff_jmp_near] = x8616_op_jmp,
[x8616_ff_jmp_far] = x8616_op_jmp,
[x8616_ff_push] = x8616_op_push,
[0b111] = x8616_op_invalid,
};
RO_ global X8616_Op x8616_op_from_incdec[] = {
[x8616_inc] = x8616_op_inc,
[x8616_dec] = x8616_op_dec,
};
typedef Enum_(U1, X8616_PushPop) {
x8616_pushpop_push = 0b0,
x8616_pushpop_pop = 0b1,
};
RO_ global X8616_Op x8616_op_from_pushpop[] = {
[x8616_pushpop_push] = x8616_op_push,
[x8616_pushpop_pop] = x8616_op_pop,
};
typedef Enum_(U1, X8616_Condition) { typedef Enum_(U1, X8616_Condition) {
x8616_cc_o = 0b0000, x8616_cc_o = 0b0000,
x8616_cc_no = 0b0001, x8616_cc_no = 0b0001,
@@ -632,19 +584,6 @@ enum {
X8616_OPCODE_ALU_RM_FORM = 0b0, X8616_OPCODE_ALU_RM_FORM = 0b0,
X8616_OPCODE_ALU_ACC_FORM = 0b10, X8616_OPCODE_ALU_ACC_FORM = 0b10,
X8616_OPCODE_ALU_ACC_FORM_SHIFT = 1, X8616_OPCODE_ALU_ACC_FORM_SHIFT = 1,
X8616_OPCODE_PAIR_SHIFT = 3,
X8616_OPCODE_PAIR_WIDTH = 1,
X8616_OPCODE_PAIR_REG_HOLE = X8616_OPCODE_PAIR_SHIFT + X8616_OPCODE_PAIR_WIDTH,
X8616_OPCODE_IO_CLASS = 0b1110,
X8616_OPCODE_IO_CLASS_SHIFT = 4,
X8616_OPCODE_IO_DX_SHIFT = 3,
X8616_OPCODE_IO_FIXED_SHIFT = 2,
X8616_OPCODE_IO_OUT_SHIFT = 1,
X8616_OPCODE_IO_FIXED_FORM = 0b10,
X8616_OPCODE_IO_CLASS_STEM_SHIFT = X8616_OPCODE_IO_CLASS_SHIFT - X8616_OPCODE_W_HOLE,
X8616_OPCODE_IO_DX_STEM_SHIFT = X8616_OPCODE_IO_DX_SHIFT - X8616_OPCODE_W_HOLE,
X8616_OPCODE_IO_OUT_STEM_SHIFT = X8616_OPCODE_IO_OUT_SHIFT - X8616_OPCODE_W_HOLE,
}; };
// ============================================================================ // ============================================================================
@@ -689,8 +628,8 @@ FI_ U1 x8616_modrm_sr (U1 modrm) { return (
#define x8616_enc_z(z) ((z) << X8616_OPCODE_Z_Z_SHIFT) #define x8616_enc_z(z) ((z) << X8616_OPCODE_Z_Z_SHIFT)
#define x8616_enc_width(w) ((w) << X8616_OPCODE_W_W_SHIFT) #define x8616_enc_width(w) ((w) << X8616_OPCODE_W_W_SHIFT)
#define x8616_enc_wreg_width(w) ((w) << X8616_OPCODE_WREG_W_SHIFT) #define x8616_enc_wreg_width(w) ((w) << X8616_OPCODE_WREG_W_SHIFT)
#define x8616_enc_opcode_reg(r) ((r) << X8616_OPCODE_REG_REG_SHIFT) #define x8616_enc_reg_field(r) ((r) << X8616_OPCODE_REG_REG_SHIFT)
#define x8616_enc_opcode_sr(sr) ((sr) << X8616_OPCODE_SR_SHIFT) #define x8616_enc_sr_field(sr) ((sr) << X8616_OPCODE_SR_SHIFT)
#define x8616_enc_cc(cc) ((cc) << X8616_OPCODE_CC_SHIFT) #define x8616_enc_cc(cc) ((cc) << X8616_OPCODE_CC_SHIFT)
#define x8616_enc_modrm_mod(mod) ((mod) << X8616_MODRM_MOD_SHIFT) #define x8616_enc_modrm_mod(mod) ((mod) << X8616_MODRM_MOD_SHIFT)
@@ -703,10 +642,10 @@ FI_ U1 x8616_modrm_sr (U1 modrm) { return (
#define x8616_enc_vw(opcode,v,w) C_(U1, x8616_enc_vw_opcode(opcode) | x8616_enc_v(v) | x8616_enc_width(w)) #define x8616_enc_vw(opcode,v,w) C_(U1, x8616_enc_vw_opcode(opcode) | x8616_enc_v(v) | x8616_enc_width(w))
#define x8616_enc_zp(opcode,z) C_(U1, x8616_enc_z_opcode(opcode) | x8616_enc_z(z)) #define x8616_enc_zp(opcode,z) C_(U1, x8616_enc_z_opcode(opcode) | x8616_enc_z(z))
#define x8616_enc_w(opcode,w) C_(U1, x8616_enc_w_opcode(opcode) | x8616_enc_width(w)) #define x8616_enc_w(opcode,w) C_(U1, x8616_enc_w_opcode(opcode) | x8616_enc_width(w))
#define x8616_enc_reg(opcode,reg) C_(U1, x8616_enc_reg_opcode(opcode) | x8616_enc_opcode_reg(reg)) #define x8616_enc_reg(opcode,reg) C_(U1, x8616_enc_reg_opcode(opcode) | x8616_enc_reg_field(reg))
#define x8616_enc_wreg(opcode,w,reg) C_(U1, x8616_enc_wreg_opcode(opcode) | x8616_enc_wreg_width(w) | x8616_enc_opcode_reg(reg)) #define x8616_enc_wreg(opcode,w,reg) C_(U1, x8616_enc_wreg_opcode(opcode) | x8616_enc_wreg_width(w) | x8616_enc_reg_field(reg))
#define x8616_enc_d0(opcode,d) C_(U1, x8616_enc_d0_opcode(opcode) | x8616_enc_d(d)) #define x8616_enc_d0(opcode,d) C_(U1, x8616_enc_d0_opcode(opcode) | x8616_enc_d(d))
#define x8616_enc_sr(class,sr,low) C_(U1, ((class) << X8616_OPCODE_SR_CLASS_SHIFT) | x8616_enc_opcode_sr(sr) | (low)) #define x8616_enc_sr(class,sr,low) C_(U1, ((class) << X8616_OPCODE_SR_CLASS_SHIFT) | x8616_enc_sr_field(sr) | (low))
#define x8616_enc_jcc(cc) C_(U1, (x8616_opcode_jcc << X8616_OPCODE_CC_HOLE) | x8616_enc_cc(cc)) #define x8616_enc_jcc(cc) C_(U1, (x8616_opcode_jcc << X8616_OPCODE_CC_HOLE) | x8616_enc_cc(cc))
#define x8616_enc_modrm(mod,reg,rm) C_(U1, x8616_enc_modrm_mod(mod) | x8616_enc_modrm_reg(reg) | x8616_enc_modrm_rm(rm)) #define x8616_enc_modrm(mod,reg,rm) C_(U1, x8616_enc_modrm_mod(mod) | x8616_enc_modrm_reg(reg) | x8616_enc_modrm_rm(rm))
#define x8616_enc_modrm_seg(mod,sr,rm) C_(U1, x8616_enc_modrm_mod(mod) | x8616_enc_modrm_sr(sr) | x8616_enc_modrm_rm(rm)) #define x8616_enc_modrm_seg(mod,sr,rm) C_(U1, x8616_enc_modrm_mod(mod) | x8616_enc_modrm_sr(sr) | x8616_enc_modrm_rm(rm))
@@ -720,12 +659,6 @@ FI_ U1 x8616_modrm_sr (U1 modrm) { return (
#define x8616_enc_alu_op(alu) x8616_enc_alu_ttt(alu) #define x8616_enc_alu_op(alu) x8616_enc_alu_ttt(alu)
#define x8616_enc_alu_rm_r(ttt,d,w) C_(U1, x8616_enc_alu_class() | x8616_enc_alu_ttt(ttt) | (X8616_OPCODE_ALU_RM_FORM << X8616_OPCODE_ALU_BIT2_SHIFT) | x8616_enc_d(d) | x8616_enc_width(w)) #define x8616_enc_alu_rm_r(ttt,d,w) C_(U1, x8616_enc_alu_class() | x8616_enc_alu_ttt(ttt) | (X8616_OPCODE_ALU_RM_FORM << X8616_OPCODE_ALU_BIT2_SHIFT) | x8616_enc_d(d) | x8616_enc_width(w))
#define x8616_enc_alu_acc_i(ttt,w) C_(U1, x8616_enc_alu_class() | x8616_enc_alu_ttt(ttt) | (X8616_OPCODE_ALU_ACC_FORM << X8616_OPCODE_ALU_ACC_FORM_SHIFT) | x8616_enc_width(w)) #define x8616_enc_alu_acc_i(ttt,w) C_(U1, x8616_enc_alu_class() | x8616_enc_alu_ttt(ttt) | (X8616_OPCODE_ALU_ACC_FORM << X8616_OPCODE_ALU_ACC_FORM_SHIFT) | x8616_enc_width(w))
#define x8616_enc_io_class() (X8616_OPCODE_IO_CLASS << X8616_OPCODE_IO_CLASS_STEM_SHIFT)
#define x8616_enc_io_dx(dx) ((dx) << X8616_OPCODE_IO_DX_STEM_SHIFT)
#define x8616_enc_io_out(out) ((out) << X8616_OPCODE_IO_OUT_STEM_SHIFT)
#define x8616_enc_io_stem(dx, out) (x8616_enc_io_class() | x8616_enc_io_dx(dx) | X8616_OPCODE_IO_FIXED_FORM | x8616_enc_io_out(out))
#define x8616_enc_io(dx, out, w) C_(U1, (x8616_enc_io_stem(dx, out) << X8616_OPCODE_W_HOLE) | x8616_enc_width(w))
#define x8616_enc_pair(bit) ((bit) << X8616_OPCODE_PAIR_SHIFT)
// Scalar / generic packets // Scalar / generic packets
@@ -736,16 +669,16 @@ FI_ U1 x8616_modrm_sr (U1 modrm) { return (
#define x8616_emit_op_i16(opcode,imm) u1_(opcode), x8616_emit_u2(imm) #define x8616_emit_op_i16(opcode,imm) u1_(opcode), x8616_emit_u2(imm)
#define x8616_emit_op_far(opcode,seg,off) u1_(opcode), x8616_emit_u2(off), x8616_emit_u2(seg) #define x8616_emit_op_far(opcode,seg,off) u1_(opcode), x8616_emit_u2(off), x8616_emit_u2(seg)
#define x8616_emit_modrm(opcode,mod,reg,rm) u1_(opcode), x8616_enc_modrm(mod,reg,rm) #define x8616_emit_modrm(header,mod,reg,rm) u1_(header), x8616_enc_modrm(mod,reg,rm)
#define x8616_emit_modrm_d8(opcode,reg,rm,disp) x8616_emit_modrm (opcode,x8616_mod_mem_d8,reg,rm), u1_(disp) #define x8616_emit_modrm_d8(header,reg,rm,disp) x8616_emit_modrm (header,x8616_mod_mem_d8,reg,rm), u1_(disp)
#define x8616_emit_modrm_d16(opcode,reg,rm,disp) x8616_emit_modrm (opcode,x8616_mod_mem_d16,reg,rm), x8616_emit_s2(disp) #define x8616_emit_modrm_d16(header,reg,rm,disp) x8616_emit_modrm (header,x8616_mod_mem_d16,reg,rm), x8616_emit_s2(disp)
#define x8616_emit_modrm_direct(opcode,reg,addr) x8616_emit_modrm (opcode,x8616_mod_mem,reg,x8616_ea_direct), x8616_emit_u2(addr) #define x8616_emit_modrm_direct(header,reg,addr) x8616_emit_modrm (header,x8616_mod_mem,reg,x8616_ea_direct), x8616_emit_u2(addr)
#define x8616_emit_modrm_i8(opcode,mod,reg,rm,imm) x8616_emit_modrm (opcode,mod,reg,rm), u1_(imm) #define x8616_emit_modrm_i8(header,mod,reg,rm,imm) x8616_emit_modrm (header,mod,reg,rm), u1_(imm)
#define x8616_emit_modrm_i16(opcode,mod,reg,rm,imm) x8616_emit_modrm (opcode,mod,reg,rm), x8616_emit_u2(imm) #define x8616_emit_modrm_i16(header,mod,reg,rm,imm) x8616_emit_modrm (header,mod,reg,rm), x8616_emit_u2(imm)
#define x8616_emit_modrm_d8_i8(opcode,reg,rm,disp,imm) x8616_emit_modrm_d8 (opcode,reg,rm,disp), u1_(imm) #define x8616_emit_modrm_d8_i8(header,reg,rm,disp,imm) x8616_emit_modrm_d8 (header,reg,rm,disp), u1_(imm)
#define x8616_emit_modrm_d8_i16(opcode,reg,rm,disp,imm) x8616_emit_modrm_d8 (opcode,reg,rm,disp), x8616_emit_u2(imm) #define x8616_emit_modrm_d8_i16(header,reg,rm,disp,imm) x8616_emit_modrm_d8 (header,reg,rm,disp), x8616_emit_u2(imm)
#define x8616_emit_modrm_d16_i8(opcode,reg,rm,disp,imm) x8616_emit_modrm_d16(opcode,reg,rm,disp), u1_(imm) #define x8616_emit_modrm_d16_i8(header,reg,rm,disp,imm) x8616_emit_modrm_d16(header,reg,rm,disp), u1_(imm)
#define x8616_emit_modrm_d16_i16(opcode,reg,rm,disp,imm) x8616_emit_modrm_d16(opcode,reg,rm,disp), x8616_emit_u2(imm) #define x8616_emit_modrm_d16_i16(header,reg,rm,disp,imm) x8616_emit_modrm_d16(header,reg,rm,disp), x8616_emit_u2(imm)
// r/m + register / immediate packets // r/m + register / immediate packets
+90 -90
View File
@@ -6,96 +6,96 @@
RO_ global X8616_DecodePlan x8616_decode_plans[90] = RO_ global X8616_DecodePlan x8616_decode_plans[90] =
{ {
{ 0x0000, 0x00, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x00, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x041a, 0x02, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x041a, 0x02, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x02, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x02, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0110, 0x02, 0x00, 0x00, {0x03, 0x07}, 2, 1, 0, 0, 3, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0110, 0x02, 0x00, 0x00, {0x03, 0x07}, 2, 1, 0, 0, 3, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0018, 0x02, 0x00, 0x00, {0x06, 0x0a}, 2, 4, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0018, 0x02, 0x00, 0x00, {0x06, 0x0a}, 2, 4, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x040a, 0x02, 0x00, 0x02, {0x01, 0x04}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x20}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x040a, 0x02, 0x00, 0x02, {0x01, 0x04}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x20}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x0b, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x0b, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0100, 0x0b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0100, 0x0b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0100, 0x0c, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0100, 0x0c, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0200, 0x0b, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0200, 0x0b, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0402, 0x0c, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0402, 0x0c, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0200, 0x0c, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0200, 0x0c, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x0d, 0x00, 0x00, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x0d, 0x00, 0x00, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0100, 0x0d, 0x00, 0x02, {0x06, 0x03}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0100, 0x0d, 0x00, 0x02, {0x06, 0x03}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x0e, 0x00, 0x00, {0x06, 0x08}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x0e, 0x00, 0x00, {0x06, 0x08}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x0e, 0x00, 0x00, {0x06, 0x0e}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x0e, 0x00, 0x00, {0x06, 0x0e}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x0f, 0x00, 0x00, {0x08, 0x06}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x0f, 0x00, 0x00, {0x08, 0x06}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x0f, 0x00, 0x00, {0x0e, 0x06}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x0f, 0x00, 0x00, {0x0e, 0x06}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x10, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x10, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0402, 0x11, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0402, 0x11, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0402, 0x12, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0402, 0x12, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0402, 0x13, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0402, 0x13, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x14, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x14, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x15, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x15, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x16, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x16, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x17, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x17, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x141a, 0x00, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 3, 0, 0, 0, 0, }, { 0x141a, 0x00, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 3, 0, 0, },
{ 0x1010, 0x00, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 3, 0, 0, 0, 0, }, { 0x1010, 0x00, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 3, 0, 0, },
{ 0x0432, 0x00, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 1, 0, }, { 0x0432, 0x00, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 1, },
{ 0x0412, 0x18, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x18, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0100, 0x18, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0100, 0x18, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0100, 0x1b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0100, 0x1b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x19, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x19, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x1a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x1a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x1b, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x08, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x1b, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x08, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x1c, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x1c, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x1f, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x1f, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x20, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x20, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x22, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x22, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x23, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x38, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x23, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x38, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x27, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x27, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x1d, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x1d, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x1e, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x1e, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0004, 0x21, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, 0, 0, 0, 0, 0, }, { 0x0004, 0x21, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, 0, 0, 0, },
{ 0x0004, 0x24, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, 0, 0, 0, 0, 0, }, { 0x0004, 0x24, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, 0, 0, 0, },
{ 0x0000, 0x25, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x25, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x26, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x26, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0452, 0x00, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 2, 0, }, { 0x0452, 0x00, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 2, },
{ 0x0412, 0x2f, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x2f, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x2f, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x2f, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x2f, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x2f, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0880, 0x30, 0x02, 0x00, {0x00, 0x00}, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0880, 0x30, 0x02, 0x00, {0x00, 0x00}, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x31, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x31, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x32, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x32, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x33, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x33, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x34, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x34, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0010, 0x35, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0010, 0x35, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0800, 0x5b, 0x02, 0x00, {0x00, 0x00}, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0800, 0x5b, 0x02, 0x00, {0x00, 0x00}, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0a00, 0x5c, 0x02, 0x00, {0x00, 0x00}, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0a00, 0x5c, 0x02, 0x00, {0x00, 0x00}, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x36, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x36, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x36, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x36, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x36, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x36, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x36, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x36, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x37, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x37, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x37, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x37, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x37, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x37, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x37, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x37, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0412, 0x37, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0412, 0x37, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x38, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x38, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x38, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x38, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x39, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x39, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x39, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x39, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x2000, 0x00, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x2000, 0x00, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4c, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4c, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4b, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4b, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4a, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4a, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4d, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4d, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4e, 0x00, 0x00, {0x08, 0x00}, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4e, 0x00, 0x00, {0x08, 0x00}, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x4f, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x4f, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x50, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x50, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x51, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x51, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x52, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x52, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x53, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x53, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x54, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x54, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x55, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x55, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x56, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x56, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x57, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x57, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x58, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x58, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x59, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x59, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
{ 0x0000, 0x5a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, 0, 0, }, { 0x0000, 0x5a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, 0, 0, 0, },
}; };
RO_ global U2 x8616_decode_dispatch[256] = RO_ global U2 x8616_decode_dispatch[256] =
+3 -3
View File
@@ -51,7 +51,7 @@ typedef Struct_(X8616_InfoMsg) {
The decoder itself never expands these. */ The decoder itself never expands these. */
RO_ global Str8 x8616_info_templates[x8616_info_count] = { RO_ global Str8 x8616_info_templates[x8616_info_count] = {
[x8616_info_none] = slit8(""), [x8616_info_none] = slit8(""),
[x8616_info_invalid_opcode] = slit8("Opcode <actual> is not in the Part 1 8086 decode table at <offset>."), [x8616_info_invalid_opcode] = slit8("Header <actual> is not in the Part 1 8086 decode table at <offset>."),
[x8616_info_invalid_opcode_extension] = slit8("Opcode extension <actual> does not match the selected encoding at <offset>."), [x8616_info_invalid_opcode_extension] = slit8("Opcode extension <actual> does not match the selected encoding at <offset>."),
[x8616_info_invalid_post_opcode] = slit8("Post-opcode byte <actual> does not match expected <expected> at <offset>."), [x8616_info_invalid_post_opcode] = slit8("Post-opcode byte <actual> does not match expected <expected> at <offset>."),
[x8616_info_truncated_instruction] = slit8("Instruction at <offset> needs <expected> bytes; <actual> are available."), [x8616_info_truncated_instruction] = slit8("Instruction at <offset> needs <expected> bytes; <actual> are available."),
@@ -59,8 +59,8 @@ RO_ global Str8 x8616_info_templates[x8616_info_count] = {
[x8616_info_gen_multiple_payloads] = slit8("Encoding <offset> describes more than one stream payload."), [x8616_info_gen_multiple_payloads] = slit8("Encoding <offset> describes more than one stream payload."),
[x8616_info_gen_body_cap_exceeded] = slit8("Encoding <offset> requires <actual> body bytes; decoder body capacity is <expected>."), [x8616_info_gen_body_cap_exceeded] = slit8("Encoding <offset> requires <actual> body bytes; decoder body capacity is <expected>."),
[x8616_info_gen_aux_cap_exceeded] = slit8("Generated auxiliary decode table exceeds capacity <expected>."), [x8616_info_gen_aux_cap_exceeded] = slit8("Generated auxiliary decode table exceeds capacity <expected>."),
[x8616_info_gen_ambiguous_decode] = slit8("Decode is ambiguous for opcode/second-byte key <offset>: plans <expected> and <actual>."), [x8616_info_gen_ambiguous_decode] = slit8("Decode is ambiguous for header/second-byte key <offset>: plans <expected> and <actual>."),
[x8616_info_gen_dispatch_mismatch] = slit8("Generated dispatch mismatch for opcode/second-byte key <offset>: expected <expected>, actual <actual>."), [x8616_info_gen_dispatch_mismatch] = slit8("Generated dispatch mismatch for header/second-byte key <offset>: expected <expected>, actual <actual>."),
[x8616_info_serialize_bad_request] = slit8("Serialize request is missing instructions, output, scratch, or info arena."), [x8616_info_serialize_bad_request] = slit8("Serialize request is missing instructions, output, scratch, or info arena."),
[x8616_info_serialize_invalid_record] = slit8("Serialize record <offset> is not printable (op <actual>)."), [x8616_info_serialize_invalid_record] = slit8("Serialize record <offset> is not printable (op <actual>)."),
[x8616_info_serialize_unsupported_form] = slit8("Serialize record <offset> has an unsupported display form (op <actual>)."), [x8616_info_serialize_unsupported_form] = slit8("Serialize record <offset> has an unsupported display form (op <actual>)."),
+2 -2
View File
@@ -425,9 +425,9 @@ x8616_serialize_validate(X8616_DecodedInstruction_R inst)
if (bad_decode || invalid_sig || invalid_mnemonic || invalid_prefix_with_seg) { if (bad_decode || invalid_sig || invalid_mnemonic || invalid_prefix_with_seg) {
status = x8616_serialize_invalid_record; goto status_failed; status = x8616_serialize_invalid_record; goto status_failed;
} }
B4 bad_prefix_segement = inst->prefixes.has_segment && (x8616_serialize_has_memory(inst) == 0); B4 bad_prefix_segment = inst->prefixes.has_segment && (x8616_serialize_has_memory(inst) == 0);
B4 bad_prefix_repeat = inst->prefixes.has_repeat && (x8616_serialize_is_string(inst->op) == 0); B4 bad_prefix_repeat = inst->prefixes.has_repeat && (x8616_serialize_is_string(inst->op) == 0);
if (bad_prefix_segement || bad_prefix_repeat) { if (bad_prefix_segment || bad_prefix_repeat) {
status = x8616_serialize_unsupported_form; goto status_failed; status = x8616_serialize_unsupported_form; goto status_failed;
} }