some more changes to use VAX assembler
This commit is contained in:
parent
c9312a41da
commit
6dac59f2d4
74 changed files with 665 additions and 549 deletions
|
@ -2,3 +2,4 @@ LIST
|
||||||
Makefile
|
Makefile
|
||||||
compmodule
|
compmodule
|
||||||
libem_s.a
|
libem_s.a
|
||||||
|
end.s
|
||||||
|
|
|
@ -1,25 +1,28 @@
|
||||||
# $Header$
|
# $Header$
|
||||||
all: libem_o.a
|
MACH=vax4
|
||||||
|
all: libem_o.a end.o
|
||||||
|
|
||||||
install: cp
|
install: all
|
||||||
|
|
||||||
cp: all
|
|
||||||
../../install libem_o.a tail_em
|
../../install libem_o.a tail_em
|
||||||
|
../../install end.o end_em
|
||||||
|
|
||||||
cmp: all
|
cmp: all
|
||||||
-../../compare libem_o.a tail_em
|
-../../compare libem_o.a tail_em
|
||||||
|
-../../compare end.o end_em
|
||||||
|
|
||||||
|
end.o: end.s
|
||||||
|
$(MACH) -I../../../h -c end.s
|
||||||
|
|
||||||
libem_o.a: libem_s.a
|
libem_o.a: libem_s.a
|
||||||
ASAR=ar ; export ASAR ;\
|
ASAR=aal ; export ASAR ;\
|
||||||
RANLIB=ranlib ; export RANLIB ;\
|
|
||||||
march . libem_o.a
|
march . libem_o.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libem_o.a
|
rm -f *.o libem_o.a
|
||||||
|
|
||||||
opr:
|
opr :
|
||||||
make pr | opr
|
make pr | opr
|
||||||
|
|
||||||
pr:
|
pr:
|
||||||
@pr `pwd`/Makefile
|
|
||||||
@arch pv libem_s.a | pr -h `pwd`/libem_s.a
|
@arch pv libem_s.a | pr -h `pwd`/libem_s.a
|
||||||
|
@pr `pwd`/end.s
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .aar4
|
.define .aar4
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.aar4:
|
.aar4:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movl 8(r0),r1 # elementsize in r1
|
movl 8(r0),r1 ! elementsize in r1
|
||||||
subl3 (r0),(sp)+,r0
|
subl3 (r0),(sp)+,r0
|
||||||
mull2 r1,r0
|
mull2 r1,r0
|
||||||
addl2 (sp)+,r0
|
addl2 (sp)+,r0
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .adf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .adf
|
|
||||||
|
|
||||||
.adf:
|
.adf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq 1f
|
||||||
addf2 (sp)+,(sp)
|
addf2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq 2f
|
||||||
addd2 (sp)+,(sp)
|
addd2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L2:
|
2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .adi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .adi
|
|
||||||
|
|
||||||
.adi:
|
.adi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq 1f
|
||||||
addl2 (sp)+,(sp)
|
addl2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .and
|
.define .and
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.and:
|
.and:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
addl3 r0,sp,r1
|
addl3 r0,sp,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
1:
|
||||||
mcoml (sp)+,r2
|
mcoml (sp)+,r2
|
||||||
bicl2 r2,(r1)+
|
bicl2 r2,(r1)+
|
||||||
sobgtr r0,L1
|
sobgtr r0,1b
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .ass
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .ass
|
|
||||||
|
|
||||||
.ass:
|
.ass:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq 1f
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
addl2 r0,sp
|
addl2 r0,sp
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .bls
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .bls
|
|
||||||
|
|
||||||
.bls:
|
.bls:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq 5f
|
||||||
movl (sp)+,r0 # number of bytes in r0
|
movl (sp)+,r0 ! number of bytes in r0
|
||||||
movl (sp)+,r1 # addresses in r1, r2
|
movl (sp)+,r1 ! addresses in r1, r2
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
blbc r0,L1
|
blbc r0,1f
|
||||||
movb (r2)+,(r1)+
|
movb (r2)+,(r1)+
|
||||||
L1:
|
1:
|
||||||
bbc $1,r0,L2
|
bbc $1,r0,2f
|
||||||
movw (r2)+,(r1)+
|
movw (r2)+,(r1)+
|
||||||
L2:
|
2:
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
beql L4
|
beql 4f
|
||||||
L3:
|
3:
|
||||||
movl (r2)+,(r1)+
|
movl (r2)+,(r1)+
|
||||||
sobgtr r0,L3
|
sobgtr r0,3b
|
||||||
L4:
|
4:
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
Lerr:
|
5:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,33 +1,34 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cff
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cff
|
|
||||||
|
|
||||||
.cff:
|
.cff:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Ldtd
|
bneq 1f
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lddf
|
bneq 2f
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lddf:
|
2:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq 4f
|
||||||
cvtdf (sp)+,-(sp)
|
cvtdf (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Ldtd:
|
1:
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lddd
|
bneq 3f
|
||||||
cvtfd (sp)+,-(sp)
|
cvtfd (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lddd:
|
3:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq 4f
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
4:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cfi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cfi
|
|
||||||
|
|
||||||
.cfi:
|
.cfi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq 1f
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lddl
|
bneq 2f
|
||||||
cvtfl (sp)+,-(sp)
|
cvtfl (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lddl:
|
2:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq 1f
|
||||||
cvtdl (sp)+,-(sp)
|
cvtdl (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,37 +1,38 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cfu
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cfu
|
|
||||||
|
|
||||||
.cfu:
|
.cfu:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movpsl r1
|
movpsl r1
|
||||||
bicl2 $~040,r1
|
bicl2 $~040,r1
|
||||||
bicpsw $040 # integer overflow traps must be ignored
|
bicpsw $040 ! integer overflow traps must be ignored
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl (sp),$4
|
cmpl (sp),$4
|
||||||
bneq Lddt
|
bneq 1f
|
||||||
tstl (sp)+
|
tstl (sp)+
|
||||||
tstf (sp)
|
tstf (sp)
|
||||||
bgeq L1
|
bgeq 5f
|
||||||
mnegf (sp),(sp)
|
mnegf (sp),(sp)
|
||||||
L1:
|
5:
|
||||||
cvtfl (sp)+,-(sp)
|
cvtfl (sp)+,-(sp)
|
||||||
L2:
|
2:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq 4f
|
||||||
bispsw r1 # restore trap enable bit
|
bispsw r1 ! restore trap enable bit
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
Lddt:
|
1:
|
||||||
cmpl (sp)+,$8
|
cmpl (sp)+,$8
|
||||||
bneq Lerr
|
bneq 4f
|
||||||
tstd (sp)
|
tstd (sp)
|
||||||
bgeq L3
|
bgeq 3f
|
||||||
mnegd (sp),(sp)
|
mnegd (sp),(sp)
|
||||||
L3:
|
3:
|
||||||
cvtdl (sp)+,-(sp)
|
cvtdl (sp)+,-(sp)
|
||||||
brb L2
|
br 2b
|
||||||
Lerr:
|
4:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,27 +1,28 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cif
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cif
|
|
||||||
|
|
||||||
.cif:
|
.cif:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Ldbl
|
bneq Idbl
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
cvtlf (sp)+,-(sp)
|
cvtlf (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Ldbl:
|
Idbl:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
cvtld (sp)+,-(sp)
|
cvtld (sp)+,-(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,25 +1,26 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cii
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cii
|
|
||||||
|
|
||||||
.cii:
|
.cii:
|
||||||
movl (sp)+, r1
|
movl (sp)+, r1
|
||||||
movl (sp)+, r0
|
movl (sp)+, r0
|
||||||
cmpl (sp), $1
|
cmpl (sp), $1
|
||||||
beql Lfrom1
|
beql Ifrom1
|
||||||
cmpl (sp), $2
|
cmpl (sp), $2
|
||||||
beql Lfrom2
|
beql Ifrom2
|
||||||
cmpl (sp)+, $4
|
cmpl (sp)+, $4
|
||||||
bgtr Lerr
|
bgtr Ierr
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lfrom1:
|
Ifrom1:
|
||||||
cvtbw 4(sp), 4(sp)
|
cvtbw 4(sp), 4(sp)
|
||||||
Lfrom2:
|
Ifrom2:
|
||||||
tstl (sp)+
|
tstl (sp)+
|
||||||
cvtwl (sp), (sp)
|
cvtwl (sp), (sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .cmand
|
.define .cmand
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
|
|
||||||
.cmand:
|
.cmand:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
addl3 r0,sp,r1
|
addl3 r0,sp,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
I1:
|
||||||
bicl2 (sp)+,(r1)+
|
bicl2 (sp)+,(r1)+
|
||||||
sobgtr r0,L1
|
sobgtr r0,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cmf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cmf
|
|
||||||
|
|
||||||
.cmf:
|
.cmf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
clrl r0
|
clrl r0
|
||||||
cmpf (sp)+,(sp)+
|
cmpf (sp)+,(sp)+
|
||||||
brb L3
|
br I3
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
clrl r0
|
clrl r0
|
||||||
cmpd (sp)+,(sp)+
|
cmpd (sp)+,(sp)+
|
||||||
L3:
|
I3:
|
||||||
beql L2
|
beql I2
|
||||||
bgtr L4
|
bgtr I4
|
||||||
incl r0
|
incl r0
|
||||||
brb L2
|
br I2
|
||||||
L4:
|
I4:
|
||||||
decl r0
|
decl r0
|
||||||
L2:
|
I2:
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cmi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cmi
|
|
||||||
|
|
||||||
.cmi:
|
.cmi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
clrl r0
|
clrl r0
|
||||||
cmpl (sp)+,(sp)+
|
cmpl (sp)+,(sp)+
|
||||||
beql L1
|
beql I1
|
||||||
bgtr L2
|
bgtr I2
|
||||||
incl r0
|
incl r0
|
||||||
brb L1
|
br I1
|
||||||
L2:
|
I2:
|
||||||
decl r0
|
decl r0
|
||||||
L1:
|
I1:
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .cms
|
.define .cms
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.cms:
|
.cms:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
addl3 sp,r0,r1
|
addl3 sp,r0,r1
|
||||||
addl3 r1,r0,r2
|
addl3 r1,r0,r2
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
I1:
|
||||||
cmpl (sp)+,(r1)+
|
cmpl (sp)+,(r1)+
|
||||||
bneq L2
|
bneq I2
|
||||||
sobgtr r0,L1
|
sobgtr r0,I1
|
||||||
L2:
|
I2:
|
||||||
movl r2,sp
|
movl r2,sp
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cmu
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cmu
|
|
||||||
|
|
||||||
.cmu:
|
.cmu:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
clrl r0
|
clrl r0
|
||||||
cmpl (sp)+,(sp)+
|
cmpl (sp)+,(sp)+
|
||||||
beqlu L1
|
beqlu I1
|
||||||
bgtru L2
|
bgtru I2
|
||||||
incl r0
|
incl r0
|
||||||
brb L1
|
br I1
|
||||||
L2:
|
I2:
|
||||||
decl r0
|
decl r0
|
||||||
L1:
|
I1:
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .com
|
.define .com
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.com:
|
.com:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movl sp,r1
|
movl sp,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
I1:
|
||||||
mcoml (r1),(r1)+
|
mcoml (r1),(r1)+
|
||||||
sobgtr r0,L1
|
sobgtr r0,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .csa4
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .csa4
|
|
||||||
|
|
||||||
.csa4:
|
.csa4:
|
||||||
movl (sp)+,r0 # descriptor address
|
movl (sp)+,r0 ! descriptor address
|
||||||
movl (sp)+,r1 # index
|
movl (sp)+,r1 ! index
|
||||||
movl (r0)+,r2 # default
|
movl (r0)+,r2 ! default
|
||||||
subl2 (r0)+,r1
|
subl2 (r0)+,r1
|
||||||
cmpl (r0)+,r1
|
cmpl (r0)+,r1
|
||||||
blssu L1
|
blssu I1
|
||||||
movl (r0)[r1],r1
|
movl (r0)[r1],r1
|
||||||
bneq L2
|
bneq I2
|
||||||
L1:
|
I1:
|
||||||
movl r2,r1
|
movl r2,r1
|
||||||
bneq L2
|
bneq I2
|
||||||
pushl $ECASE
|
pushl $ECASE
|
||||||
jmp .fat
|
jmp .fat
|
||||||
L2:
|
I2:
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .csb4
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .csb4
|
|
||||||
|
|
||||||
.csb4:
|
.csb4:
|
||||||
movl (sp)+,r0 # descriptor address
|
movl (sp)+,r0 ! descriptor address
|
||||||
movl (sp)+,r1 # index
|
movl (sp)+,r1 ! index
|
||||||
pushl r4 # Save r4
|
pushl r4 ! Save r4
|
||||||
movl (r0)+,r4 # default
|
movl (r0)+,r4 ! default
|
||||||
movl (r0)+,r2 # number of cases
|
movl (r0)+,r2 ! number of cases
|
||||||
L1:
|
I1:
|
||||||
decl r2
|
decl r2
|
||||||
blss L2
|
blss I2
|
||||||
movl (r0)+,r3
|
movl (r0)+,r3
|
||||||
cmpl r1,r3
|
cmpl r1,r3
|
||||||
beql Lfound
|
beql Ifound
|
||||||
tstl (r0)+ # useless address
|
tstl (r0)+ ! useless address
|
||||||
brb L1
|
br I1
|
||||||
Lfound:
|
Ifound:
|
||||||
movl (r0)+,r4
|
movl (r0)+,r4
|
||||||
L2:
|
I2:
|
||||||
movl r4,r0
|
movl r4,r0
|
||||||
beql a3
|
beql a3
|
||||||
movl (sp)+,r4 # Restore r4
|
movl (sp)+,r4 ! Restore r4
|
||||||
jmp (r0)
|
jmp (r0)
|
||||||
a3:
|
a3:
|
||||||
pushl $ECASE
|
pushl $ECASE
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .csa
|
||||||
|
.define .csb
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .csa
|
|
||||||
|
|
||||||
.csa:
|
.csa:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lillins
|
bneq Iillins
|
||||||
jmp .csa4
|
jmp .csa4
|
||||||
|
|
||||||
.globl .csb
|
|
||||||
|
|
||||||
.csb:
|
.csb:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lillins
|
bneq Iillins
|
||||||
jmp .csb4
|
jmp .csb4
|
||||||
|
|
||||||
Lillins:
|
Iillins:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,34 +1,35 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cuf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cuf
|
|
||||||
|
|
||||||
.cuf:
|
.cuf:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r1,$4
|
cmpl r1,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Ldld
|
bneq Idld
|
||||||
cvtlf (sp)+,-(sp)
|
cvtlf (sp)+,-(sp)
|
||||||
bgeq Lout
|
bgeq Iout
|
||||||
addf2 Ltwo32f,(sp)
|
addf2 Itwo32f,(sp)
|
||||||
Lout:
|
Iout:
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
Ldld:
|
Idld:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
cvtld (sp)+,-(sp)
|
cvtld (sp)+,-(sp)
|
||||||
bgeq Lout
|
bgeq Iout
|
||||||
addd2 Ltwo32F,(sp)
|
addd2 Itwo32F,(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
.data
|
.sect .rom
|
||||||
Ltwo32f:
|
Itwo32f:
|
||||||
.float 0f4294967296.0
|
.data1 0200,0117,00,00
|
||||||
Ltwo32F:
|
Itwo32F:
|
||||||
.double 0f4294967296.0
|
.data1 0200,0117,00,00,00,00,00,00
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cui
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cui
|
|
||||||
|
|
||||||
.cui:
|
.cui:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .cuu
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .cuu
|
|
||||||
|
|
||||||
.cuu:
|
.cuu:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl (sp)+,$4
|
cmpl (sp)+,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
cmpl (sp)+, $4
|
cmpl (sp)+, $4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .dus
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .dus
|
|
||||||
|
|
||||||
.dus:
|
.dus:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
pushl r1
|
pushl r1
|
||||||
jmp .dup
|
jmp .dup
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .dvf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .dvf
|
|
||||||
|
|
||||||
.dvf:
|
.dvf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
divf2 (sp)+,(sp)
|
divf2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
divd2 (sp)+,(sp)
|
divd2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .dvi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .dvi
|
|
||||||
|
|
||||||
.dvi:
|
.dvi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
divl2 (sp)+,(sp)
|
divl2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .dvu
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .dvu
|
|
||||||
|
|
||||||
.dvu:
|
.dvu:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
jmp .dvu4
|
jmp .dvu4
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .dvu4
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .dvu4
|
|
||||||
|
|
||||||
.dvu4:
|
.dvu4:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
blss L1
|
blss I1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
clrl r1
|
clrl r1
|
||||||
ediv r2,r0,r0,r1
|
ediv r2,r0,r0,r1
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L1:
|
I1:
|
||||||
cmpl (sp)+,r2
|
cmpl (sp)+,r2
|
||||||
bgequ L2
|
bgequ I2
|
||||||
clrl r0
|
clrl r0
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L2:
|
I2:
|
||||||
movl $1,r0
|
movl $1,r0
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
20
mach/vax4/libem/end.s
Normal file
20
mach/vax4/libem/end.s
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.define endtext,enddata,endbss,_etext,_edata,_end
|
||||||
|
.sect .text
|
||||||
|
.align 4
|
||||||
|
.sect .rom
|
||||||
|
.align 4
|
||||||
|
.sect .data
|
||||||
|
.align 4
|
||||||
|
.sect .bss
|
||||||
|
.align 4
|
||||||
|
.sect .end ! only for declaration of _end and endbss.
|
||||||
|
|
||||||
|
.sect .text
|
||||||
|
endtext:
|
||||||
|
_etext:
|
||||||
|
.sect .data
|
||||||
|
enddata:
|
||||||
|
_edata:
|
||||||
|
.sect .end
|
||||||
|
_end:
|
||||||
|
endbss:
|
|
@ -1,18 +1,20 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .exg
|
.define .exg
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.exg:
|
.exg:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
addl3 sp,r0,r2
|
addl3 sp,r0,r2
|
||||||
addl2 r0,r2
|
addl2 r0,r2
|
||||||
ashl $-2,r0,r1
|
ashl $-2,r0,r1
|
||||||
L1:
|
I1:
|
||||||
movl -(r2),-(sp)
|
movl -(r2),-(sp)
|
||||||
sobgtr r1,L1
|
sobgtr r1,I1
|
||||||
addl3 r0,r2,r1
|
addl3 r0,r2,r1
|
||||||
L2:
|
I2:
|
||||||
movw -(r2),-(r1)
|
movw -(r2),-(r1)
|
||||||
sobgtr r0,L2
|
sobgtr r0,I2
|
||||||
movl r1,sp
|
movl r1,sp
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .fat
|
.define .fat
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.fat:
|
.fat:
|
||||||
pushl (sp)
|
pushl (sp)
|
||||||
jsb .trp
|
jsb .trp
|
||||||
movl $L1,ap
|
movl $I1,ap
|
||||||
movl (sp)+,6(ap)
|
movl (sp)+,6(ap)
|
||||||
chmk (ap)+
|
chmk (ap)+
|
||||||
halt
|
halt
|
||||||
|
|
||||||
.data
|
.sect .rom
|
||||||
L1: .word 1
|
I1: .data2 1
|
||||||
.long 1
|
.data4 1
|
||||||
.long 0
|
.data4 0
|
||||||
|
|
|
@ -1,28 +1,29 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .fef
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .fef
|
|
||||||
|
|
||||||
.fef:
|
.fef:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
movf (sp)+,r0
|
movf (sp)+,r0
|
||||||
jsb Lhulp
|
jsb Ihulp
|
||||||
movf r0,-(sp)
|
movf r0,-(sp)
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
movd (sp)+,r0
|
movd (sp)+,r0
|
||||||
jsb Lhulp
|
jsb Ihulp
|
||||||
movd r0,-(sp)
|
movd r0,-(sp)
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
Lhulp:
|
Ihulp:
|
||||||
extzv $7,$8,r0,r2
|
extzv $7,$8,r0,r2
|
||||||
subl3 $128,r2,-(sp)
|
subl3 $128,r2,-(sp)
|
||||||
insv $128,$7,$8,r0
|
insv $128,$7,$8,r0
|
||||||
|
|
|
@ -1,24 +1,27 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .fif
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .fif
|
.sect .rom
|
||||||
|
Ione: .data1 0200, 077, 00, 00, 00, 00, 00, 00
|
||||||
|
|
||||||
.fif:
|
.fif:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
mulf3 (sp)+,(sp)+,r0
|
mulf3 (sp)+,(sp)+,r0
|
||||||
emodf r0,$0,$0f1.0,r1,-(sp)
|
emodf r0,$0,Ione,r1,-(sp)
|
||||||
subf3 (sp),r0,-(sp)
|
subf3 (sp),r0,-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
muld3 (sp)+,(sp)+,r0
|
muld3 (sp)+,(sp)+,r0
|
||||||
emodd r0,$0,$0f1.0,r0,-(sp)
|
emodd r0,$0,Ione,r0,-(sp)
|
||||||
subd3 (sp),r0,-(sp)
|
subd3 (sp),r0,-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .gto
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.globl .strlb
|
.extern .strlb
|
||||||
.globl .gto
|
! Nonlocal goto.
|
||||||
# Nonlocal goto.
|
! On the stack is a pointer to a block containing :
|
||||||
# On the stack is a pointer to a block containing :
|
! 1. the new local base (ptr+8)
|
||||||
# 1. the new local base (ptr+8)
|
! 2. the new stack pointer (ptr+4)
|
||||||
# 2. the new stack pointer (ptr+4)
|
! 3. the new program counter (ptr)
|
||||||
# 3. the new program counter (ptr)
|
|
||||||
.gto:
|
.gto:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movl 4(r2),sp # Store new stack pointer
|
movl 4(r2),sp ! Store new stack pointer
|
||||||
pushl (r2) # Push target address
|
pushl (r2) ! Push target address
|
||||||
pushl 8(r2) # Push new local base
|
pushl 8(r2) ! Push new local base
|
||||||
jsb .strlb # Store in fp, compute ap
|
jsb .strlb ! Store in fp, compute ap
|
||||||
rsb
|
rsb
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .inn
|
.define .inn
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.inn:
|
.inn:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
ashl $3,r0,r2 # nr of bits in r2
|
ashl $3,r0,r2 ! nr of bits in r2
|
||||||
cmpl r1,r2
|
cmpl r1,r2
|
||||||
bgequ L2
|
bgequ I2
|
||||||
bbc r1,(sp),L2
|
bbc r1,(sp),I2
|
||||||
movl $1,r1
|
movl $1,r1
|
||||||
L1:
|
I1:
|
||||||
addl2 r0,sp
|
addl2 r0,sp
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L2:
|
I2:
|
||||||
clrl r1
|
clrl r1
|
||||||
brb L1
|
br I1
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .ior
|
.define .ior
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.ior:
|
.ior:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
addl3 r0,sp,r1
|
addl3 r0,sp,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
I1:
|
||||||
bisl2 (sp)+,(r1)+
|
bisl2 (sp)+,(r1)+
|
||||||
sobgtr r0,L1
|
sobgtr r0,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .lar4
|
.define .lar4
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.lar4:
|
.lar4:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
|
@ -10,17 +12,17 @@
|
||||||
addl2 (sp)+,r0
|
addl2 (sp)+,r0
|
||||||
addl2 r1,r0
|
addl2 r1,r0
|
||||||
cmpl r1,$1
|
cmpl r1,$1
|
||||||
bgtr L3
|
bgtr I3
|
||||||
movzbl -(r0),-(sp)
|
movzbl -(r0),-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L3:
|
I3:
|
||||||
cmpl r1,$2
|
cmpl r1,$2
|
||||||
bgtr L2
|
bgtr I2
|
||||||
movzwl -(r0),-(sp)
|
movzwl -(r0),-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L2:
|
I2:
|
||||||
ashl $-2,r1,r1
|
ashl $-2,r1,r1
|
||||||
L1:
|
I1:
|
||||||
movl -(r0),-(sp)
|
movl -(r0),-(sp)
|
||||||
sobgtr r1,L1
|
sobgtr r1,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,31 +1,32 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .los
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .los
|
|
||||||
|
|
||||||
.los:
|
.los:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
beql L1
|
beql I1
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
L1:
|
I1:
|
||||||
movl (sp)+,r0 # nbytes in r0
|
movl (sp)+,r0 ! nbytes in r0
|
||||||
movl (sp)+,r1 # address in r1
|
movl (sp)+,r1 ! address in r1
|
||||||
cmpl r0,$1
|
cmpl r0,$1
|
||||||
beql L2
|
beql I2
|
||||||
cmpl r0,$2
|
cmpl r0,$2
|
||||||
beql L3
|
beql I3
|
||||||
addl2 r0,r1
|
addl2 r0,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L4:
|
I4:
|
||||||
movl -(r1),-(sp)
|
movl -(r1),-(sp)
|
||||||
sobgtr r0,L4
|
sobgtr r0,I4
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L2:
|
I2:
|
||||||
cvtbl (r1),-(sp)
|
cvtbl (r1),-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L3:
|
I3:
|
||||||
cvtwl (r1),-(sp)
|
cvtwl (r1),-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,25 +1,27 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
# special version to work with A68S, by CHL
|
.define .lpb
|
||||||
.globl .lpb
|
|
||||||
# compute AB, given LB
|
! $Header$
|
||||||
|
! special version to work with A68S, by CHL
|
||||||
|
! compute AB, given LB
|
||||||
.lpb:
|
.lpb:
|
||||||
cmpl r0,fp
|
cmpl r0,fp
|
||||||
bneq L1
|
bneq I1
|
||||||
moval 4(ap),r0
|
moval 4(ap),r0
|
||||||
rsb
|
rsb
|
||||||
L1:
|
I1:
|
||||||
movl 4(r0),r1 # mask for saved registers
|
movl 4(r0),r1 ! mask for saved registers
|
||||||
addl2 $24,r0 # position of AB if no registers saved
|
addl2 $24,r0 ! position of AB if no registers saved
|
||||||
movl $16,r2 # position of first bit to test
|
movl $16,r2 ! position of first bit to test
|
||||||
L2:
|
I2:
|
||||||
subl3 r2,$28,r3 # remaining size of mask
|
subl3 r2,$28,r3 ! remaining size of mask
|
||||||
ffs r2,r3,r1,r2 # find first bit set in mask
|
ffs r2,r3,r1,r2 ! find first bit set in mask
|
||||||
beql L3 # no more bits set
|
beql I3 ! no more bits set
|
||||||
addl2 $4,r0 # for each saved register
|
addl2 $4,r0 ! for each saved register
|
||||||
incl r2
|
incl r2
|
||||||
jbr L2
|
jbr I2
|
||||||
L3:
|
I3:
|
||||||
extzv $30,$2,r1,r2 # Now find out about the stack alignment
|
extzv $30,$2,r1,r2 ! Now find out about the stack alignment
|
||||||
# between fp and ap
|
! between fp and ap
|
||||||
addl2 r2,r0 # add alignment
|
addl2 r2,r0 ! add alignment
|
||||||
rsb
|
rsb
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .lxa
|
.define .lxa
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.lxa:
|
.lxa:
|
||||||
jsb .lxl # Find local base
|
jsb .lxl ! Find local base
|
||||||
jsb .lpb # Convert to argument base
|
jsb .lpb ! Convert to argument base
|
||||||
rsb
|
rsb
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .lxl
|
.define .lxl
|
||||||
|
|
||||||
# nlevels in r0 (>=2)
|
! $Header$
|
||||||
|
|
||||||
|
! nlevels in r0 (>=2)
|
||||||
.lxl:
|
.lxl:
|
||||||
pushl r0
|
pushl r0
|
||||||
decl (sp)
|
decl (sp)
|
||||||
movl 4(ap),r0
|
movl 4(ap),r0
|
||||||
L1:
|
I1:
|
||||||
jsb .lpb
|
jsb .lpb
|
||||||
movl (r0),r0
|
movl (r0),r0
|
||||||
sobgtr (sp),L1
|
sobgtr (sp),I1
|
||||||
tstl (sp)+
|
tstl (sp)+
|
||||||
rsb
|
rsb
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .mlf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .mlf
|
|
||||||
|
|
||||||
.mlf:
|
.mlf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
mulf2 (sp)+,(sp)
|
mulf2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
muld2 (sp)+,(sp)
|
muld2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .mli
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .mli
|
|
||||||
|
|
||||||
.mli:
|
.mli:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
mull2 (sp)+,(sp)
|
mull2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .mon
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.globl .mon
|
|
||||||
|
|
||||||
.mon:
|
.mon:
|
||||||
pushl $EBADMON
|
pushl $EBADMON
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .ngf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .ngf
|
|
||||||
|
|
||||||
.ngf:
|
.ngf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
mnegf (sp),(sp)
|
mnegf (sp),(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
mnegd (sp),(sp)
|
mnegd (sp),(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .ngi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .ngi
|
|
||||||
|
|
||||||
.ngi:
|
.ngi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
mnegl (sp),(sp)
|
mnegl (sp),(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .nop
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .nop
|
|
||||||
|
|
||||||
.nop:
|
.nop:
|
||||||
movl hol0+LINO_AD,r0
|
movl hol0+LINO_AD,r0
|
||||||
|
|
|
@ -1,29 +1,33 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl printd
|
.define printd
|
||||||
.globl printc
|
.define printc
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
printd:
|
printd:
|
||||||
clrl r1
|
clrl r1
|
||||||
ediv $10,r0,r0,r1
|
ediv $10,r0,r0,r1
|
||||||
beql L1
|
beql I1
|
||||||
pushl r1
|
pushl r1
|
||||||
jsb printd
|
jsb printd
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
L1:
|
I1:
|
||||||
addb3 $'0,r1,r0
|
addb3 $'0',r1,r0
|
||||||
|
|
||||||
printc:
|
printc:
|
||||||
movb r0,Lch
|
movb r0,Ich
|
||||||
movl ap,r2
|
movl ap,r2
|
||||||
movl $L9,ap
|
movl $I9,ap
|
||||||
chmk $4
|
chmk $4
|
||||||
movl r2,ap
|
movl r2,ap
|
||||||
rsb
|
rsb
|
||||||
|
|
||||||
.data
|
.sect .rom
|
||||||
L9:
|
I9:
|
||||||
.long 3
|
.data4 3
|
||||||
.long 2
|
.data4 2
|
||||||
.long Lch
|
.data4 Ich
|
||||||
.long 1
|
.data4 1
|
||||||
Lch: .word 0
|
|
||||||
|
.sect .data
|
||||||
|
Ich: .data2 0
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .rck
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .rck
|
|
||||||
|
|
||||||
.rck:
|
.rck:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
jmp .rck4
|
jmp .rck4
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .rck4
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .rck4
|
|
||||||
|
|
||||||
.rck4:
|
.rck4:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl (sp),(r0) # compare lower bound
|
cmpl (sp),(r0) ! compare lower bound
|
||||||
blss Lerr
|
blss Ierr
|
||||||
cmpl (sp),4(r0) # compare upper bound
|
cmpl (sp),4(r0) ! compare upper bound
|
||||||
bgtr Lerr
|
bgtr Ierr
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl r1
|
pushl r1
|
||||||
pushl $ERANGE
|
pushl $ERANGE
|
||||||
jsb .trp
|
jsb .trp
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .rmi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .rmi
|
|
||||||
|
|
||||||
.rmi:
|
.rmi:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
ashq $-32,r0,r0
|
ashq $-32,r0,r0
|
||||||
ediv r2,r0,r1,r0
|
ediv r2,r0,r1,r0
|
||||||
pushl r0
|
pushl r0
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .rmu
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .rmu
|
|
||||||
|
|
||||||
.rmu:
|
.rmu:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
jsb .rmu4
|
jsb .rmu4
|
||||||
pushl r0
|
pushl r0
|
||||||
rsb
|
rsb
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .rmu4
|
.define .rmu4
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.rmu4:
|
.rmu4:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
blss L1
|
blss I1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
clrl r1
|
clrl r1
|
||||||
ediv r2,r0,r1,r0
|
ediv r2,r0,r1,r0
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L1:
|
I1:
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
cmpl r0,r2
|
cmpl r0,r2
|
||||||
blssu L2
|
blssu I2
|
||||||
subl2 r2,r0
|
subl2 r2,r0
|
||||||
L2:
|
I2:
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .rol
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .rol
|
|
||||||
|
|
||||||
.rol:
|
.rol:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
rotl r0,(sp),(sp)
|
rotl r0,(sp),(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .ror
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .ror
|
|
||||||
|
|
||||||
.ror:
|
.ror:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lerr
|
bneq Ierr
|
||||||
subl3 (sp)+,$32,r0
|
subl3 (sp)+,$32,r0
|
||||||
rotl r0,(sp),(sp)
|
rotl r0,(sp),(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
Lerr:
|
Ierr:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .sar4
|
.define .sar4
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.sar4:
|
.sar4:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
|
@ -10,17 +12,17 @@
|
||||||
mull2 r1,r0
|
mull2 r1,r0
|
||||||
addl2 (sp)+,r0
|
addl2 (sp)+,r0
|
||||||
cmpl r1,$1
|
cmpl r1,$1
|
||||||
bgtr L3
|
bgtr I3
|
||||||
cvtlb (sp)+,(r0)
|
cvtlb (sp)+,(r0)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L3:
|
I3:
|
||||||
cmpl r1,$2
|
cmpl r1,$2
|
||||||
bgtr L2
|
bgtr I2
|
||||||
cvtlw (sp)+,(r0)
|
cvtlw (sp)+,(r0)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L2:
|
I2:
|
||||||
ashl $-2,r1,r1
|
ashl $-2,r1,r1
|
||||||
L1:
|
I1:
|
||||||
movl (sp)+,(r0)+
|
movl (sp)+,(r0)+
|
||||||
sobgtr r1,L1
|
sobgtr r1,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sbf
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sbf
|
|
||||||
|
|
||||||
.sbf:
|
.sbf:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
subf2 (sp)+,(sp)
|
subf2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
cmpl r0,$8
|
cmpl r0,$8
|
||||||
bneq L2
|
bneq I2
|
||||||
subd2 (sp)+,(sp)
|
subd2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L2:
|
I2:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sbi
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sbi
|
|
||||||
|
|
||||||
.sbi:
|
.sbi:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
subl2 (sp)+,(sp)
|
subl2 (sp)+,(sp)
|
||||||
jmp (r1)
|
jmp (r1)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .sbs
|
.define .sbs
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.sbs:
|
.sbs:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
|
|
|
@ -1,25 +1,26 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .setx
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .setx
|
|
||||||
|
|
||||||
# bytes in r0
|
! bytes in r0
|
||||||
.setx:
|
.setx:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
movl (sp)+,r1 # bitnumber in r1
|
movl (sp)+,r1 ! bitnumber in r1
|
||||||
subl3 r0,sp,r2
|
subl3 r0,sp,r2
|
||||||
L1:
|
I1:
|
||||||
clrl -(sp)
|
clrl -(sp)
|
||||||
cmpl sp,r2
|
cmpl sp,r2
|
||||||
bgtru L1
|
bgtru I1
|
||||||
ashl $3,r0,r2 # number of bits in r2
|
ashl $3,r0,r2 ! number of bits in r2
|
||||||
cmpl r1,r2
|
cmpl r1,r2
|
||||||
bgequ L2
|
bgequ I2
|
||||||
bbcs r1,(sp),L3
|
bbcs r1,(sp),I3
|
||||||
L3:
|
I3:
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
L2:
|
I2:
|
||||||
pushl $ESET
|
pushl $ESET
|
||||||
jsb .trp
|
jsb .trp
|
||||||
jmp (r3)
|
jmp (r3)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .sig
|
.define .sig
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.sig:
|
.sig:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .sim
|
.define .sim
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.sim:
|
.sim:
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movl (sp)+,.trpim # store ignore mask
|
movl (sp)+,.trpim ! store ignore mask
|
||||||
bbc $5,.trpim,L3 # floating underflow to be ignored?
|
bbc $5,.trpim,I3 ! floating underflow to be ignored?
|
||||||
bicpsw $0100
|
bicpsw $0100
|
||||||
jmp (r0)
|
jmp (r0)
|
||||||
L3:
|
I3:
|
||||||
bispsw $0100 # enable underflow trap
|
bispsw $0100 ! enable underflow trap
|
||||||
jmp (r0)
|
jmp (r0)
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sli
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sli
|
|
||||||
|
|
||||||
.sli:
|
.sli:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
ashl r0,r1,-(sp)
|
ashl r0,r1,-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sri
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sri
|
|
||||||
|
|
||||||
.sri:
|
.sri:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq L1
|
bneq I1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
mnegl r0,r0
|
mnegl r0,r0
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
ashl r0,r1,-(sp)
|
ashl r0,r1,-(sp)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L1:
|
I1:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sru
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sru
|
|
||||||
|
|
||||||
.sru:
|
.sru:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .strhp
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .strhp
|
|
||||||
|
|
||||||
.strhp:
|
.strhp:
|
||||||
movl (sp)+,r1
|
movl (sp)+,r1
|
||||||
|
@ -10,23 +11,23 @@
|
||||||
pushl r1
|
pushl r1
|
||||||
movl r0,.reghp
|
movl r0,.reghp
|
||||||
cmpl r0,.hplim
|
cmpl r0,.hplim
|
||||||
blssu L2
|
blssu I2
|
||||||
addl2 $02000,r0
|
addl2 $02000,r0
|
||||||
bicl2 $0777,r0
|
bicl2 $0777,r0
|
||||||
movl r0,.hplim
|
movl r0,.hplim
|
||||||
movl ap,r1
|
movl ap,r1
|
||||||
movl $L9,ap
|
movl $I9,ap
|
||||||
chmk (ap)+
|
chmk (ap)+
|
||||||
bcc L1
|
bcc I1
|
||||||
pushl $EHEAP
|
pushl $EHEAP
|
||||||
jsb .trp
|
jsb .trp
|
||||||
rsb
|
rsb
|
||||||
L1:
|
I1:
|
||||||
movl r1,ap
|
movl r1,ap
|
||||||
L2:
|
I2:
|
||||||
rsb
|
rsb
|
||||||
|
|
||||||
.data
|
.sect .data
|
||||||
L9: .word 17
|
I9: .data2 17
|
||||||
.long 1
|
.data4 1
|
||||||
.hplim: .long _end
|
.hplim: .data4 _end
|
||||||
|
|
|
@ -1,27 +1,29 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
# revised version by CHL
|
.define .strlb
|
||||||
.globl .strlb
|
|
||||||
# Store the value that is on the stack in fp.
|
! $Header$
|
||||||
# Compute ap.
|
! revised version by CHL
|
||||||
|
! Store the value that is on the stack in fp.
|
||||||
|
! Compute ap.
|
||||||
.strlb:
|
.strlb:
|
||||||
movl (sp)+,r3
|
movl (sp)+,r3
|
||||||
movl (sp)+,fp
|
movl (sp)+,fp
|
||||||
pushl r3
|
pushl r3
|
||||||
movl $20,ap # Compute argumentbase from local base.
|
movl $20,ap ! Compute argumentbase from local base.
|
||||||
# Distance is 5 longwords + the number of
|
! Distance is 5 longwords + the number of
|
||||||
# registers saved.
|
! registers saved.
|
||||||
movl 4(fp),r3 # mask for saved registers
|
movl 4(fp),r3 ! mask for saved registers
|
||||||
movl $16,r2 # position of first bit to test
|
movl $16,r2 ! position of first bit to test
|
||||||
L4:
|
I4:
|
||||||
subl3 r2,$28,r1 # remaining size of mask
|
subl3 r2,$28,r1 ! remaining size of mask
|
||||||
ffs r2,r1,r3,r2 # find first bit set in mask
|
ffs r2,r1,r3,r2 ! find first bit set in mask
|
||||||
beql L5 # no more bits set
|
beql I5 ! no more bits set
|
||||||
addl2 $4,ap # for each saved register
|
addl2 $4,ap ! for each saved register
|
||||||
incl r2
|
incl r2
|
||||||
jbr L4
|
jbr I4
|
||||||
L5:
|
I5:
|
||||||
extzv $14,$2,6(fp),r3 # Now find out about the stack alignment
|
extzv $14,$2,6(fp),r3 ! Now find out about the stack alignment
|
||||||
# between fp and ap
|
! between fp and ap
|
||||||
addl2 r3,ap # add alignment
|
addl2 r3,ap ! add alignment
|
||||||
addl2 fp,ap
|
addl2 fp,ap
|
||||||
rsb
|
rsb
|
||||||
|
|
|
@ -1,32 +1,33 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .sts
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .sts
|
|
||||||
|
|
||||||
.sts:
|
.sts:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
beql L1
|
beql I1
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
L1:
|
I1:
|
||||||
movl (sp)+,r0 # number of bytes in r0
|
movl (sp)+,r0 ! number of bytes in r0
|
||||||
movl (sp)+,r1 # address in r1
|
movl (sp)+,r1 ! address in r1
|
||||||
cmpl r0,$1
|
cmpl r0,$1
|
||||||
beql L3
|
beql I3
|
||||||
cmpl r0,$2
|
cmpl r0,$2
|
||||||
beql L4
|
beql I4
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L2:
|
I2:
|
||||||
movl (sp)+,(r1)+
|
movl (sp)+,(r1)+
|
||||||
sobgtr r0,L2
|
sobgtr r0,I2
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L3:
|
I3:
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movb r0,(r1)
|
movb r0,(r1)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
L4:
|
I4:
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
movw r0,(r1)
|
movw r0,(r1)
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .trp
|
.define .trp
|
||||||
|
! $Header$
|
||||||
|
|
||||||
.trp:
|
.trp:
|
||||||
pushl r0
|
pushl r0
|
||||||
|
@ -7,46 +8,44 @@
|
||||||
movl 4(sp),8(sp)
|
movl 4(sp),8(sp)
|
||||||
movl (sp)+,(sp)
|
movl (sp)+,(sp)
|
||||||
cmpl r0,$16
|
cmpl r0,$16
|
||||||
bgequ L1 # a trapnumber >= 16 cannot be ignored
|
bgequ I1 ! a trapnumber >= 16 cannot be ignored
|
||||||
bbc r0,.trpim,L1
|
bbc r0,.trpim,I1
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
rsb
|
rsb
|
||||||
L1:
|
I1:
|
||||||
pushr $017776 # save registers
|
pushr $017776 ! save registers
|
||||||
pushl r0 # trapnumber on stack
|
pushl r0 ! trapnumber on stack
|
||||||
movl .trppc,r0
|
movl .trppc,r0
|
||||||
beql L2 # is there a user defined traphandler?
|
beql I2 ! is there a user defined traphandler?
|
||||||
clrl .trppc
|
clrl .trppc
|
||||||
calls $1,(r0) # if so, call it
|
calls $1,(r0) ! if so, call it
|
||||||
popr $017776 # restore registers
|
popr $017776 ! restore registers
|
||||||
movl (sp)+,r0
|
movl (sp)+,r0
|
||||||
rsb
|
rsb
|
||||||
|
|
||||||
.set write,4
|
I2:
|
||||||
|
! Put the (octal) trapnumber in the zeroes in Iemes[].
|
||||||
|
|
||||||
L2:
|
movl $Iemesend-9,r1 ! Addres after last '0'.
|
||||||
# Put the (octal) trapnumber in the zeroes in Lemes[].
|
movl $5,r2 ! Max number of digits.
|
||||||
|
movl (sp),r0 ! Trap number in r0.
|
||||||
movl $Lemesend-9,r1 # Addres after last '0'.
|
I3:
|
||||||
movl $5,r2 # Max number of digits.
|
bicw3 $0177770,r0,r3 ! Lower 3 bits form lower octal digit.
|
||||||
movl (sp),r0 # Trap number in r0.
|
bisb2 r3,-(r1) ! Put them in the '0'.
|
||||||
L3:
|
ashl $-3,r0,r0 ! Shift the 3 bits off.
|
||||||
bicw3 $0177770,r0,r3 # Lower 3 bits form lower octal digit.
|
sobgtr r2,I3
|
||||||
bisb2 r3,-(r1) # Put them in the '0'.
|
|
||||||
ashl $-3,r0,r0 # Shift the 3 bits off.
|
|
||||||
sobgtr r2,L3
|
|
||||||
movl ap,r2
|
movl ap,r2
|
||||||
movl $Lwr,ap
|
movl $Iwr,ap
|
||||||
chmk $write
|
chmk $4 ! write
|
||||||
movl r2,ap
|
movl r2,ap
|
||||||
bpt
|
bpt
|
||||||
.data
|
.sect .data
|
||||||
Lemes:
|
Iemes:
|
||||||
.byte 'E,'M,' ,'t,'r,'a,'p,' ,'0,'0,'0,'0,'0,' ,'(,'o,'c,'t,'a,'l,'),0xa
|
.data1 'E','M',' ','t','r','a','p',' ','0','0','0','0','0',' ','(','o','c','t','a','l',')',0xa
|
||||||
Lemesend:
|
Iemesend:
|
||||||
.align 2
|
.align 2
|
||||||
Lwr:
|
Iwr:
|
||||||
.long 3 # 3 arguments.
|
.data4 3 ! 3 arguments.
|
||||||
.long 2 # File descriptor 2.
|
.data4 2 ! File descriptor 2.
|
||||||
.long Lemes # Address of character buffer.
|
.data4 Iemes ! Address of character buffer.
|
||||||
.long Lemesend - Lemes # Number of characters to write.
|
.data4 Iemesend - Iemes ! Number of characters to write.
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
.globl hol0
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
.globl .reghp
|
.sect .data
|
||||||
.globl .trppc
|
.define hol0
|
||||||
.globl .trpim
|
.define .reghp
|
||||||
|
.define .trppc
|
||||||
|
.define .trpim
|
||||||
|
|
||||||
hol0:
|
hol0:
|
||||||
.space 8
|
.space 8
|
||||||
.trppc:
|
.trppc:
|
||||||
.space 4
|
.space 4
|
||||||
.trpim:
|
.trpim:
|
||||||
.long 0
|
.data4 0
|
||||||
.reghp:
|
.reghp:
|
||||||
.long _end
|
.data4 _end
|
||||||
|
|
|
@ -1,28 +1,27 @@
|
||||||
#include "em_abs.h"
|
#include "em_abs.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define .lar
|
||||||
|
.define .sar
|
||||||
|
.define .aar
|
||||||
|
|
||||||
# $Header$
|
! $Header$
|
||||||
|
|
||||||
.globl .lar
|
|
||||||
|
|
||||||
.lar:
|
.lar:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lillins
|
bneq Iillins
|
||||||
jmp .lar4
|
jmp .lar4
|
||||||
|
|
||||||
.globl .sar
|
|
||||||
|
|
||||||
.sar:
|
.sar:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lillins
|
bneq Iillins
|
||||||
jmp .sar4
|
jmp .sar4
|
||||||
|
|
||||||
.globl .aar
|
|
||||||
|
|
||||||
.aar:
|
.aar:
|
||||||
cmpl r0,$4
|
cmpl r0,$4
|
||||||
bneq Lillins
|
bneq Iillins
|
||||||
jmp .aar4
|
jmp .aar4
|
||||||
|
|
||||||
Lillins:
|
Iillins:
|
||||||
pushl $EILLINS
|
pushl $EILLINS
|
||||||
jmp .fat
|
jmp .fat
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
# $Header$
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.globl .xor
|
.define .xor
|
||||||
|
|
||||||
# bytes in r0
|
! $Header$
|
||||||
|
|
||||||
|
! bytes in r0
|
||||||
.xor:
|
.xor:
|
||||||
movl (sp)+,r2
|
movl (sp)+,r2
|
||||||
addl3 r0,sp,r1
|
addl3 r0,sp,r1
|
||||||
ashl $-2,r0,r0
|
ashl $-2,r0,r0
|
||||||
L1:
|
I1:
|
||||||
xorl2 (sp)+,(r1)+
|
xorl2 (sp)+,(r1)+
|
||||||
sobgtr r0,L1
|
sobgtr r0,I1
|
||||||
jmp (r2)
|
jmp (r2)
|
||||||
|
|
Loading…
Reference in a new issue