X86: Implement the LOOP instructions.

--HG--
extra : convert_revision : 3ccd0565c83b6d9c9b63f9f7ac2b67839a2c714f
This commit is contained in:
Gabe Black
2007-10-18 22:38:17 -07:00
parent 418b30602b
commit 2bbc058c6c
2 changed files with 22 additions and 8 deletions

View File

@@ -472,9 +472,9 @@
}
##include "x87.isa"
0x1C: decode OPCODE_OP_BOTTOM3 {
0x0: loopne_Jb();
0x1: loope_Jb();
0x2: loop_Jb();
0x0: Inst::LOOPNE(Jb);
0x1: Inst::LOOPE(Jb);
0x2: Inst::LOOP(Jb);
0x3: Inst::JRCX(Jb);
0x4: in_Al_Ib();
0x5: in_eAX_Ib();

View File

@@ -53,8 +53,22 @@
#
# Authors: Gabe Black
microcode = ""
#let {{
# class LOOPcc(Inst):
# "GenFault ${new UnimpInstFault}"
#}};
microcode = '''
def macroop LOOP_I {
rdip t1
subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
wripi t1, imm, flags=(nCEZF,)
};
def macroop LOOPNE_I {
rdip t1
subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
wripi t1, imm, flags=(CSTRnZnEZF,)
};
def macroop LOOPE_I {
rdip t1
subi rcx, rcx, 1, flags=(EZF,), dataSize=asz
wripi t1, imm, flags=(CSTRZnEZF,)
};
'''