Initial revision
This commit is contained in:
parent
2d8dcaa2df
commit
8d87404836
70 changed files with 1691 additions and 0 deletions
11
mach/vax4/libem/aar4.s
Normal file
11
mach/vax4/libem/aar4.s
Normal file
|
@ -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)
|
19
mach/vax4/libem/adf.s
Normal file
19
mach/vax4/libem/adf.s
Normal file
|
@ -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
|
14
mach/vax4/libem/adi.s
Normal file
14
mach/vax4/libem/adi.s
Normal file
|
@ -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
|
13
mach/vax4/libem/and.s
Normal file
13
mach/vax4/libem/and.s
Normal file
|
@ -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)
|
15
mach/vax4/libem/ass.s
Normal file
15
mach/vax4/libem/ass.s
Normal file
|
@ -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
|
28
mach/vax4/libem/bls.s
Normal file
28
mach/vax4/libem/bls.s
Normal file
|
@ -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
|
32
mach/vax4/libem/cff.s
Normal file
32
mach/vax4/libem/cff.s
Normal file
|
@ -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
|
23
mach/vax4/libem/cfi.s
Normal file
23
mach/vax4/libem/cfi.s
Normal file
|
@ -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
|
36
mach/vax4/libem/cfu.s
Normal file
36
mach/vax4/libem/cfu.s
Normal file
|
@ -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
|
26
mach/vax4/libem/cif.s
Normal file
26
mach/vax4/libem/cif.s
Normal file
|
@ -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
|
24
mach/vax4/libem/cii.s
Normal file
24
mach/vax4/libem/cii.s
Normal file
|
@ -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
|
13
mach/vax4/libem/cmand.s
Normal file
13
mach/vax4/libem/cmand.s
Normal file
|
@ -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)
|
29
mach/vax4/libem/cmf.s
Normal file
29
mach/vax4/libem/cmf.s
Normal file
|
@ -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
|
22
mach/vax4/libem/cmi.s
Normal file
22
mach/vax4/libem/cmi.s
Normal file
|
@ -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
|
16
mach/vax4/libem/cms.s
Normal file
16
mach/vax4/libem/cms.s
Normal file
|
@ -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)
|
22
mach/vax4/libem/cmu.s
Normal file
22
mach/vax4/libem/cmu.s
Normal file
|
@ -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
|
12
mach/vax4/libem/com.s
Normal file
12
mach/vax4/libem/com.s
Normal file
|
@ -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)
|
21
mach/vax4/libem/csa4.s
Normal file
21
mach/vax4/libem/csa4.s
Normal file
|
@ -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)
|
29
mach/vax4/libem/csb4.s
Normal file
29
mach/vax4/libem/csb4.s
Normal file
|
@ -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
|
20
mach/vax4/libem/csx.s
Normal file
20
mach/vax4/libem/csx.s
Normal file
|
@ -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
|
33
mach/vax4/libem/cuf.s
Normal file
33
mach/vax4/libem/cuf.s
Normal file
|
@ -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
|
24
mach/vax4/libem/cui.s
Normal file
24
mach/vax4/libem/cui.s
Normal file
|
@ -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
|
24
mach/vax4/libem/cuu.s
Normal file
24
mach/vax4/libem/cuu.s
Normal file
|
@ -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
|
15
mach/vax4/libem/dus.s
Normal file
15
mach/vax4/libem/dus.s
Normal file
|
@ -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
|
19
mach/vax4/libem/dvf.s
Normal file
19
mach/vax4/libem/dvf.s
Normal file
|
@ -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
|
14
mach/vax4/libem/dvi.s
Normal file
14
mach/vax4/libem/dvi.s
Normal file
|
@ -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
|
12
mach/vax4/libem/dvu.s
Normal file
12
mach/vax4/libem/dvu.s
Normal file
|
@ -0,0 +1,12 @@
|
|||
# $Header$
|
||||
#include "em_abs.h"
|
||||
|
||||
.globl .dvu
|
||||
|
||||
.dvu:
|
||||
cmpl r0,$4
|
||||
bneq Lerr
|
||||
jmp .dvu4
|
||||
Lerr:
|
||||
pushl $EILLINS
|
||||
jmp .fat
|
21
mach/vax4/libem/dvu4.s
Normal file
21
mach/vax4/libem/dvu4.s
Normal file
|
@ -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)
|
18
mach/vax4/libem/exg.s
Normal file
18
mach/vax4/libem/exg.s
Normal file
|
@ -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)
|
15
mach/vax4/libem/fat.s
Normal file
15
mach/vax4/libem/fat.s
Normal file
|
@ -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
|
28
mach/vax4/libem/fef.s
Normal file
28
mach/vax4/libem/fef.s
Normal file
|
@ -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
|
23
mach/vax4/libem/fif.s
Normal file
23
mach/vax4/libem/fif.s
Normal file
|
@ -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
|
17
mach/vax4/libem/gto.s
Normal file
17
mach/vax4/libem/gto.s
Normal file
|
@ -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
|
18
mach/vax4/libem/inn.s
Normal file
18
mach/vax4/libem/inn.s
Normal file
|
@ -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
|
12
mach/vax4/libem/ior.s
Normal file
12
mach/vax4/libem/ior.s
Normal file
|
@ -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)
|
26
mach/vax4/libem/lar4.s
Normal file
26
mach/vax4/libem/lar4.s
Normal file
|
@ -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)
|
30
mach/vax4/libem/los.s
Normal file
30
mach/vax4/libem/los.s
Normal file
|
@ -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)
|
18
mach/vax4/libem/lpb.s
Normal file
18
mach/vax4/libem/lpb.s
Normal file
|
@ -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
|
7
mach/vax4/libem/lxa.s
Normal file
7
mach/vax4/libem/lxa.s
Normal file
|
@ -0,0 +1,7 @@
|
|||
# $Header$
|
||||
.globl .lxa
|
||||
|
||||
.lxa:
|
||||
jsb .lxl # Find local base
|
||||
jsb .lpb # Convert to argument base
|
||||
rsb
|
14
mach/vax4/libem/lxl.s
Normal file
14
mach/vax4/libem/lxl.s
Normal file
|
@ -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
|
19
mach/vax4/libem/mlf.s
Normal file
19
mach/vax4/libem/mlf.s
Normal file
|
@ -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
|
14
mach/vax4/libem/mli.s
Normal file
14
mach/vax4/libem/mli.s
Normal file
|
@ -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
|
344
mach/vax4/libem/mon.s
Normal file
344
mach/vax4/libem/mon.s
Normal file
|
@ -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
|
19
mach/vax4/libem/ngf.s
Normal file
19
mach/vax4/libem/ngf.s
Normal file
|
@ -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
|
14
mach/vax4/libem/ngi.s
Normal file
14
mach/vax4/libem/ngi.s
Normal file
|
@ -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
|
13
mach/vax4/libem/nop.s
Normal file
13
mach/vax4/libem/nop.s
Normal file
|
@ -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
|
29
mach/vax4/libem/print.s
Normal file
29
mach/vax4/libem/print.s
Normal file
|
@ -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
|
12
mach/vax4/libem/rck.s
Normal file
12
mach/vax4/libem/rck.s
Normal file
|
@ -0,0 +1,12 @@
|
|||
# $Header$
|
||||
#include "em_abs.h"
|
||||
|
||||
.globl .rck
|
||||
|
||||
.rck:
|
||||
cmpl r0,$4
|
||||
bneq Lerr
|
||||
jmp .rck4
|
||||
Lerr:
|
||||
pushl $EILLINS
|
||||
jmp .fat
|
17
mach/vax4/libem/rck4.s
Normal file
17
mach/vax4/libem/rck4.s
Normal file
|
@ -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
|
18
mach/vax4/libem/rmi.s
Normal file
18
mach/vax4/libem/rmi.s
Normal file
|
@ -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
|
14
mach/vax4/libem/rmu.s
Normal file
14
mach/vax4/libem/rmu.s
Normal file
|
@ -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
|
18
mach/vax4/libem/rmu4.s
Normal file
18
mach/vax4/libem/rmu4.s
Normal file
|
@ -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)
|
15
mach/vax4/libem/rol.s
Normal file
15
mach/vax4/libem/rol.s
Normal file
|
@ -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
|
15
mach/vax4/libem/ror.s
Normal file
15
mach/vax4/libem/ror.s
Normal file
|
@ -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
|
26
mach/vax4/libem/sar4.s
Normal file
26
mach/vax4/libem/sar4.s
Normal file
|
@ -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)
|
19
mach/vax4/libem/sbf.s
Normal file
19
mach/vax4/libem/sbf.s
Normal file
|
@ -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
|
14
mach/vax4/libem/sbi.s
Normal file
14
mach/vax4/libem/sbi.s
Normal file
|
@ -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
|
10
mach/vax4/libem/sbs.s
Normal file
10
mach/vax4/libem/sbs.s
Normal file
|
@ -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
|
24
mach/vax4/libem/set.s
Normal file
24
mach/vax4/libem/set.s
Normal file
|
@ -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)
|
9
mach/vax4/libem/sig.s
Normal file
9
mach/vax4/libem/sig.s
Normal file
|
@ -0,0 +1,9 @@
|
|||
# $Header$
|
||||
.globl .sig
|
||||
|
||||
.sig:
|
||||
movl (sp)+,r1
|
||||
movl (sp)+,r0
|
||||
pushl .trppc
|
||||
movl r0,.trppc
|
||||
jmp (r1)
|
12
mach/vax4/libem/sim.s
Normal file
12
mach/vax4/libem/sim.s
Normal file
|
@ -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)
|
16
mach/vax4/libem/sli.s
Normal file
16
mach/vax4/libem/sli.s
Normal file
|
@ -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
|
17
mach/vax4/libem/sri.s
Normal file
17
mach/vax4/libem/sri.s
Normal file
|
@ -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
|
19
mach/vax4/libem/sru.s
Normal file
19
mach/vax4/libem/sru.s
Normal file
|
@ -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)
|
30
mach/vax4/libem/strhp.s
Normal file
30
mach/vax4/libem/strhp.s
Normal file
|
@ -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
|
26
mach/vax4/libem/strlb.s
Normal file
26
mach/vax4/libem/strlb.s
Normal file
|
@ -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
|
31
mach/vax4/libem/sts.s
Normal file
31
mach/vax4/libem/sts.s
Normal file
|
@ -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)
|
26
mach/vax4/libem/trp.s
Normal file
26
mach/vax4/libem/trp.s
Normal file
|
@ -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
|
26
mach/vax4/libem/xar.s
Normal file
26
mach/vax4/libem/xar.s
Normal file
|
@ -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
|
12
mach/vax4/libem/xor.s
Normal file
12
mach/vax4/libem/xor.s
Normal file
|
@ -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)
|
Loading…
Reference in a new issue