Initial revision
authorduk <none@none>
Fri, 18 Jan 1985 14:30:03 +0000 (14:30 +0000)
committerduk <none@none>
Fri, 18 Jan 1985 14:30:03 +0000 (14:30 +0000)
70 files changed:
mach/vax4/libem/aar4.s [new file with mode: 0644]
mach/vax4/libem/adf.s [new file with mode: 0644]
mach/vax4/libem/adi.s [new file with mode: 0644]
mach/vax4/libem/and.s [new file with mode: 0644]
mach/vax4/libem/ass.s [new file with mode: 0644]
mach/vax4/libem/bls.s [new file with mode: 0644]
mach/vax4/libem/cff.s [new file with mode: 0644]
mach/vax4/libem/cfi.s [new file with mode: 0644]
mach/vax4/libem/cfu.s [new file with mode: 0644]
mach/vax4/libem/cif.s [new file with mode: 0644]
mach/vax4/libem/cii.s [new file with mode: 0644]
mach/vax4/libem/cmand.s [new file with mode: 0644]
mach/vax4/libem/cmf.s [new file with mode: 0644]
mach/vax4/libem/cmi.s [new file with mode: 0644]
mach/vax4/libem/cms.s [new file with mode: 0644]
mach/vax4/libem/cmu.s [new file with mode: 0644]
mach/vax4/libem/com.s [new file with mode: 0644]
mach/vax4/libem/csa4.s [new file with mode: 0644]
mach/vax4/libem/csb4.s [new file with mode: 0644]
mach/vax4/libem/csx.s [new file with mode: 0644]
mach/vax4/libem/cuf.s [new file with mode: 0644]
mach/vax4/libem/cui.s [new file with mode: 0644]
mach/vax4/libem/cuu.s [new file with mode: 0644]
mach/vax4/libem/dus.s [new file with mode: 0644]
mach/vax4/libem/dvf.s [new file with mode: 0644]
mach/vax4/libem/dvi.s [new file with mode: 0644]
mach/vax4/libem/dvu.s [new file with mode: 0644]
mach/vax4/libem/dvu4.s [new file with mode: 0644]
mach/vax4/libem/exg.s [new file with mode: 0644]
mach/vax4/libem/fat.s [new file with mode: 0644]
mach/vax4/libem/fef.s [new file with mode: 0644]
mach/vax4/libem/fif.s [new file with mode: 0644]
mach/vax4/libem/gto.s [new file with mode: 0644]
mach/vax4/libem/inn.s [new file with mode: 0644]
mach/vax4/libem/ior.s [new file with mode: 0644]
mach/vax4/libem/lar4.s [new file with mode: 0644]
mach/vax4/libem/los.s [new file with mode: 0644]
mach/vax4/libem/lpb.s [new file with mode: 0644]
mach/vax4/libem/lxa.s [new file with mode: 0644]
mach/vax4/libem/lxl.s [new file with mode: 0644]
mach/vax4/libem/mlf.s [new file with mode: 0644]
mach/vax4/libem/mli.s [new file with mode: 0644]
mach/vax4/libem/mon.s [new file with mode: 0644]
mach/vax4/libem/ngf.s [new file with mode: 0644]
mach/vax4/libem/ngi.s [new file with mode: 0644]
mach/vax4/libem/nop.s [new file with mode: 0644]
mach/vax4/libem/print.s [new file with mode: 0644]
mach/vax4/libem/rck.s [new file with mode: 0644]
mach/vax4/libem/rck4.s [new file with mode: 0644]
mach/vax4/libem/rmi.s [new file with mode: 0644]
mach/vax4/libem/rmu.s [new file with mode: 0644]
mach/vax4/libem/rmu4.s [new file with mode: 0644]
mach/vax4/libem/rol.s [new file with mode: 0644]
mach/vax4/libem/ror.s [new file with mode: 0644]
mach/vax4/libem/sar4.s [new file with mode: 0644]
mach/vax4/libem/sbf.s [new file with mode: 0644]
mach/vax4/libem/sbi.s [new file with mode: 0644]
mach/vax4/libem/sbs.s [new file with mode: 0644]
mach/vax4/libem/set.s [new file with mode: 0644]
mach/vax4/libem/sig.s [new file with mode: 0644]
mach/vax4/libem/sim.s [new file with mode: 0644]
mach/vax4/libem/sli.s [new file with mode: 0644]
mach/vax4/libem/sri.s [new file with mode: 0644]
mach/vax4/libem/sru.s [new file with mode: 0644]
mach/vax4/libem/strhp.s [new file with mode: 0644]
mach/vax4/libem/strlb.s [new file with mode: 0644]
mach/vax4/libem/sts.s [new file with mode: 0644]
mach/vax4/libem/trp.s [new file with mode: 0644]
mach/vax4/libem/xar.s [new file with mode: 0644]
mach/vax4/libem/xor.s [new file with mode: 0644]

diff --git a/mach/vax4/libem/aar4.s b/mach/vax4/libem/aar4.s
new file mode 100644 (file)
index 0000000..0aa65ee
--- /dev/null
@@ -0,0 +1,11 @@
+        # $Header$
+.globl  .aar4
+
+.aar4:
+       movl    (sp)+,r2
+       movl    (sp)+,r0
+       movl    8(r0),r1        # elementsize in r1
+       subl3   (r0),(sp)+,r0
+       mull2   r1,r0
+       addl2   (sp)+,r0
+       jmp     (r2)
diff --git a/mach/vax4/libem/adf.s b/mach/vax4/libem/adf.s
new file mode 100644 (file)
index 0000000..56cf9c6
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .adf
+
+.adf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       addf2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       addd2   (sp)+,(sp)
+       jmp     (r1)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/adi.s b/mach/vax4/libem/adi.s
new file mode 100644 (file)
index 0000000..8956e33
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .adi
+
+.adi:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       addl2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/and.s b/mach/vax4/libem/and.s
new file mode 100644 (file)
index 0000000..a9a01ee
--- /dev/null
@@ -0,0 +1,13 @@
+        # $Header$
+.globl .and
+
+       # bytes in r0
+.and:
+       movl    (sp)+,r3
+       addl3   r0,sp,r1
+       ashl    $-2,r0,r0
+L1:
+       mcoml   (sp)+,r2
+       bicl2   r2,(r1)+
+       sobgtr  r0,L1
+       jmp     (r3)
diff --git a/mach/vax4/libem/ass.s b/mach/vax4/libem/ass.s
new file mode 100644 (file)
index 0000000..d4ecf43
--- /dev/null
@@ -0,0 +1,15 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .ass
+
+.ass:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0
+       addl2   r0,sp
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/bls.s b/mach/vax4/libem/bls.s
new file mode 100644 (file)
index 0000000..fee9628
--- /dev/null
@@ -0,0 +1,28 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .bls
+
+.bls:
+       movl    (sp)+,r3
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0        # number of bytes in r0
+       movl    (sp)+,r1        # addresses in r1, r2
+       movl    (sp)+,r2
+       blbc    r0,L1
+       movb    (r2)+,(r1)+
+L1:
+       bbc     $1,r0,L2
+       movw    (r2)+,(r1)+
+L2:
+       ashl    $-2,r0,r0
+       beql    L4
+L3:
+       movl    (r2)+,(r1)+
+       sobgtr  r0,L3
+L4:
+       jmp     (r3)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cff.s b/mach/vax4/libem/cff.s
new file mode 100644 (file)
index 0000000..9ec1cda
--- /dev/null
@@ -0,0 +1,32 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cff
+
+.cff:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Ldtd
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lddf
+       jmp     (r1)
+Lddf:
+       cmpl    r0,$8
+       bneq    Lerr
+       cvtdf   (sp)+,-(sp)
+       jmp     (r1)
+Ldtd:
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lddd
+       cvtfd   (sp)+,-(sp)
+       jmp     (r1)
+Lddd:
+       cmpl    r0,$8
+       bneq    Lerr
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cfi.s b/mach/vax4/libem/cfi.s
new file mode 100644 (file)
index 0000000..6d516fc
--- /dev/null
@@ -0,0 +1,23 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .cfi
+
+.cfi:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lddl
+       cvtfl   (sp)+,-(sp)
+       jmp     (r1)
+Lddl:
+       cmpl    r0,$8
+       bneq    Lerr
+       cvtdl   (sp)+,-(sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cfu.s b/mach/vax4/libem/cfu.s
new file mode 100644 (file)
index 0000000..880b365
--- /dev/null
@@ -0,0 +1,36 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cfu
+
+.cfu:
+       movl    (sp)+,r2
+       movpsl  r1
+       bicl2   $~040,r1
+       bicpsw  $040            # integer overflow traps must be ignored
+       movl    (sp)+,r0
+       cmpl    (sp),$4
+       bneq    Lddt
+       tstl    (sp)+
+       tstf    (sp)
+       bgeq    L1
+       mnegf   (sp),(sp)
+L1:
+       cvtfl   (sp)+,-(sp)
+L2:
+       cmpl    r0,$4
+       bneq    Lerr
+       bispsw  r1              # restore trap enable bit
+       jmp     (r2)
+Lddt:
+       cmpl    (sp)+,$8
+       bneq    Lerr
+       tstd    (sp)
+       bgeq    L3
+       mnegd   (sp),(sp)
+L3:
+       cvtdl   (sp)+,-(sp)
+       brb     L2
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cif.s b/mach/vax4/libem/cif.s
new file mode 100644 (file)
index 0000000..9533b15
--- /dev/null
@@ -0,0 +1,26 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .cif
+
+.cif:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Ldbl
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lerr
+       cvtlf   (sp)+,-(sp)
+       jmp     (r1)
+Ldbl:
+       cmpl    r0,$8
+       bneq    Lerr
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lerr
+       cvtld   (sp)+,-(sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cii.s b/mach/vax4/libem/cii.s
new file mode 100644 (file)
index 0000000..b86db55
--- /dev/null
@@ -0,0 +1,24 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .cii
+
+.cii:
+       movl    (sp)+, r1
+       movl    (sp)+, r0
+       cmpl    (sp), $1
+       beql    Lfrom1
+       cmpl    (sp), $2
+       beql    Lfrom2
+       cmpl    (sp)+, $4
+       bgtr    Lerr
+       jmp     (r1)
+Lfrom1:
+       cvtbw   4(sp), 4(sp)
+Lfrom2:
+       tstl    (sp)+
+       cvtwl   (sp), (sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cmand.s b/mach/vax4/libem/cmand.s
new file mode 100644 (file)
index 0000000..ea9942b
--- /dev/null
@@ -0,0 +1,13 @@
+        # $Header$
+.globl .cmand
+
+       # bytes in r0
+
+.cmand:
+       movl    (sp)+,r2
+       addl3   r0,sp,r1
+       ashl    $-2,r0,r0
+L1:
+       bicl2   (sp)+,(r1)+
+       sobgtr  r0,L1
+       jmp     (r2)
diff --git a/mach/vax4/libem/cmf.s b/mach/vax4/libem/cmf.s
new file mode 100644 (file)
index 0000000..0646411
--- /dev/null
@@ -0,0 +1,29 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cmf
+
+.cmf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       clrl    r0
+       cmpf    (sp)+,(sp)+
+       brb     L3
+L1:
+       cmpl    r0,$8
+       bneq    Lerr
+       clrl    r0
+       cmpd    (sp)+,(sp)+
+L3:
+       beql    L2
+       bgtr    L4
+       incl    r0
+       brb     L2
+L4:
+       decl    r0
+L2:
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cmi.s b/mach/vax4/libem/cmi.s
new file mode 100644 (file)
index 0000000..81b0973
--- /dev/null
@@ -0,0 +1,22 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cmi
+
+.cmi:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    err
+       clrl    r0
+       cmpl    (sp)+,(sp)+
+       beql    L1
+       bgtr    L2
+       incl    r0
+       brb     L1
+L2:
+       decl    r0
+L1:
+       jmp     (r1)
+err:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cms.s b/mach/vax4/libem/cms.s
new file mode 100644 (file)
index 0000000..fa74c34
--- /dev/null
@@ -0,0 +1,16 @@
+        # $Header$
+.globl .cms
+
+       # bytes in r0
+.cms:
+       movl    (sp)+,r3
+       addl3   sp,r0,r1
+       addl3   r1,r0,r2
+       ashl    $-2,r0,r0
+L1:
+       cmpl    (sp)+,(r1)+
+       bneq    L2
+       sobgtr  r0,L1
+L2:
+       movl    r2,sp
+       jmp     (r3)
diff --git a/mach/vax4/libem/cmu.s b/mach/vax4/libem/cmu.s
new file mode 100644 (file)
index 0000000..88554d1
--- /dev/null
@@ -0,0 +1,22 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cmu
+
+.cmu:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    Lerr
+       clrl    r0
+       cmpl    (sp)+,(sp)+
+       beqlu   L1
+       bgtru   L2
+       incl    r0
+       brb     L1
+L2:
+       decl    r0
+L1:
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/com.s b/mach/vax4/libem/com.s
new file mode 100644 (file)
index 0000000..5ce26e7
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+.globl  .com
+
+       # bytes in r0
+.com:
+       movl    (sp)+,r2
+       movl    sp,r1
+       ashl    $-2,r0,r0
+L1:
+       mcoml   (r1),(r1)+
+       sobgtr  r0,L1
+       jmp     (r2)
diff --git a/mach/vax4/libem/csa4.s b/mach/vax4/libem/csa4.s
new file mode 100644 (file)
index 0000000..1a85359
--- /dev/null
@@ -0,0 +1,21 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .csa4
+
+.csa4:
+       movl    (sp)+,r0        # descriptor address
+       movl    (sp)+,r1        # index
+       movl    (r0)+,r2        # default
+       subl2   (r0)+,r1
+       cmpl    (r0)+,r1
+       blssu   L1
+       movl    (r0)[r1],r1
+       bneq    L2
+L1:
+       movl    r2,r1
+       bneq    L2
+       pushl   $ECASE
+       jmp     .fat
+L2:
+       jmp     (r1)
diff --git a/mach/vax4/libem/csb4.s b/mach/vax4/libem/csb4.s
new file mode 100644 (file)
index 0000000..f5e8c5d
--- /dev/null
@@ -0,0 +1,29 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .csb4
+
+.csb4:
+       movl    (sp)+,r0        # descriptor address
+       movl    (sp)+,r1        # index
+       pushl   r4              # Save r4
+       movl    (r0)+,r4        # default
+       movl    (r0)+,r2        # number of cases
+L1:
+       decl    r2
+       blss    L2
+       movl    (r0)+,r3
+       cmpl    r1,r3
+       beql    Lfound
+       tstl    (r0)+           # useless address
+       brb     L1
+Lfound:
+       movl    (r0)+,r4
+L2:
+       movl    r4,r0
+       beql    a3
+       movl    (sp)+,r4        # Restore r4
+       jmp     (r0)
+a3:
+       pushl   $ECASE
+       jmp     .fat
diff --git a/mach/vax4/libem/csx.s b/mach/vax4/libem/csx.s
new file mode 100644 (file)
index 0000000..442a2a4
--- /dev/null
@@ -0,0 +1,20 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .csa
+
+.csa:
+       cmpl    r0,$4
+       bneq    Lillins
+       jmp     .csa4
+
+.globl .csb
+
+.csb:
+       cmpl    r0,$4
+       bneq    Lillins
+       jmp     .csb4
+
+Lillins:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/cuf.s b/mach/vax4/libem/cuf.s
new file mode 100644 (file)
index 0000000..bc673ca
--- /dev/null
@@ -0,0 +1,33 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cuf
+
+.cuf:
+       movl    (sp)+,r2
+       movl    (sp)+,r0
+       movl    (sp)+,r1
+       cmpl    r1,$4
+       bneq    Lerr
+       cmpl    r0,$4
+       bneq    Ldld
+       cvtlf   (sp)+,-(sp)
+       bgeq    Lout
+       addf2   Ltwo32f,(sp)
+Lout:
+       jmp     (r2)
+Ldld:
+       cmpl    r0,$8
+       bneq    Lerr
+       cvtld   (sp)+,-(sp)
+       bgeq    Lout
+       addd2   Ltwo32F,(sp)
+       jmp     (r2)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
+.data
+Ltwo32f:
+       .float  0f4294967296.0
+Ltwo32F:
+       .double 0f4294967296.0
diff --git a/mach/vax4/libem/cui.s b/mach/vax4/libem/cui.s
new file mode 100644 (file)
index 0000000..1fb06b8
--- /dev/null
@@ -0,0 +1,24 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cui
+
+.cui:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0
+       cmpl    r0,$4
+       bneq    Lerr
+       tstl    (sp)
+       bgeq    L1
+       jbr     Liovfl
+L1:
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
+Liovfl:
+       pushl   $EIOVFL
+       jmp     .trp
diff --git a/mach/vax4/libem/cuu.s b/mach/vax4/libem/cuu.s
new file mode 100644 (file)
index 0000000..da46625
--- /dev/null
@@ -0,0 +1,24 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .cuu
+
+.cuu:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    (sp),$1
+       beql    Lfrom1
+       cmpl    (sp),$2
+       beql    Lfrom2
+       cmpl    (sp)+, $4
+       bneq    Lerr
+       jmp     (r1)
+Lfrom1:
+       movzbw  4(sp), 4(sp)
+Lfrom2:
+       tstl    (sp)+
+       movzwl  (sp), (sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/dus.s b/mach/vax4/libem/dus.s
new file mode 100644 (file)
index 0000000..e3fd7b8
--- /dev/null
@@ -0,0 +1,15 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .dus
+
+.dus:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0
+       pushl   r1
+       jmp     .dup
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/dvf.s b/mach/vax4/libem/dvf.s
new file mode 100644 (file)
index 0000000..b4917ff
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .dvf
+
+.dvf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       divf2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       divd2   (sp)+,(sp)
+       jmp     (r1)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/dvi.s b/mach/vax4/libem/dvi.s
new file mode 100644 (file)
index 0000000..d64ae99
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .dvi
+
+.dvi:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       divl2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/dvu.s b/mach/vax4/libem/dvu.s
new file mode 100644 (file)
index 0000000..800860f
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .dvu
+
+.dvu:
+       cmpl    r0,$4
+       bneq    Lerr
+       jmp     .dvu4
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/dvu4.s b/mach/vax4/libem/dvu4.s
new file mode 100644 (file)
index 0000000..0fdf137
--- /dev/null
@@ -0,0 +1,21 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .dvu4
+
+.dvu4:
+       movl    (sp)+,r3
+       movl    (sp)+,r2
+       blss    L1
+       movl    (sp)+,r0
+       clrl    r1
+       ediv    r2,r0,r0,r1
+       jmp     (r3)
+L1:
+       cmpl    (sp)+,r2
+       bgequ   L2
+       clrl    r0
+       jmp     (r3)
+L2:
+       movl    $1,r0
+       jmp     (r3)
diff --git a/mach/vax4/libem/exg.s b/mach/vax4/libem/exg.s
new file mode 100644 (file)
index 0000000..b316064
--- /dev/null
@@ -0,0 +1,18 @@
+        # $Header$
+.globl .exg
+
+       # bytes in r0
+.exg:
+       movl    (sp)+,r3
+       addl3   sp,r0,r2
+       addl2   r0,r2
+       ashl    $-2,r0,r1
+L1:
+       movl    -(r2),-(sp)
+       sobgtr  r1,L1
+       addl3   r0,r2,r1
+L2:
+       movw    -(r2),-(r1)
+       sobgtr  r0,L2
+       movl    r1,sp
+       jmp     (r3)
diff --git a/mach/vax4/libem/fat.s b/mach/vax4/libem/fat.s
new file mode 100644 (file)
index 0000000..9ab4a93
--- /dev/null
@@ -0,0 +1,15 @@
+        # $Header$
+.globl .fat
+
+.fat:
+       pushl   (sp)
+       jsb     .trp
+       movl    $L1,ap
+       movl    (sp)+,6(ap)
+       chmk    (ap)+
+       halt
+
+       .data
+L1:    .word   1
+       .long   1
+       .long   0
diff --git a/mach/vax4/libem/fef.s b/mach/vax4/libem/fef.s
new file mode 100644 (file)
index 0000000..6c7cba0
--- /dev/null
@@ -0,0 +1,28 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .fef
+
+.fef:
+       movl    (sp)+,r3
+       cmpl    r0,$4
+       bneq    L1
+       movf    (sp)+,r0
+       jsb     Lhulp
+       movf    r0,-(sp)
+       jmp     (r3)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       movd    (sp)+,r0
+       jsb     Lhulp
+       movd    r0,-(sp)
+       jmp     (r3)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
+Lhulp:
+       extzv   $7,$8,r0,r2
+       subl3   $128,r2,-(sp)
+       insv    $128,$7,$8,r0
+       rsb
diff --git a/mach/vax4/libem/fif.s b/mach/vax4/libem/fif.s
new file mode 100644 (file)
index 0000000..fc56abe
--- /dev/null
@@ -0,0 +1,23 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .fif
+
+.fif:
+       movl    (sp)+,r2
+       cmpl    r0,$4
+       bneq    L1
+       mulf3   (sp)+,(sp)+,r0
+       emodf   r0,$0,$0f1.0,r1,-(sp)
+       subf3   (sp),r0,-(sp)
+       jmp     (r2)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       muld3   (sp)+,(sp)+,r0
+       emodd   r0,$0,$0f1.0,r0,-(sp)
+       subd3   (sp),r0,-(sp)
+       jmp     (r2)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/gto.s b/mach/vax4/libem/gto.s
new file mode 100644 (file)
index 0000000..98b312d
--- /dev/null
@@ -0,0 +1,17 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .strlb
+.globl .gto
+       # Nonlocal goto.
+       # On the stack is a pointer to a block containing :
+       # 1. the new local base         (ptr+8)
+       # 2. the new stack pointer      (ptr+4)
+       # 3. the new program counter    (ptr)
+.gto:
+       movl    (sp)+,r2
+       movl    4(r2),sp        # Store new stack pointer
+       pushl   (r2)            # Push target address
+       pushl   8(r2)           # Push new local base
+       jsb     .strlb          # Store in fp, compute ap
+       rsb
diff --git a/mach/vax4/libem/inn.s b/mach/vax4/libem/inn.s
new file mode 100644 (file)
index 0000000..c72be1a
--- /dev/null
@@ -0,0 +1,18 @@
+        # $Header$
+.globl .inn
+
+       # bytes in r0
+.inn:
+       movl    (sp)+,r3
+       movl    (sp)+,r1
+       ashl    $3,r0,r2        # nr of bits in r2
+       cmpl    r1,r2
+       bgequ   L2
+       bbc     r1,(sp),L2
+       movl    $1,r1
+L1:
+       addl2   r0,sp
+       jmp     (r3)
+L2:
+       clrl    r1
+       brb     L1
diff --git a/mach/vax4/libem/ior.s b/mach/vax4/libem/ior.s
new file mode 100644 (file)
index 0000000..55968dc
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+.globl .ior
+
+       # bytes in r0
+.ior:
+       movl    (sp)+,r2
+       addl3   r0,sp,r1
+       ashl    $-2,r0,r0
+L1:
+       bisl2   (sp)+,(r1)+
+       sobgtr  r0,L1
+       jmp     (r2)
diff --git a/mach/vax4/libem/lar4.s b/mach/vax4/libem/lar4.s
new file mode 100644 (file)
index 0000000..69ce409
--- /dev/null
@@ -0,0 +1,26 @@
+        # $Header$
+.globl  .lar4
+
+.lar4:
+       movl    (sp)+,r2
+       movl    (sp)+,r0
+       movl    8(r0),r1
+       subl2   (r0),(sp)
+       mull3   (sp)+,r1,r0
+       addl2   (sp)+,r0
+       addl2   r1,r0
+       cmpl    r1,$1
+       bgtr    L3
+       movzbl  -(r0),-(sp)
+       jmp     (r2)
+L3:
+       cmpl    r1,$2
+       bgtr    L2
+       movzwl  -(r0),-(sp)
+       jmp     (r2)
+L2:
+       ashl    $-2,r1,r1
+L1:
+       movl    -(r0),-(sp)
+       sobgtr  r1,L1
+       jmp     (r2)
diff --git a/mach/vax4/libem/los.s b/mach/vax4/libem/los.s
new file mode 100644 (file)
index 0000000..63148c5
--- /dev/null
@@ -0,0 +1,30 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .los
+
+.los:
+       movl    (sp)+,r2
+       cmpl    r0,$4
+       beql    L1
+       pushl   $EILLINS
+       jmp     .fat
+L1:
+       movl    (sp)+,r0        # nbytes in r0
+       movl    (sp)+,r1        # address in r1
+       cmpl    r0,$1
+       beql    L2
+       cmpl    r0,$2
+       beql    L3
+       addl2   r0,r1
+       ashl    $-2,r0,r0
+L4:
+       movl    -(r1),-(sp)
+       sobgtr  r0,L4
+       jmp     (r2)
+L2:
+       cvtbl   (r1),-(sp)
+       jmp     (r2)
+L3:
+       cvtwl   (r1),-(sp)
+       jmp     (r2)
diff --git a/mach/vax4/libem/lpb.s b/mach/vax4/libem/lpb.s
new file mode 100644 (file)
index 0000000..4150bb4
--- /dev/null
@@ -0,0 +1,18 @@
+        # $Header$
+.globl .lpb
+
+.lpb:
+       cmpl    r0,fp
+       bneq    L1
+       moval   4(ap),r0
+       rsb
+L1:
+       movl    fp,r1
+L2:
+       cmpl    12(r1),r0
+       beql    L3
+       movl    12(r1),r1
+       jbr     L2
+L3:
+       addl3   $4,8(r1),r0     # Argument Base = ap + 4
+       rsb
diff --git a/mach/vax4/libem/lxa.s b/mach/vax4/libem/lxa.s
new file mode 100644 (file)
index 0000000..537c287
--- /dev/null
@@ -0,0 +1,7 @@
+        # $Header$
+.globl  .lxa
+
+.lxa:
+       jsb     .lxl    # Find local base
+       jsb     .lpb    # Convert to argument base
+       rsb
diff --git a/mach/vax4/libem/lxl.s b/mach/vax4/libem/lxl.s
new file mode 100644 (file)
index 0000000..e42adfd
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+.globl  .lxl
+
+       # nlevels in r0 (>=2)
+.lxl:
+       pushl   r0
+       decl    (sp)
+       movl    4(ap),r0
+L1:
+       jsb     .lpb
+       movl    (r0),r0
+       sobgtr  (sp),L1
+       tstl    (sp)+
+       rsb
diff --git a/mach/vax4/libem/mlf.s b/mach/vax4/libem/mlf.s
new file mode 100644 (file)
index 0000000..f1593dc
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .mlf
+
+.mlf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       mulf2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       muld2   (sp)+,(sp)
+       jmp     (r1)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/mli.s b/mach/vax4/libem/mli.s
new file mode 100644 (file)
index 0000000..e0b918b
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .mli
+
+.mli:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       mull2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/mon.s b/mach/vax4/libem/mon.s
new file mode 100644 (file)
index 0000000..b9b3bf5
--- /dev/null
@@ -0,0 +1,344 @@
+        # $Header$
+#include "system.h"
+#include "em_abs.h"
+#define MOVL   movl    (sp)+,(ap)+
+#define MOVQ   movq    (sp)+,(ap)+
+
+.set sigvec,108
+
+.globl .mon
+
+.mon:
+       movl    (sp)+,r2        # return address in r2
+       movl    (sp)+,r0        # monitor call in r0
+       movl    ap,r3
+       movl    $args,ap
+       cvtlw   r0,(ap)+
+       cmpl    r0,$61
+       jgtru   Lbadmon
+       ashl    $2,r0,r0
+       jmp     *L0(r0)
+.data
+.align 2
+L0:
+#ifndef BSD41a
+.long  Lbadmon,        Lexit,          Lfork,          Lread,          Lwrite
+.long  Lopen,          Lclose,         Lwait,          Lcreat,         Llink
+.long  Lunlink,        Lbadmon,        Lchdir,         Lbadmon,        Lbadmon
+.long  Lchmod,         Lchown,         Lbadmon,        Lstat,          Llseek
+.long  Lgetpid,        Lbadmon,        Lbadmon,        Lbadmon,        Lgetuid
+.long  Lbadmon,        Lptrace,        Lalarm,         Lfstat,         Lpause
+.long  Lutime,         Lbadmon,        Lbadmon,        Laccess,        Lnice
+.long  Lbadmon,        Lsync,          Lkill,          Lbadmon,        Lbadmon
+.long  Lbadmon,        Ldup,           Lpipe,          Lbadmon,        Lprofil
+.long  Lbadmon,        Lbadmon,        Lgetgid,        Lsigtrp,        Lbadmon
+.long  Lbadmon,        Lacct,          Lbadmon,        Lbadmon,        Lioctl
+.long  Lbadmon,        Lbadmon,        Lbadmon,        Lbadmon,        Lexece
+.long  Lumask,         Lchroot
+#else
+.long  Lbadmon,        Lexit,          Lfork,          Lread,          Lwrite
+.long  Lopen,          Lclose,         Lwait,          Lcreat,         Llink
+.long  Lunlink,        Lbadmon,        Lchdir,         Lbadmon,        Lmknod
+.long  Lchmod,         Lchown,         Lbadmon,        Lstat,          Llseek
+.long  Lgetpid,        Lmount,         Lumount,        Lsetuid,        Lgetuid
+.long  Lstime,         Lptrace,        Lalarm,         Lfstat,         Lpause
+.long  Lutime,         Lbadmon,        Lbadmon,        Laccess,        Lnice
+.long  Lftime,         Lsync,          Lkill,          Lbadmon,        Lbadmon
+.long  Lbadmon,        Ldup,           Lpipe,          Ltimes,         Lprofil
+.long  Lbadmon,        Lsetgid,        Lgetgid,        Lsigtrp,        Lbadmon
+.long  Lbadmon,        Lacct,          Lbadmon,        Llock,          Lioctl
+.long  Lbadmon,        Lmpxall,        Lbadmon,        Lbadmon,        Lexece
+.long  Lumask,         Lchroot
+#endif
+.text
+
+       # Each system call first stores its number of arguments, then the
+       # arguments themselves.
+       # The system calls are grouped according to their number of arguments
+       # and their results.
+       # Le*: an errornumber is expected
+       # L*r0*: the value of r0 is expected
+       # L*r1*: the value of r1 is expected
+       # Lnores: no results expected
+
+       # 0 arguments.
+Lsync:
+Lpause:
+Lpause:
+       clrl    (ap)+
+Lnores:
+       jsb     syscall
+       movl    r3,ap
+       jmp     (r2)
+Lgetpid:
+       clrl    (ap)+
+Lr0:
+       jsb     syscall
+       pushl   r0
+       jmp     (r2)
+Lgetuid:
+Lgetgid:
+       clrl    (ap)+
+Lr0r1:
+       jsb     syscall
+       pushl   r0
+       pushl   r1
+       jmp     (r2)
+Lpipe:
+Lwait: 
+Lfork:
+       clrl    (ap)+
+Ler0r1:
+       jsb     syscall
+       pushl   r0
+       pushl   r1
+       clrl    -(sp)
+       jmp     (r2)
+
+       # 1 argument.
+Lexit:
+Ltimes:
+       cvtbl   $1,(ap)+
+       MOVL
+       jbr     Lnores
+Lclose:        
+Lunlink:       
+Lchdir:
+Lumount:
+Lsetuid:
+Lstime:
+Lnice:
+Lftime:
+Lsetgid:
+Lacct:
+Llock:
+Lchroot:
+       cvtbl   $1,(ap)+
+       MOVL
+Le:
+       jsb     syscall
+       clrl    -(sp)
+       jmp     (r2)
+Lalarm:
+Lumask:
+       cvtbl   $1,(ap)+
+       MOVL
+       jbr     Lr0
+
+       # 2 arguments.
+Llink:
+Lchmod:        
+Lstat: 
+Lfstat:
+Lutime:
+Laccess:
+Lkill:
+Lmpxall:
+       cvtbl   $2,(ap)+
+       MOVQ
+       jbr     Le
+Ldup:
+       cvtbl   $2,(ap)+
+       MOVQ
+Ler0:
+       jsb     syscall
+       pushl   r0
+       clrl    -(sp)
+       jmp     (r2)
+
+       # 3 arguments.
+Lioctl:
+Lexece:
+Lmknod:
+Lchown:        
+Lmount:
+       cvtbl   $3,(ap)+
+       MOVL
+       MOVQ
+       jbr     Le
+Llseek:
+Lread:
+Lwrite:
+       cvtbl   $3,(ap)+
+       MOVL
+       MOVQ
+       jbr     Ler0
+
+       # 4 arguments.
+Lprofil:
+       cvtbl   $4,(ap)+
+       MOVQ
+       MOVQ
+       jbr     Lnores
+Lptrace:
+       cvtbl   $4,(ap)+
+       MOVQ
+       MOVQ
+       jbr     Ler0
+
+Lopen:
+#ifndef BSD41a
+       # The old open(name, mode) system call is simulated by
+       # open(name, mode, 0).
+       cvtbl   $3,(ap)+
+#else
+       cvtbl   $2,(ap)+
+#endif
+       MOVQ
+#ifndef BSD41a
+       clrl    (ap)+
+#endif
+       jbr     Ler0
+Lcreat:        
+#ifndef BSD41a
+       # The old creat(name, mode) system call is simulated by
+       # open(name, O_WRONLY | O_CREAT | O_TRUNC, mode).
+       cvtbl   $5,-2(ap)
+       cvtbl   $3,(ap)+
+#else
+       cvtbl   $2,(ap)+
+#endif
+       MOVL
+#ifndef BSD41a
+       movl    $0x601,(ap)+
+#endif
+       MOVL
+       jbr     Ler0
+
+syscall:
+       movl    $args,ap
+       chmk    (ap)+
+       bcc     L1
+       cvtwl   r0,(sp)         # Push the error returned twice,
+       cvtwl   r0,-(sp)        # overwrite the return address
+       jmp     (r2)
+L1:
+       rsb
+Lbadmon:
+       pushl   $EBADMON
+       jmp     .fat
+Lsigtrp:
+       movl    4(sp),r1        # Sig in r1
+       movl    (sp)+,(sp)      # Trapno on top of stack
+       cmpl    r1,$16
+       bgtru   badsig
+       tstl    r1
+       beql    badsig
+#ifdef BSD42
+       movl    $3,(ap)+        # sigvec(sig, vec, ovec)
+#else BSD42
+       movl    $2,(ap)+        # signal(sig, func)
+#endif BSD42
+       movl    r1,(ap)+
+       movl    sigadr0 [r1],r0
+       tstl    (sp)
+       blss    L2
+       cmpl    (sp),$252
+       bgtr    badtrp
+       movl    r0,(ap)+
+       brb     sys
+L2:    cmpl    $-3,(sp)
+       bneq    L3
+       movl    $1,(ap)+        # SIG_IGN
+       brb     sys
+L3:    cmpl    $-2,(sp)
+       bneq    badtrp
+       clrl    (ap)+           # SIG_DFL
+sys:
+#ifdef BSD42
+       movl    -(ap),vec       # vec->sv_handler = func
+       movl    $vec,(ap)+
+       movl    $ovec,(ap)+     # Not used.
+#endif BSD42
+       pushl   sigtrp0 [r1]
+       movl    4(sp),sigtrp0 [r1]
+       movl    (sp)+,(sp)      # Old trap number on top of stack.
+       movl    $args,ap
+#ifdef BSD42
+       movw    $sigvec,(ap)
+#endif
+       chmk    (ap)+
+       bcc     L4
+       movl    (sp),sigtrp0 [r1] # Error, reset old trap number.
+       pushl   r0
+       jmp     (r2)
+L4:    clrl    -(sp)
+       jmp     (r2)
+badsig:
+       movl    $-1,(sp)
+       pushl   (sp)
+       jmp     (r2)
+badtrp:
+       movl    sigtrp0 [r1],(sp)
+       pushl   $-1
+       jmp     (r2)
+
+sigs:
+       .word 0x0000
+       # Routine to catch signals.
+       pushl   fp
+       movl    12(fp),fp
+       movl    12(fp),fp       # Restore local base, two levels!
+       movl    4(ap),ap
+       pushl   sigtrp0 [ap]
+       jsb     .trp
+       movl    (sp)+,fp
+       ret
+
+.data
+#ifdef BSD42
+vec:
+       .long   0               # sv_handler
+       .long   0               # sv_mask
+       .long   0               # sv_onstack
+ovec:
+       .long   0               # sv_onstack
+       .long   0               # sv_mask
+       .long   0               # sv_onstack
+#endif BSD42
+args:
+       .word   0
+       .long   0
+       .long   0
+       .long   0
+       .long   0
+       .long   0
+       .long   0
+
+sigadr0:
+       .long   0       #0
+       .long   sigs    #1
+       .long   sigs    #2
+       .long   sigs    #3
+       .long   sigs    #4
+       .long   sigs    #5
+       .long   sigs    #6
+       .long   sigs    #7
+       .long   sigs    #8
+       .long   sigs    #9
+       .long   sigs    #10
+       .long   sigs    #11
+       .long   sigs    #12
+       .long   sigs    #13
+       .long   sigs    #14
+       .long   sigs    #15
+       .long   sigs    #16
+
+sigtrp0:
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
+       .long -2
diff --git a/mach/vax4/libem/ngf.s b/mach/vax4/libem/ngf.s
new file mode 100644 (file)
index 0000000..7f33f9d
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .ngf
+
+.ngf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       mnegf   (sp),(sp)
+       jmp     (r1)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       mnegd   (sp),(sp)
+       jmp     (r1)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/ngi.s b/mach/vax4/libem/ngi.s
new file mode 100644 (file)
index 0000000..a43439c
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .ngi
+
+.ngi:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       mnegl   (sp),(sp)
+       jmp     (r1)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/nop.s b/mach/vax4/libem/nop.s
new file mode 100644 (file)
index 0000000..8eb821b
--- /dev/null
@@ -0,0 +1,13 @@
+        # $Header$
+#include "em_abs.h"
+.globl  .nop
+
+.nop:
+       movl    hol0+LINO_AD,r0
+       jsb     printd
+       movb    $011,r0
+       jsb     printc
+       movl    sp,r0
+       jsb     printd
+       movb    $012,r0
+       jmp     printc
diff --git a/mach/vax4/libem/print.s b/mach/vax4/libem/print.s
new file mode 100644 (file)
index 0000000..3f6d56b
--- /dev/null
@@ -0,0 +1,29 @@
+        # $Header$
+.globl  printd
+.globl  printc
+
+printd:
+       clrl    r1
+       ediv    $10,r0,r0,r1
+       beql    L1
+       pushl   r1
+       jsb     printd
+       movl    (sp)+,r1
+L1:
+       addb3   $'0,r1,r0
+
+printc:
+       movb    r0,Lch
+       movl    ap,r2
+       movl    $L9,ap
+       chmk    $4
+       movl    r2,ap
+       rsb
+
+       .data
+L9:
+       .long   3
+       .long   2
+       .long   Lch
+       .long   1
+Lch:     .word   0
diff --git a/mach/vax4/libem/rck.s b/mach/vax4/libem/rck.s
new file mode 100644 (file)
index 0000000..c3dd53d
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .rck
+
+.rck:
+       cmpl    r0,$4
+       bneq    Lerr
+       jmp     .rck4
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/rck4.s b/mach/vax4/libem/rck4.s
new file mode 100644 (file)
index 0000000..874fb38
--- /dev/null
@@ -0,0 +1,17 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .rck4
+
+.rck4:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       cmpl    (sp),(r0)       # compare lower bound
+       blss    Lerr
+       cmpl    (sp),4(r0)      # compare upper bound
+       bgtr    Lerr
+       jmp     (r1)
+Lerr:
+       pushl   r1
+       pushl   $ERANGE
+       jmp     .trp
diff --git a/mach/vax4/libem/rmi.s b/mach/vax4/libem/rmi.s
new file mode 100644 (file)
index 0000000..c2bbd09
--- /dev/null
@@ -0,0 +1,18 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .rmi
+
+.rmi:
+       movl    (sp)+,r3
+       cmpl    r0,$4
+       bneq    L1
+       movl    (sp)+,r2
+       movl    (sp)+,r1
+       ashq    $-32,r0,r0
+       ediv    r2,r0,r1,r0
+       pushl   r0
+       jmp     (r3)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/rmu.s b/mach/vax4/libem/rmu.s
new file mode 100644 (file)
index 0000000..dd7130d
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .rmu
+
+.rmu:
+       cmpl    r0,$4
+       bneq    Lerr
+       jsb     .rmu4
+       pushl   r0
+       rsb
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/rmu4.s b/mach/vax4/libem/rmu4.s
new file mode 100644 (file)
index 0000000..f266f51
--- /dev/null
@@ -0,0 +1,18 @@
+        # $Header$
+.globl  .rmu4
+
+.rmu4:
+       movl    (sp)+,r3
+       movl    (sp)+,r2
+       blss    L1
+       movl    (sp)+,r0
+       clrl    r1
+       ediv    r2,r0,r1,r0
+       jmp     (r3)
+L1:
+       movl    (sp)+,r0
+       cmpl    r0,r2
+       blssu   L2
+       subl2   r2,r0
+L2:
+       jmp     (r3)
diff --git a/mach/vax4/libem/rol.s b/mach/vax4/libem/rol.s
new file mode 100644 (file)
index 0000000..6816cf2
--- /dev/null
@@ -0,0 +1,15 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .rol
+
+.rol:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    Lerr
+       movl    (sp)+,r0
+       rotl    r0,(sp),(sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/ror.s b/mach/vax4/libem/ror.s
new file mode 100644 (file)
index 0000000..8a1c1a6
--- /dev/null
@@ -0,0 +1,15 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .ror
+
+.ror:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    Lerr
+       subl3   (sp)+,$32,r0
+       rotl    r0,(sp),(sp)
+       jmp     (r1)
+Lerr:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/sar4.s b/mach/vax4/libem/sar4.s
new file mode 100644 (file)
index 0000000..80061e2
--- /dev/null
@@ -0,0 +1,26 @@
+        # $Header$
+.globl  .sar4
+
+.sar4:
+       movl    (sp)+,r2
+       movl    (sp)+,r0
+       movl    8(r0),r1
+       subl2   (r0),(sp)
+       movl    (sp)+,r0
+       mull2   r1,r0
+       addl2   (sp)+,r0
+       cmpl    r1,$1
+       bgtr    L3
+       cvtlb   (sp)+,(r0)
+       jmp     (r2)
+L3:
+       cmpl    r1,$2
+       bgtr    L2
+       cvtlw   (sp)+,(r0)
+       jmp     (r2)
+L2:
+       ashl    $-2,r1,r1
+L1:
+       movl    (sp)+,(r0)+
+       sobgtr  r1,L1
+       jmp     (r2)
diff --git a/mach/vax4/libem/sbf.s b/mach/vax4/libem/sbf.s
new file mode 100644 (file)
index 0000000..d886a6d
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sbf
+
+.sbf:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       subf2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       cmpl    r0,$8
+       bneq    L2
+       subd2   (sp)+,(sp)
+       jmp     (r1)
+L2:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/sbi.s b/mach/vax4/libem/sbi.s
new file mode 100644 (file)
index 0000000..5887e2a
--- /dev/null
@@ -0,0 +1,14 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sbi
+
+.sbi:
+       movl    (sp)+,r1
+       cmpl    r0,$4
+       bneq    L1
+       subl2   (sp)+,(sp)
+       jmp     (r1)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/sbs.s b/mach/vax4/libem/sbs.s
new file mode 100644 (file)
index 0000000..4814f1e
--- /dev/null
@@ -0,0 +1,10 @@
+        # $Header$
+.globl .sbs
+
+.sbs:
+       movl    (sp)+,r1
+       subl2   (sp)+,(sp)
+       movl    $4,-(sp)
+       movl    r0,-(sp)
+       movl    r1,-(sp)
+       jmp     .cii
diff --git a/mach/vax4/libem/set.s b/mach/vax4/libem/set.s
new file mode 100644 (file)
index 0000000..77f9370
--- /dev/null
@@ -0,0 +1,24 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .setx
+
+       # bytes in r0
+.setx:
+       movl    (sp)+,r3
+       movl    (sp)+,r1        # bitnumber in r1
+       subl3   r0,sp,r2
+L1:
+       clrl    -(sp)
+       cmpl    sp,r2
+       bgtru   L1
+       ashl    $3,r0,r2        # number of bits in r2
+       cmpl    r1,r2
+       bgequ   L2
+       bbcs    r1,(sp),L3
+L3:
+       jmp     (r3)
+L2:
+       pushl   $ESET
+       jsb     .trp
+       jmp     (r3)
diff --git a/mach/vax4/libem/sig.s b/mach/vax4/libem/sig.s
new file mode 100644 (file)
index 0000000..e2b5866
--- /dev/null
@@ -0,0 +1,9 @@
+        # $Header$
+.globl  .sig
+
+.sig:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       pushl   .trppc
+       movl    r0,.trppc
+       jmp     (r1)
diff --git a/mach/vax4/libem/sim.s b/mach/vax4/libem/sim.s
new file mode 100644 (file)
index 0000000..2a11a71
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+.globl .sim
+
+.sim:
+       movl    (sp)+,r0
+       movl    (sp)+,.trpim    # store ignore mask
+       bbc     $5,.trpim,L3    # floating underflow to be ignored?
+       bicpsw  $0100
+       jmp     (r0)
+L3:
+       bispsw  $0100           # enable underflow trap
+       jmp     (r0)
diff --git a/mach/vax4/libem/sli.s b/mach/vax4/libem/sli.s
new file mode 100644 (file)
index 0000000..4c2fcd1
--- /dev/null
@@ -0,0 +1,16 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sli
+
+.sli:
+       movl    (sp)+,r2
+       cmpl    r0,$4
+       bneq    L1
+       movl    (sp)+,r0
+       movl    (sp)+,r1
+       ashl    r0,r1,-(sp)
+       jmp     (r2)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/sri.s b/mach/vax4/libem/sri.s
new file mode 100644 (file)
index 0000000..d1d7de7
--- /dev/null
@@ -0,0 +1,17 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sri
+
+.sri:
+       movl    (sp)+,r2
+       cmpl    r0,$4
+       bneq    L1
+       movl    (sp)+,r0
+       mnegl   r0,r0
+       movl    (sp)+,r1
+       ashl    r0,r1,-(sp)
+       jmp     (r2)
+L1:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/sru.s b/mach/vax4/libem/sru.s
new file mode 100644 (file)
index 0000000..035690a
--- /dev/null
@@ -0,0 +1,19 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sru
+
+.sru:
+       movl    (sp)+,r3
+       cmpl    r0,$4
+       beql    .sru4
+       pushl   $EILLINS
+       jmp     .fat
+.sru4:
+       movl    (sp)+,r2
+       mnegl   r2,r2
+       movl    (sp)+,r0
+       clrl    r1
+       ashq    r2,r0,r0
+       movl    r0,-(sp)
+       jmp     (r3)
diff --git a/mach/vax4/libem/strhp.s b/mach/vax4/libem/strhp.s
new file mode 100644 (file)
index 0000000..2d68119
--- /dev/null
@@ -0,0 +1,30 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl  .strhp
+
+.strhp:
+       movl    (sp)+,r1
+       movl    (sp)+,r0
+       pushl   r1
+       movl    r0,.reghp
+       cmpl    r0,.hplim
+       blssu   L2
+       addl2   $02000,r0
+       bicl2   $0777,r0
+       movl    r0,.hplim
+       movl    ap,r1
+       movl    $L9,ap
+       chmk    (ap)+
+       bcc     L1
+       pushl   $EHEAP
+       jmp     .fat
+L1:
+       movl    r1,ap
+L2:
+       rsb
+
+       .data
+L9:     .word   17
+       .long   1
+.hplim: .long   _end
diff --git a/mach/vax4/libem/strlb.s b/mach/vax4/libem/strlb.s
new file mode 100644 (file)
index 0000000..463f8bb
--- /dev/null
@@ -0,0 +1,26 @@
+       # $Header$
+.globl .strlb
+       # Store the value that is on the stack in fp.
+       # Compute ap.
+.strlb:
+       movl    (sp)+,r3
+       movl    (sp)+,fp
+       pushl   r3
+       movl    $20,ap          # Compute argumentbase from local base.
+                               # Distance is 5 longwords + the number of
+                               # registers saved.
+       movl    $1,r3           # Now check register save mask
+       movl    $12,r2
+L1:
+       bitl    r3,6(fp)
+       beql    L2
+       addl2   $4,ap           # Add 1 longword for each register saved
+L2:
+       ashl    $1,r3,r3
+       sobgeq  r2,L1
+
+       extzv   $14,$2,6(fp),r3 # Now find out about the stack alignment
+                               # between fp and ap
+       addl2   r3,ap           # add alignment
+       addl2   fp,ap
+       rsb
diff --git a/mach/vax4/libem/sts.s b/mach/vax4/libem/sts.s
new file mode 100644 (file)
index 0000000..ddf01dc
--- /dev/null
@@ -0,0 +1,31 @@
+        # $Header$
+#include "em_abs.h"
+
+.globl .sts
+
+.sts:
+       movl    (sp)+,r2
+       cmpl    r0,$4
+       beql    L1
+       pushl   $EILLINS
+       jmp     .fat
+L1:
+       movl    (sp)+,r0        # number of bytes in r0
+       movl    (sp)+,r1        # address in r1
+       cmpl    r0,$1
+       beql    L3
+       cmpl    r0,$2
+       beql    L4
+       ashl    $-2,r0,r0
+L2:
+       movl    (sp)+,(r1)+
+       sobgtr  r0,L2
+       jmp     (r2)
+L3:
+       movl    (sp)+,r0
+       movb    r0,(r1)
+       jmp     (r2)
+L4:
+       movl    (sp)+,r0
+       movw    r0,(r1)
+       jmp     (r2)
diff --git a/mach/vax4/libem/trp.s b/mach/vax4/libem/trp.s
new file mode 100644 (file)
index 0000000..bf61a13
--- /dev/null
@@ -0,0 +1,26 @@
+        # $Header$
+.globl .trp
+
+.trp:
+       movl    r0,-(sp)
+       movl    8(sp),r0
+       movl    4(sp),8(sp)
+       movl    (sp)+,(sp)
+       cmpl    r0,$16
+       bgequ   L1              # a trapnumber >= 16 cannot be ignored
+       bbc     r0,.trpim,L1
+       movl    (sp)+,r0
+       rsb
+L1:
+       pushr   $017776         # save registers
+       movl    r0,-(sp)        # trapnumber on stack
+       movl    .trppc,r0
+       beql    L2              #is there a user defined traphandler?
+       clrl    .trppc
+       jsb     (r0)            #if so, call it
+       tstl    (sp)+
+       popr    $017776         #restore registers
+       movl    (sp)+,r0
+       rsb
+L2:
+       bpt
diff --git a/mach/vax4/libem/xar.s b/mach/vax4/libem/xar.s
new file mode 100644 (file)
index 0000000..5e55be7
--- /dev/null
@@ -0,0 +1,26 @@
+        # $Header$
+#include "em_abs.h"
+.globl  .lar
+
+.lar:
+       cmpl    r0,$4
+       bneq    Lillins
+       jmp     .lar4
+
+.globl  .sar
+
+.sar:
+       cmpl    r0,$4
+       bneq    Lillins
+       jmp     .sar4
+
+.globl  .aar
+
+.aar:
+       cmpl    r0,$4
+       bneq    Lillins
+       jmp     .aar4
+
+Lillins:
+       pushl   $EILLINS
+       jmp     .fat
diff --git a/mach/vax4/libem/xor.s b/mach/vax4/libem/xor.s
new file mode 100644 (file)
index 0000000..22c0651
--- /dev/null
@@ -0,0 +1,12 @@
+        # $Header$
+.globl .xor
+
+       # bytes in r0
+.xor:
+       movl    (sp)+,r2
+       addl3   r0,sp,r1
+       ashl    $-2,r0,r0
+L1:
+       xorl2   (sp)+,(r1)+
+       sobgtr  r0,L1
+       jmp     (r2)