ack/mach/i386/libem
George Koehler 893df4b79b Experiment with 8-byte integers in ncg i386.
This provides adi, sbi, mli, dvi, rmi, ngi, dvu, rmu 8, but is missing
shifts and rotates.  It is also missing conversions between 8-byte
integers and other sizes of integers or floats.  The code might not be
all correct, but works at least some of the time.

I adapted this from how ncg i86 does 4-byte integers, but I use a
different algorithm when dividing by a large value: i86 avoids the div
instruction and uses a shift-and-subtract loop; but I use the div
instruction to estimate a quotient, which is more like how big integer
libraries do division.  My .dvi8 and .dvu8 also set ecx:ebx to the
remainder; this might be a bad idea, because it requires .dvi8 and
.dvu8 to always calculate the remainder, even when the caller only
wants the quotient.

To play with 8-byte integers, I wrote EM procedures like

     mes 2, 4, 4
     exp $ngi
     pro $ngi,0
     ldl 4
     ngi 8
     lol 0
     sti 8
     lol 0
     ret 4
     end
     exp $adi
     pro $adi,0
     ldl 4
     ldl 12
     adi 8
     lol 0
     sti 8
     lol 0
     ret 4
     end

and called them from C like

    typedef struct { int l; int h; } q;
    q ngi(q);
    q adi(q, q);
2019-08-20 13:38:18 -04:00
..
adi.s
and.s
blm.s
build.lua Experiment with 8-byte integers in ncg i386. 2019-08-20 13:38:18 -04:00
cii.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
cms.s
com.s
csa4.s
csb4.s
cuu.s
dup.s
dvi.s
dvi8.s Experiment with 8-byte integers in ncg i386. 2019-08-20 13:38:18 -04:00
dvu.s
error.s use pusha and popa instructions, and on the proper place 1989-02-08 15:47:22 +00:00
exg.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
fat.s No system-calls from libem 1992-06-30 11:39:12 +00:00
fp8087.s Header --> Id 1994-06-24 14:02:31 +00:00
gto.s
iaar.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
ilar.s
inn.s
ior.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
isar.s
lar4.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
LIST No system-calls from libem 1992-06-30 11:39:12 +00:00
loi.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
mli.s
mli8.s Experiment with 8-byte integers in ncg i386. 2019-08-20 13:38:18 -04:00
mon.s No system-calls from libem 1992-06-30 11:39:12 +00:00
ngi.s
nop.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
print.s New installation mechanism 1991-09-02 15:08:48 +00:00
rck.s
rmi.s
rmu.s
rol.s
ror.s
sar4.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
sbi.s
set.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
sli.s
sri.s
sti.s many fixes, found by actually running the code 1989-10-10 11:38:18 +00:00
strhp.s No system-calls from libem 1992-06-30 11:39:12 +00:00
trp.s No system-calls from libem 1992-06-30 11:39:12 +00:00
unknown.s
xor.s