about summary refs log tree commit diff stats
path: root/017jump_disp8.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-30 22:50:26 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-30 22:53:14 -0700
commit656b840e7f5ee0eff08729146c4fc797c63968e1 (patch)
treeacea188c1be9794879f10c7e37e28c98061a4e78 /017jump_disp8.cc
parentd564633b240cfc0e8bfe49098a6ac49abf688a76 (diff)
downloadmu-656b840e7f5ee0eff08729146c4fc797c63968e1.tar.gz
6911 - comparing floats
It turns out floating-point operations set different flags than most instructions.
We have to branch on them using unsigned jumps.

https://stackoverflow.com/questions/7057501/x86-assembler-floating-point-compare/7057771#7057771
Diffstat (limited to '017jump_disp8.cc')
-rw-r--r--017jump_disp8.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/017jump_disp8.cc b/017jump_disp8.cc
index 47a94ea9..30e60a74 100644
--- a/017jump_disp8.cc
+++ b/017jump_disp8.cc
@@ -135,8 +135,8 @@ void test_jne_disp8_fail() {
 //:: jump if greater
 
 :(before "End Initialize Op Names")
-put_new(Name, "7f", "jump disp8 bytes away if greater (signed), if ZF is unset and SF == OF (jcc/jg/jnle)");
-put_new(Name, "77", "jump disp8 bytes away if greater (unsigned), if ZF is unset and CF is unset (jcc/ja/jnbe)");
+put_new(Name, "7f", "jump disp8 bytes away if greater, if ZF is unset and SF == OF (jcc/jg/jnle)");
+put_new(Name, "77", "jump disp8 bytes away if greater (addr, float), if ZF is unset and CF is unset (jcc/ja/jnbe)");
 
 :(code)
 void test_jg_disp8_success() {
@@ -199,8 +199,8 @@ void test_jg_disp8_fail() {
 //:: jump if greater or equal
 
 :(before "End Initialize Op Names")
-put_new(Name, "7d", "jump disp8 bytes away if greater or equal (signed), if SF == OF (jcc/jge/jnl)");
-put_new(Name, "73", "jump disp8 bytes away if greater or equal (unsigned), if CF is unset (jcc/jae/jnb)");
+put_new(Name, "7d", "jump disp8 bytes away if greater or equal, if SF == OF (jcc/jge/jnl)");
+put_new(Name, "73", "jump disp8 bytes away if greater or equal (addr, float), if CF is unset (jcc/jae/jnb)");
 
 :(code)
 void test_jge_disp8_success() {
@@ -261,8 +261,8 @@ void test_jge_disp8_fail() {
 //:: jump if lesser
 
 :(before "End Initialize Op Names")
-put_new(Name, "7c", "jump disp8 bytes away if lesser (signed), if SF != OF (jcc/jl/jnge)");
-put_new(Name, "72", "jump disp8 bytes away if lesser (unsigned), if CF is set (jcc/jb/jnae)");
+put_new(Name, "7c", "jump disp8 bytes away if lesser, if SF != OF (jcc/jl/jnge)");
+put_new(Name, "72", "jump disp8 bytes away if lesser (addr, float), if CF is set (jcc/jb/jnae)");
 
 :(code)
 void test_jl_disp8_success() {
@@ -325,8 +325,8 @@ void test_jl_disp8_fail() {
 //:: jump if lesser or equal
 
 :(before "End Initialize Op Names")
-put_new(Name, "7e", "jump disp8 bytes away if lesser or equal (signed), if ZF is set or SF != OF (jcc/jle/jng)");
-put_new(Name, "76", "jump disp8 bytes away if lesser or equal (unsigned), if ZF is set or CF is set (jcc/jbe/jna)");
+put_new(Name, "7e", "jump disp8 bytes away if lesser or equal, if ZF is set or SF != OF (jcc/jle/jng)");
+put_new(Name, "76", "jump disp8 bytes away if lesser or equal (addr, float), if ZF is set or CF is set (jcc/jbe/jna)");
 
 :(code)
 void test_jle_disp8_equal() {