public void EvGv() { code = new Byte[] { 0x89, 0x00 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); }
public void EvGv() { code = new Byte[] {0x89, 0x00}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); }
public void None() { code = new Byte[] { 0x90 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.None, encoding); Assert.AreEqual(StackEffect.None, opcode.GetStackEffectFor(code)); }
public void rAxIv() { code = new Byte[] { 0xb8, 0x00, 0x00, 0x00, 0x00 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxIv, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void Halt() { code = new Byte[] { 0xf4 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.None, encoding); Assert.AreEqual(StackEffect.None, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.TerminatesFunction(code)); }
public void PushrBX() { code = new Byte[] { 0x53 }; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rBX, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.AreEqual(RegisterName.None, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(RegisterName.EBX, opcode.GetSourceRegisterFor(code)); }
public void EbIb() { const byte IMMEDIATE = 0; code = new Byte[] {0xc6, 0x40, 0x10, IMMEDIATE}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EbIb, encoding); Assert.AreEqual(IMMEDIATE, opcode.GetImmediateFor(code)); }
public void EvGvSub() { code = new Byte[] {0x29, 0xc4}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Sub, operatorEffect); }
public void EvIz() { code = new Byte[] { 0xc7, 0x04, 0x24, 0x10, 0x00, 0x00, 0x00 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIz, encoding); Assert.IsTrue(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.ESP, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(0x10, opcode.GetImmediateFor(code)); }
public void GvEv() { // mov eax, [eax] code = new Byte[] { 0x8b, 0x00 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void GvEvDword() { // mov eax, [0x11223344] code = new Byte[] { 0x8b, 0x05, 0x44, 0x33, 0x22, 0x11 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.None, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void GvEvSIB() { // mov eax, [base_register+scale_register*scaler code = new Byte[] { 0x8b, 0x04, 0x24 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.None, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void PushrDX() { code = new Byte[] { 0x52 }; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rDX, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.EDX, opcode.GetSourceRegisterFor(code)); }
public void EbIb() { const byte IMMEDIATE = 0; code = new Byte[] { 0xc6, 0x40, 0x10, IMMEDIATE }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EbIb, encoding); Assert.AreEqual(IMMEDIATE, opcode.GetImmediateFor(code)); }
public void EvIbShr() { code = new Byte[] { 0xc1, 0xe8, 0x04 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Shr, operatorEffect); }
public void EvIbAnd() { code = new Byte[] { 0x83, 0xe4, 0xf0 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.And, operatorEffect); }
public void Jb() { code = new Byte[] { 0x75, 0x06 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Jb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Jnz, operatorEffect); }
public void PoprSP() { code = new Byte[] { 0x5c }; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rSP, encoding); Assert.AreEqual(StackEffect.Pop, opcode.GetStackEffectFor(code)); Assert.IsFalse(opcode.HasSourceRegister(code)); Assert.IsTrue(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.None, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.ESP, opcode.GetDestinationRegisterFor(code)); }
public void Jz() { code = new Byte[] { 0xe8, 0x14, 0xff, 0xff, 0xff }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Jz, encoding); Assert.AreEqual(OperatorEffect.Call, opcode.GetOperatorEffectFor(code)); Assert.IsTrue(opcode.HasImmediate(code)); Assert.AreEqual(0xffffff14, opcode.GetImmediateFor(code)); }
public void PushrSI() { code = new Byte[] { 0x56 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rSI, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.ESI, opcode.GetSourceRegisterFor(code)); }
public void XorEvGv() { // xor EBP,EBP code = new Byte[] { 0x31, 0xed }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); Assert.AreEqual(OperatorEffect.Xor, opcode.GetOperatorEffectFor(code)); Assert.AreEqual(RegisterName.EBP, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(RegisterName.EBP, opcode.GetSourceRegisterFor(code)); }
public void rAxIz() { code = new Byte[] { 0x05, 0x04, 0x01, 0x00, 0x00 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxIz, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Add, operatorEffect); }
public void rAxOv() { code = new Byte[] { 0xa1, 0xe4, 0x84, 0x04, 0x08 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxOv, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void EvGvSub() { code = new Byte[] { 0x29, 0xc4 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Sub, operatorEffect); }
public void AnotherGvM() { code = new Byte[] {0x8d, 0x04, 0x02}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); Assert.IsTrue(opcode.HasModRM(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvM, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void EvIbAdd() { // 83 c0 0f add eax,0xf code = new Byte[] { 0x83, 0xc0, 0x0f }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Add, operatorEffect); }
public void EbGb() { // mov BYTE PTR [eax+16],bl code = new Byte[] {0x88, 0x58, 0x10}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EbGb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EBX, opcode.GetSourceRegisterFor(code)); }
public void ObAL() { // mov ds:0x80495e0,al code = new Byte[] { 0xa2, 0xe0, 0x95, 0x04, 0x08 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.ObAL, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void PushIz() { code = new Byte[] { 0x68, 0x10, 0x84, 0x04, 0x08 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Iz, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsFalse(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.IsTrue(opcode.HasImmediate(code)); Assert.AreEqual(0x08048410, opcode.GetImmediateFor(code)); }
public void GvEbOffsetToRegister() { // movzx edx,BYTE PTR ds:0x80495e0 code = new Byte[] { 0x0f, 0xb6, 0x15, 0xe0, 0x95, 0x04, 0x08 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void AnotherGvM() { code = new Byte[] { 0x8d, 0x04, 0x02 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); Assert.IsTrue(opcode.HasModRM(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvM, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void GvEbRegisterToRegister() { // movzx ebx,BYTE PTR [eax] code = new Byte[] { 0x0f, 0xb6, 0x18 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); }
public void EbGb() { // mov BYTE PTR [eax+16],bl code = new Byte[] { 0x88, 0x58, 0x10 }; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EbGb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EBX, opcode.GetSourceRegisterFor(code)); }
public void GvM() { // lea edx, [eax+16] code = new Byte[] { 0x8d, 0x50, 0x10 }; Assert.IsTrue(opcode.HasModRM(code)); Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvM, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void rAxIv() { code = new Byte[] {0xb8, 0x00, 0x00, 0x00, 0x00}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxIv, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void GvEv() { // mov eax, [eax] code = new Byte[] {0x8b, 0x00}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void GvEbRegisterToRegister() { // movzx ebx,BYTE PTR [eax] code = new Byte[] {0x0f, 0xb6, 0x18}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); }
public void Jb() { code = new Byte[] {0x75, 0x06}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Jb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Jnz, operatorEffect); }
public void GvEvDword() { // mov eax, [0x11223344] code = new Byte[] {0x8b, 0x05, 0x44, 0x33, 0x22, 0x11}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.None, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void PushrSI() { code = new Byte[] {0x56}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rSI, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.ESI, opcode.GetSourceRegisterFor(code)); }
public void EvIz() { code = new Byte[] {0xc7, 0x04, 0x24, 0x10, 0x00, 0x00, 0x00}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIz, encoding); Assert.IsTrue(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.ESP, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(0x10, opcode.GetImmediateFor(code)); }
public void GvEvSIB() { // mov eax, [base_register+scale_register*scaler code = new Byte[] {0x8b, 0x04, 0x24}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEv, encoding); Assert.AreEqual(RegisterName.None, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.EAX, opcode.GetDestinationRegisterFor(code)); }
public void PoprDX() { code = new Byte[] {0x5a}; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rDX, encoding); Assert.AreEqual(StackEffect.Pop, opcode.GetStackEffectFor(code)); Assert.IsFalse(opcode.HasSourceRegister(code)); Assert.IsTrue(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.EDX, opcode.GetDestinationRegisterFor(code)); }
public void None() { code = new Byte[] {0x90}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.None, encoding); Assert.AreEqual(StackEffect.None, opcode.GetStackEffectFor(code)); }
public void ObAL() { // mov ds:0x80495e0,al code = new Byte[] {0xa2, 0xe0, 0x95, 0x04, 0x08}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.ObAL, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void GvM() { // lea edx, [eax+16] code = new Byte[] {0x8d, 0x50, 0x10}; Assert.IsTrue(opcode.HasModRM(code)); Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvM, encoding); Assert.AreEqual(RegisterName.EAX, opcode.GetSourceRegisterFor(code)); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void EvIbAdd() { // 83 c0 0f add eax,0xf code = new Byte[] {0x83, 0xc0, 0x0f}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Add, operatorEffect); }
public void EvIbShr() { code = new Byte[] {0xc1, 0xe8, 0x04}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Shr, operatorEffect); }
public void PushrSP() { code = new Byte[] {0x54}; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rSP, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.AreEqual(RegisterName.ESP, opcode.GetSourceRegisterFor(code)); Assert.AreEqual(RegisterName.None, opcode.GetDestinationRegisterFor(code)); }
public void XorEvGv() { // xor EBP,EBP code = new Byte[] {0x31, 0xed}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvGv, encoding); Assert.AreEqual(OperatorEffect.Xor, opcode.GetOperatorEffectFor(code)); Assert.AreEqual(RegisterName.EBP, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(RegisterName.EBP, opcode.GetSourceRegisterFor(code)); }
public void GvEbOffsetToRegister() { // movzx edx,BYTE PTR ds:0x80495e0 code = new Byte[] {0x0f, 0xb6, 0x15, 0xe0, 0x95, 0x04, 0x08}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.GvEb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void rAxOv() { code = new Byte[] {0xa1, 0xe4, 0x84, 0x04, 0x08}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxOv, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Assignment, operatorEffect); }
public void PushrBX() { code = new Byte[] {0x53}; encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rBX, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.AreEqual(RegisterName.None, opcode.GetDestinationRegisterFor(code)); Assert.AreEqual(RegisterName.EBX, opcode.GetSourceRegisterFor(code)); }
public void rAxIz() { code = new Byte[] {0x05, 0x04, 0x01, 0x00, 0x00}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.rAxIz, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Add, operatorEffect); }
public void Halt() { code = new Byte[] {0xf4}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.None, encoding); Assert.AreEqual(StackEffect.None, opcode.GetStackEffectFor(code)); Assert.IsTrue(opcode.TerminatesFunction(code)); }
public void Jz() { code = new Byte[] {0xe8, 0x14, 0xff, 0xff, 0xff}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Jz, encoding); Assert.AreEqual(OperatorEffect.Call, opcode.GetOperatorEffectFor(code)); Assert.IsTrue(opcode.HasImmediate(code)); Assert.AreEqual(0xffffff14, opcode.GetImmediateFor(code)); }
public void EvIbCmp() { code = new Byte[] {0x83, 0x7d, 0x08, 0x01}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.EvIb, encoding); var operatorEffect = opcode.GetOperatorEffectFor(code); Assert.AreEqual(OperatorEffect.Cmp, operatorEffect); }
public void PushIz() { code = new Byte[] {0x68, 0x10, 0x84, 0x04, 0x08}; Assert.AreEqual(code.Length, opcode.GetInstructionLengthFor(code)); encoding = opcode.GetEncodingFor(code); Assert.AreEqual(OpcodeEncoding.Iz, encoding); Assert.AreEqual(StackEffect.Push, opcode.GetStackEffectFor(code)); Assert.IsFalse(opcode.HasSourceRegister(code)); Assert.IsFalse(opcode.HasDestinationRegister(code)); Assert.IsTrue(opcode.HasImmediate(code)); Assert.AreEqual(0x08048410, opcode.GetImmediateFor(code)); }