X86: Implemented LODS.
--HG-- extra : convert_revision : 4bd8f15bbc25f5dce16ea0504ad6dd21805fa56a
This commit is contained in:
@@ -335,17 +335,17 @@
|
||||
0x6: StringTestInst::CMPS(Yb,Xb);
|
||||
0x7: StringTestInst::CMPS(Yv,Xv);
|
||||
}
|
||||
0x15: decode OPCODE_OP_BOTTOM3 {
|
||||
0x0: Inst::TEST(rAb,Ib);
|
||||
0x1: Inst::TEST(rAv,Iz);
|
||||
0x2: StringInst::STOS(Yb);
|
||||
0x3: StringInst::STOS(Yv);
|
||||
0x4: lods_Al_Xb();
|
||||
0x5: lods_rAX_Xv();
|
||||
0x6: StringTestInst::SCAS(Yb);
|
||||
0x7: StringTestInst::SCAS(Yv);
|
||||
}
|
||||
format Inst {
|
||||
0x15: decode OPCODE_OP_BOTTOM3 {
|
||||
0x0: TEST(rAb,Ib);
|
||||
0x1: TEST(rAv,Iz);
|
||||
0x2: StringInst::STOS(Yb);
|
||||
0x3: StringInst::STOS(Yv);
|
||||
0x4: StringInst::LODS(Xb);
|
||||
0x5: StringInst::LODS(Xv);
|
||||
0x6: StringTestInst::SCAS(Yb);
|
||||
0x7: StringTestInst::SCAS(Yv);
|
||||
}
|
||||
0x16: MOV(Bb,Ib);
|
||||
0x17: MOV(Bv,Iv);
|
||||
0x18: decode OPCODE_OP_BOTTOM3 {
|
||||
|
||||
@@ -53,16 +53,32 @@
|
||||
#
|
||||
# Authors: Gabe Black
|
||||
|
||||
microcode = ""
|
||||
#let {{
|
||||
# class LODS(Inst):
|
||||
# "GenFault ${new UnimpInstFault}"
|
||||
# class LODSB(Inst):
|
||||
# "GenFault ${new UnimpInstFault}"
|
||||
# class LODSW(Inst):
|
||||
# "GenFault ${new UnimpInstFault}"
|
||||
# class LODSD(Inst):
|
||||
# "GenFault ${new UnimpInstFault}"
|
||||
# class LODSQ(Inst):
|
||||
# "GenFault ${new UnimpInstFault}"
|
||||
#}};
|
||||
microcode = '''
|
||||
def macroop LODS_M {
|
||||
# Find the constant we need to either add or subtract from rdi
|
||||
ruflag t0, 10
|
||||
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
|
||||
subi t4, t0, dsz, dataSize=asz
|
||||
mov t3, t3, t4, flags=(nCEZF,), dataSize=asz
|
||||
|
||||
ld rax, seg, [1, t0, rdi]
|
||||
|
||||
add rdi, rdi, t3, dataSize=asz
|
||||
};
|
||||
|
||||
def macroop LODS_E_M {
|
||||
# Find the constant we need to either add or subtract from rdi
|
||||
ruflag t0, 10
|
||||
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
|
||||
subi t4, t0, dsz, dataSize=asz
|
||||
mov t3, t3, t4, flags=(nCEZF,), dataSize=asz
|
||||
|
||||
topOfLoop:
|
||||
ld rax, seg, [1, t0, rdi]
|
||||
|
||||
subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
|
||||
add rdi, rdi, t3, dataSize=asz
|
||||
bri t0, label("topOfLoop"), flags=(nCEZF,)
|
||||
fault "NoFault"
|
||||
};
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user