mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
UserspaceEmulator: Implement the NEG instruction
Per the Intel manuals, NEG is equivalent to subtracting a value from 0.
This commit is contained in:
parent
aa13183615
commit
df95e25eaa
1 changed files with 16 additions and 3 deletions
|
@ -998,9 +998,22 @@ void SoftCPU::MOV_seg_RM32(const X86::Instruction&) { TODO(); }
|
|||
void SoftCPU::MUL_RM16(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::MUL_RM32(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::MUL_RM8(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::NEG_RM16(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::NEG_RM32(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::NEG_RM8(const X86::Instruction&) { TODO(); }
|
||||
|
||||
void SoftCPU::NEG_RM16(const X86::Instruction& insn)
|
||||
{
|
||||
insn.modrm().write16(*this, insn, op_sub<u16>(*this, 0, insn.modrm().read16(*this, insn)));
|
||||
}
|
||||
|
||||
void SoftCPU::NEG_RM32(const X86::Instruction& insn)
|
||||
{
|
||||
insn.modrm().write32(*this, insn, op_sub<u32>(*this, 0, insn.modrm().read32(*this, insn)));
|
||||
}
|
||||
|
||||
void SoftCPU::NEG_RM8(const X86::Instruction& insn)
|
||||
{
|
||||
insn.modrm().write8(*this, insn, op_sub<u8>(*this, 0, insn.modrm().read8(*this, insn)));
|
||||
}
|
||||
|
||||
void SoftCPU::NOP(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::NOT_RM16(const X86::Instruction&) { TODO(); }
|
||||
void SoftCPU::NOT_RM32(const X86::Instruction&) { TODO(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue