about summary refs log tree commit diff stats
path: root/subx/apps/crenshaw2-1b.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-11-25 13:46:53 -0800
committerKartik Agaram <vc@akkartik.com>2018-11-25 13:46:53 -0800
commit50dcc0c122e7208fbddedac6f7939020c28e460d (patch)
treee24b92db5fe4e01ef7707448b34eed0afdcce9bb /subx/apps/crenshaw2-1b.subx
parent33fdc60b168a04ca26b4924ecde2adb7c8059a13 (diff)
downloadmu-50dcc0c122e7208fbddedac6f7939020c28e460d.tar.gz
4776
Crenshaw compiler now runs natively as well.

It turns out I was misreading the Intel manual, and the jump instructions
that I thought take disp16 operands actually take disp32 operands by default
on both i686 and x86_64 processors. The disp16 versions are some holdover
from the 16-bit days.

This was the first time I've used one of these erstwhile-disp16 instructions,
but I still haven't tested most of them. We'll see if we run into future
issues.
Diffstat (limited to 'subx/apps/crenshaw2-1b.subx')
-rw-r--r--subx/apps/crenshaw2-1b.subx2
1 files changed, 1 insertions, 1 deletions
diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx
index ef6996ee..1776b833 100644
--- a/subx/apps/crenshaw2-1b.subx
+++ b/subx/apps/crenshaw2-1b.subx
@@ -291,7 +291,7 @@ $get-num:loop-stage2:
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
   # if EAX loop
   3d/compare-EAX  0/imm32
-  0f 85/jump-if-not-equal  $get-num:loop/disp16
+  0f 85/jump-if-not-equal  $get-num:loop/disp32
 $get-num:loop-end:
   # persist necessary variables from registers
   89/copy                         0/mod/indirect  7/rm32/EDI    .           .             .           1/r32/ECX   .               .                 # copy ECX to *EDI