mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
Custom implementation for 'mov r/m, imm'
This commit is contained in:
parent
415e345e54
commit
9164e0a48f
2 changed files with 21 additions and 1 deletions
|
|
@ -182,7 +182,7 @@ const encodings = [
|
|||
{ opcode: 0xC4, block_boundary: 1, os: 1, e: 1, skip: 1, }, // les
|
||||
{ opcode: 0xC5, block_boundary: 1, os: 1, e: 1, skip: 1, }, // lds
|
||||
|
||||
{ opcode: 0xC6, e: 1, fixed_g: 0, imm8: 1 },
|
||||
{ opcode: 0xC6, custom: 1, e: 1, fixed_g: 0, imm8: 1 },
|
||||
{ opcode: 0xC7, custom: 1, os: 1, e: 1, fixed_g: 0, imm1632: 1 },
|
||||
|
||||
// XXX: Temporary block boundary
|
||||
|
|
|
|||
|
|
@ -595,6 +595,26 @@ pub fn instr32_0FBE_mem_jit(ctx: &mut JitContext, modrm_byte: u8, r: u32) {
|
|||
ctx.builder.instruction_body.store_aligned_i32(0);
|
||||
}
|
||||
|
||||
pub fn instr_C6_0_reg_jit(ctx: &mut JitContext, r: u32, imm: u32) {
|
||||
// reg8[r] = imm;
|
||||
ctx.builder
|
||||
.instruction_body
|
||||
.const_i32(global_pointers::get_reg8_offset(r) as i32);
|
||||
ctx.builder.instruction_body.const_i32(imm as i32);
|
||||
ctx.builder.instruction_body.store_u8(0);
|
||||
}
|
||||
|
||||
pub fn instr_C6_0_mem_jit(ctx: &mut JitContext, modrm_byte: u8) {
|
||||
codegen::gen_modrm_resolve(ctx, modrm_byte);
|
||||
let address_local = ctx.builder.set_new_local();
|
||||
let imm = ctx.cpu.read_imm8();
|
||||
ctx.builder.instruction_body.const_i32(imm as i32);
|
||||
let value_local = ctx.builder.set_new_local();
|
||||
codegen::gen_safe_write8(ctx, &address_local, &value_local);
|
||||
ctx.builder.free_local(address_local);
|
||||
ctx.builder.free_local(value_local);
|
||||
}
|
||||
|
||||
pub fn instr16_C7_0_reg_jit(ctx: &mut JitContext, r: u32, imm: u32) {
|
||||
// reg16[r] = imm;
|
||||
ctx.builder
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue