mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
make #ud non-panic
This commit is contained in:
parent
4aa1c16995
commit
d074a7f8a4
2 changed files with 5 additions and 4 deletions
|
|
@ -213,8 +213,9 @@ function gen_instruction_body_after_prefix(encodings, size)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
default_case: {
|
default_case: {
|
||||||
|
varname: "x",
|
||||||
body: [
|
body: [
|
||||||
`if DEBUG { panic!("Bad instruction at {:x}", *instruction_pointer); }`,
|
`dbg_log!("#ud ${encoding.opcode.toString(16).toUpperCase()}/{} at {:x}", x, *instruction_pointer);`,
|
||||||
"trigger_ud();",
|
"trigger_ud();",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
@ -413,7 +414,7 @@ function gen_table()
|
||||||
|
|
||||||
"use crate::cpu::cpu::{after_block_boundary, modrm_resolve};",
|
"use crate::cpu::cpu::{after_block_boundary, modrm_resolve};",
|
||||||
"use crate::cpu::cpu::{read_imm8, read_imm8s, read_imm16, read_imm32s, read_moffs};",
|
"use crate::cpu::cpu::{read_imm8, read_imm8s, read_imm16, read_imm32s, read_moffs};",
|
||||||
"use crate::cpu::cpu::{task_switch_test, trigger_ud, DEBUG};",
|
"use crate::cpu::cpu::{task_switch_test, trigger_ud};",
|
||||||
"use crate::cpu::instructions;",
|
"use crate::cpu::instructions;",
|
||||||
"use crate::cpu::global_pointers::{instruction_pointer, prefixes};",
|
"use crate::cpu::global_pointers::{instruction_pointer, prefixes};",
|
||||||
"use crate::prefix;",
|
"use crate::prefix;",
|
||||||
|
|
@ -478,7 +479,6 @@ function gen_table()
|
||||||
"use crate::cpu::cpu::{after_block_boundary, modrm_resolve};",
|
"use crate::cpu::cpu::{after_block_boundary, modrm_resolve};",
|
||||||
"use crate::cpu::cpu::{read_imm8, read_imm16, read_imm32s};",
|
"use crate::cpu::cpu::{read_imm8, read_imm16, read_imm32s};",
|
||||||
"use crate::cpu::cpu::{task_switch_test, task_switch_test_mmx, trigger_ud};",
|
"use crate::cpu::cpu::{task_switch_test, task_switch_test_mmx, trigger_ud};",
|
||||||
"use crate::cpu::cpu::DEBUG;",
|
|
||||||
"use crate::cpu::instructions_0f;",
|
"use crate::cpu::instructions_0f;",
|
||||||
"use crate::cpu::global_pointers::{instruction_pointer, prefixes};",
|
"use crate::cpu::global_pointers::{instruction_pointer, prefixes};",
|
||||||
"use crate::prefix;",
|
"use crate::prefix;",
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,8 @@ export function print_syntax_tree(statements)
|
||||||
|
|
||||||
if(statement.default_case)
|
if(statement.default_case)
|
||||||
{
|
{
|
||||||
cases.push(`_ => {`);
|
const varname = statement.default_case.varname || "_";
|
||||||
|
cases.push(`${varname} => {`);
|
||||||
cases.push.apply(cases, indent(print_syntax_tree(statement.default_case.body), 4));
|
cases.push.apply(cases, indent(print_syntax_tree(statement.default_case.body), 4));
|
||||||
cases.push(`}`);
|
cases.push(`}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue