Commit b1c7c575 authored by Wei Yongjun's avatar Wei Yongjun Committed by Marcelo Tosatti
Browse files

Add realmode test for jcxz instruction


Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 37f51a4a
......@@ -1242,6 +1242,47 @@ void test_lds_lss()
outregs.ebx == desc.sel);
}
void test_jcxz(void)
{
MK_INSN(jcxz1, "jcxz 1f\n\t"
"mov $0x1234, %eax\n\t"
"1:\n\t");
MK_INSN(jcxz2, "mov $0x100, %ecx\n\t"
"jcxz 1f\n\t"
"mov $0x1234, %eax\n\t"
"mov $0, %ecx\n\t"
"1:\n\t");
MK_INSN(jcxz3, "mov $0x10000, %ecx\n\t"
"jcxz 1f\n\t"
"mov $0x1234, %eax\n\t"
"1:\n\t");
MK_INSN(jecxz1, "jecxz 1f\n\t"
"mov $0x1234, %eax\n\t"
"1:\n\t");
MK_INSN(jecxz2, "mov $0x10000, %ecx\n\t"
"jecxz 1f\n\t"
"mov $0x1234, %eax\n\t"
"mov $0, %ecx\n\t"
"1:\n\t");
inregs = (struct regs){ 0 };
exec_in_big_real_mode(&insn_jcxz1);
report("jcxz short 1", 0, 1);
exec_in_big_real_mode(&insn_jcxz2);
report("jcxz short 2", R_AX, outregs.eax == 0x1234);
exec_in_big_real_mode(&insn_jcxz3);
report("jcxz short 3", R_CX, outregs.ecx == 0x10000);
exec_in_big_real_mode(&insn_jecxz1);
report("jecxz short 1", 0, 1);
exec_in_big_real_mode(&insn_jecxz2);
report("jecxz short 2", R_AX, outregs.eax == 0x1234);
}
void realmode_start(void)
{
test_null();
......@@ -1274,6 +1315,7 @@ void realmode_start(void)
test_cwd_cdq();
test_das();
test_lds_lss();
test_jcxz();
exit(0);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment