From 5b20e4fed204a495e2a11791ae78a7b316896759 Mon Sep 17 00:00:00 2001 From: sater Date: Fri, 20 Jul 1984 16:20:28 +0000 Subject: [PATCH] edited to make reentrant, no more globals in use --- mach/pdp/libem/aar.s | 5 ++--- mach/pdp/libem/and.s | 6 +++--- mach/pdp/libem/cii.s | 8 +++----- mach/pdp/libem/ciu.s | 3 +-- mach/pdp/libem/cmi4.s | 1 - mach/pdp/libem/cmu4.s | 1 - mach/pdp/libem/csb.s | 5 +---- mach/pdp/libem/dup.s | 5 ++--- mach/pdp/libem/dvi.s | 6 +++--- mach/pdp/libem/dvu.s | 6 +++--- mach/pdp/libem/inn.s | 3 +-- mach/pdp/libem/lar.s | 7 +++---- mach/pdp/libem/los2.s | 7 +++---- mach/pdp/libem/mli.s | 6 +++--- mach/pdp/libem/mlu.s | 6 +++--- mach/pdp/libem/ngf.s | 5 ++--- mach/pdp/libem/ret.s | 5 ++--- mach/pdp/libem/rmi.s | 6 +++--- mach/pdp/libem/rmu.s | 8 ++++---- mach/pdp/libem/sar.s | 7 +++---- mach/pdp/libem/save.s | 3 +-- mach/pdp/libem/sim.s | 6 +++--- mach/pdp/libem/sli.s | 8 ++++---- mach/pdp/libem/sri.s | 8 ++++---- mach/pdp/libem/sru.s | 8 ++++---- mach/pdp/libem/sto2.s | 7 +++---- mach/pdp/libem/trp.s | 34 +++++++++++++++++++++++++++++++++- 27 files changed, 97 insertions(+), 83 deletions(-) diff --git a/mach/pdp/libem/aar.s b/mach/pdp/libem/aar.s index 19d9a7d2d..bcc130fed 100644 --- a/mach/pdp/libem/aar.s +++ b/mach/pdp/libem/aar.s @@ -2,12 +2,11 @@ .text .globl aar~ -/r0 : description address +/r0 : descriptor address /r1 : element number /base address is on stack aar~: sub (r0),r1 - mov 04(r0),r0 - mul r0,r1 + mul 04(r0),r1 add r1,02(sp) rts pc diff --git a/mach/pdp/libem/and.s b/mach/pdp/libem/and.s index 43a02587b..a9c34951e 100644 --- a/mach/pdp/libem/and.s +++ b/mach/pdp/libem/and.s @@ -1,14 +1,14 @@ / $Header$ .text .globl and~ -.globl save1~ +/ size in r0 and~: - mov (sp)+,save1~ + mov (sp)+,r3 mov sp,r1 add r0,r1 asr r0 1: com (sp) bic (sp)+,(r1)+ sob r0,1b - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/cii.s b/mach/pdp/libem/cii.s index e2916548d..fe1e6c9ec 100644 --- a/mach/pdp/libem/cii.s +++ b/mach/pdp/libem/cii.s @@ -1,12 +1,11 @@ / $Header$ .text .globl cii~ -.globl save1~ /convert int to int / 1 byte -> ? : sign extension cii~: - mov (sp)+,save1~ + mov (sp)+,r3 mov (sp)+,r0 sub (sp)+,r0 ble 1f @@ -19,6 +18,5 @@ cii~: tst (sp) 4: sxt -(sp) sob r0,4b -3: jmp *save1~ -1: sub r0,sp - jmp *save1~ +1: sub r0,sp / if out of sob loop r0==0 +3: jmp (r3) diff --git a/mach/pdp/libem/ciu.s b/mach/pdp/libem/ciu.s index ddf6d629c..bf1ad2dd5 100644 --- a/mach/pdp/libem/ciu.s +++ b/mach/pdp/libem/ciu.s @@ -9,6 +9,5 @@ cuu~: asr r0 2: clr -(sp) sob r0,2b - jmp (r1) -1: sub r0,sp +1: sub r0,sp / if out of sob loop r0==0 jmp (r1) diff --git a/mach/pdp/libem/cmi4.s b/mach/pdp/libem/cmi4.s index 2f710fe23..ffc0b76aa 100644 --- a/mach/pdp/libem/cmi4.s +++ b/mach/pdp/libem/cmi4.s @@ -1,7 +1,6 @@ / $Header$ .text .globl cmi4~ -.globl save1~ cmi4~: mov (sp)+,r1 diff --git a/mach/pdp/libem/cmu4.s b/mach/pdp/libem/cmu4.s index 0cd6a9f3e..6525354c0 100644 --- a/mach/pdp/libem/cmu4.s +++ b/mach/pdp/libem/cmu4.s @@ -1,7 +1,6 @@ / $Header$ .text .globl cmu4~ - .globl save~,retu~ cmu4~: mov (sp)+,r1 clr r0 diff --git a/mach/pdp/libem/csb.s b/mach/pdp/libem/csb.s index e6de3bf58..f1505415f 100644 --- a/mach/pdp/libem/csb.s +++ b/mach/pdp/libem/csb.s @@ -6,7 +6,6 @@ ECASE = 20. csb~: - mov r3,-(sp) mov (r0)+,-(sp) mov (r0)+,r3 beq 1f @@ -19,8 +18,6 @@ csb~: 2: tst (sp)+ mov (r0),r1 4: beq 5f - mov (sp)+,r3 jmp (r1) -5: mov (sp)+,r3 - mov $ECASE,-(sp) +5: mov $ECASE,-(sp) jmp fat~ diff --git a/mach/pdp/libem/dup.s b/mach/pdp/libem/dup.s index 6230351a5..9d5863eb5 100644 --- a/mach/pdp/libem/dup.s +++ b/mach/pdp/libem/dup.s @@ -1,13 +1,12 @@ / $Header$ .text .globl dup~ -.globl save1~ dup~: - mov (sp)+,save1~ + mov (sp)+,r3 mov sp,r1 add r0,r1 asr r0 1: mov -(r1),-(sp) sob r0,1b - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/dvi.s b/mach/pdp/libem/dvi.s index ca4384b0b..0eb13ce78 100644 --- a/mach/pdp/libem/dvi.s +++ b/mach/pdp/libem/dvi.s @@ -1,10 +1,10 @@ / $Header$ .text .globl dvi~ -.globl save1~,unknown~,dvi4~ +.globl unknown~,dvi4~ dvi~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$04 bgt 1f beq 2f @@ -16,5 +16,5 @@ dvi~: 2: jsr pc,dvi4~ mov r1,-(sp) mov r0,-(sp) -3: jmp *save1~ +3: jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/dvu.s b/mach/pdp/libem/dvu.s index 16b65dd04..e27d99fb5 100644 --- a/mach/pdp/libem/dvu.s +++ b/mach/pdp/libem/dvu.s @@ -1,10 +1,10 @@ / $Header$ .text .globl dvu~ -.globl save1~,unknown~,dvu4~,dvu2~ +.globl unknown~,dvu4~,dvu2~ dvu~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$04 bgt 1f beq 2f @@ -14,5 +14,5 @@ dvu~: 2: jsr pc,dvu4~ mov r1,-(sp) mov r0,-(sp) -3: jmp *save1~ +3: jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/inn.s b/mach/pdp/libem/inn.s index 353cbcc6b..5d3266130 100644 --- a/mach/pdp/libem/inn.s +++ b/mach/pdp/libem/inn.s @@ -9,8 +9,7 @@ inn~: cmp r0,(sp) bcc 1f add sp,r0 - add $4,r0 - bitb bits(r1),(r0) + bitb bits(r1),4(r0) beq 1f mov $01,r0 br 2f diff --git a/mach/pdp/libem/lar.s b/mach/pdp/libem/lar.s index f20740ae8..ce4f92e9e 100644 --- a/mach/pdp/libem/lar.s +++ b/mach/pdp/libem/lar.s @@ -1,10 +1,9 @@ / $Header$ .text .globl lar~ -.globl save1~ lar~: - mov (sp)+,save1~ + mov (sp)+,r3 sub (r0),r1 mov 04(r0),r0 mul r0,r1 @@ -14,8 +13,8 @@ lar~: beq 1f 2: mov -(r1),-(sp) sob r0,2b - jmp *save1~ + jmp (r3) 1: clr r0 bisb -(r1),r0 mov r0,-(sp) - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/los2.s b/mach/pdp/libem/los2.s index 9c103072c..1caccea2b 100644 --- a/mach/pdp/libem/los2.s +++ b/mach/pdp/libem/los2.s @@ -1,17 +1,16 @@ / $Header$ .text .globl los2~ -.globl save1~ los2~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$01 bne 1f clr -(sp) bisb (r1),(sp) - jmp *save1~ + jmp (r3) 1: add r0,r1 asr r0 2: mov -(r1),-(sp) sob r0,2b - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/mli.s b/mach/pdp/libem/mli.s index aed370258..d9826fcbb 100644 --- a/mach/pdp/libem/mli.s +++ b/mach/pdp/libem/mli.s @@ -1,7 +1,7 @@ / $Header$ .text .globl mli~ -.globl save1~,unknown~,mli4~ +.globl unknown~,mli4~ mli~: cmp r0,$04 @@ -12,9 +12,9 @@ mli~: mul (sp)+,r1 mov r1,-(sp) jmp (r0) -2: mov (sp)+,save1~ +2: mov (sp)+,r3 jsr pc,mli4~ mov r1,-(sp) mov r0,-(sp) - jmp *save1~ + jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/mlu.s b/mach/pdp/libem/mlu.s index 970e7de69..9bd1328b1 100644 --- a/mach/pdp/libem/mlu.s +++ b/mach/pdp/libem/mlu.s @@ -1,7 +1,7 @@ / $Header$ .text .globl mlu~ -.globl save1~,unknown~,mlu4~ +.globl unknown~,mlu4~ mlu~: cmp r0,$04 @@ -12,9 +12,9 @@ mlu~: mul (sp)+,r1 mov r1,-(sp) jmp (r0) -2: mov (sp)+,save1~ +2: mov (sp)+,r3 jsr pc,mlu4~ mov r1,-(sp) mov r0,-(sp) - jmp *save1~ + jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/ngf.s b/mach/pdp/libem/ngf.s index 982aef786..a167ee887 100644 --- a/mach/pdp/libem/ngf.s +++ b/mach/pdp/libem/ngf.s @@ -4,8 +4,7 @@ .globl setfloat~ ngf~: - mov (sp)+,r1 jsr pc,setfloat~ - negf (sp) + negf 2(sp) setd - jmp (r1) + rts pc diff --git a/mach/pdp/libem/ret.s b/mach/pdp/libem/ret.s index 84d747fad..c20cd393d 100644 --- a/mach/pdp/libem/ret.s +++ b/mach/pdp/libem/ret.s @@ -1,7 +1,6 @@ / $Header$ .text .globl ret~,lfr~,retar -.globl save1~ .globl unknown~ / Size in r0 @@ -19,13 +18,13 @@ ret~: rts pc 9: jmp unknown~ lfr~: - mov (sp)+,save1~ + mov (sp)+,r3 asr r0 beq 4f mov $retar,r1 5: mov (r1)+,-(sp) sob r0,5b -4: jmp *save1~ +4: jmp (r3) .data retar: .=.+16. diff --git a/mach/pdp/libem/rmi.s b/mach/pdp/libem/rmi.s index cc0a6421e..d7f5e88cf 100644 --- a/mach/pdp/libem/rmi.s +++ b/mach/pdp/libem/rmi.s @@ -1,10 +1,10 @@ / $Header$ .text .globl rmi~ -.globl save1~,unknown~,rmi4~ +.globl unknown~,rmi4~ rmi~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$04 bgt 1f beq 2f @@ -16,5 +16,5 @@ rmi~: 2: jsr pc,rmi4~ mov r1,-(sp) mov r0,-(sp) -3: jmp *save1~ +3: jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/rmu.s b/mach/pdp/libem/rmu.s index bf43fd15d..995d89479 100644 --- a/mach/pdp/libem/rmu.s +++ b/mach/pdp/libem/rmu.s @@ -1,10 +1,10 @@ / $Header$ .text .globl rmu~ -.globl save1~,rmu2~,rmu4~,unknown~ +.globl rmu2~,rmu4~,unknown~ rmu~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$04 bgt 1f beq 2f @@ -12,9 +12,9 @@ rmu~: bne 1f jsr pc,rmu2~ mov r1,-(sp) - jmp *save1~ + jmp (r3) 2: jsr pc,rmu4~ mov r1,-(sp) mov r0,-(sp) - jmp *save1~ + jmp (r3) 1: jmp unknown~ diff --git a/mach/pdp/libem/sar.s b/mach/pdp/libem/sar.s index e65f03b7a..5e13b441a 100644 --- a/mach/pdp/libem/sar.s +++ b/mach/pdp/libem/sar.s @@ -1,10 +1,9 @@ / $Header$ .text .globl sar~ -.globl save1~ sar~: - mov (sp)+,save1~ + mov (sp)+,r3 sub (r0),r1 mov 04(r0),r0 mul r0,r1 @@ -13,6 +12,6 @@ sar~: beq 1f 2: mov (sp)+,(r1)+ sob r0,2b - jmp *save1~ + jmp (r3) 1: movb (sp)+,(r1) - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/save.s b/mach/pdp/libem/save.s index 165a3b9e1..7eac28664 100644 --- a/mach/pdp/libem/save.s +++ b/mach/pdp/libem/save.s @@ -1,6 +1,6 @@ / $Header$ .text -.globl save~,retu~,save1~ +.globl save~,retu~,savearea save~: mov r5,savearea @@ -23,4 +23,3 @@ retu~: .even savearea: .=.+12. -save1~: 0 diff --git a/mach/pdp/libem/sim.s b/mach/pdp/libem/sim.s index d6eb27c4b..8052f9eaf 100644 --- a/mach/pdp/libem/sim.s +++ b/mach/pdp/libem/sim.s @@ -1,12 +1,12 @@ / $Header$ .text .globl sim~ -.globl trpim~,save1~ +.globl trpim~ .float = 1 sim~: - mov (sp)+,save1~ + mov (sp)+,r3 mov (sp)+,r0 mov r0,trpim~ .if .float @@ -26,4 +26,4 @@ sim~: bic $0400,r1 0: ldfps r1 .endif - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/sli.s b/mach/pdp/libem/sli.s index 6baa79f81..cf704d2dc 100644 --- a/mach/pdp/libem/sli.s +++ b/mach/pdp/libem/sli.s @@ -1,17 +1,17 @@ / $Header$ .text .globl sli~ -.globl save1~,unknown~ +.globl unknown~ sli~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$02 bgt 1f mov (sp)+,r1 mov (sp)+,r0 ash r1,r0 mov r0,-(sp) - jmp *save1~ + jmp (r3) 1: cmp r0,$04 bgt 2f mov 02(sp),r0 @@ -19,5 +19,5 @@ sli~: ashc (sp)+,r0 mov r0,(sp) mov r1,02(sp) - jmp *save1~ + jmp (r3) 2: jmp unknown~ diff --git a/mach/pdp/libem/sri.s b/mach/pdp/libem/sri.s index 6e5771d05..2d3dc3852 100644 --- a/mach/pdp/libem/sri.s +++ b/mach/pdp/libem/sri.s @@ -1,11 +1,11 @@ / $Header$ .text .globl sri~ -.globl unknown~,save1~ +.globl unknown~ / Size in r0 sri~: - mov (sp)+,save1~ + mov (sp)+,r3~ cmp r0,$02 bgt 1f mov (sp)+,r1 @@ -13,7 +13,7 @@ sri~: neg r1 ash r1,r0 mov r0,-(sp) - jmp *save1~ + jmp (r3) 1: cmp r0,$04 bgt 2f mov 02(sp),r0 @@ -22,5 +22,5 @@ sri~: ashc (sp)+,r0 mov r0,(sp) mov r1,02(sp) - jmp *save1~ + jmp (r3) 2: jmp unknown~ diff --git a/mach/pdp/libem/sru.s b/mach/pdp/libem/sru.s index 716c546ab..c0481395d 100644 --- a/mach/pdp/libem/sru.s +++ b/mach/pdp/libem/sru.s @@ -1,19 +1,19 @@ / $Header$ .text .globl sru~,slu~ -.globl save1~,unknown~ +.globl unknown~ sru~: neg 2(sp) slu~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$02 bgt 1f mov 2(sp),r1 clr r0 ashc (sp)+,r0 2: mov r1,-(sp) - jmp *save1~ + jmp (r3) 1: cmp r0,$04 bgt 3f mov 02(sp),r0 @@ -27,5 +27,5 @@ slu~: ashc (sp)+,r0 4: mov r0,(sp) mov r1,02(sp) - jmp *save1~ + jmp (r3) 3: jmp unknown~ diff --git a/mach/pdp/libem/sto2.s b/mach/pdp/libem/sto2.s index 3019a7617..9609fd305 100644 --- a/mach/pdp/libem/sto2.s +++ b/mach/pdp/libem/sto2.s @@ -1,16 +1,15 @@ / $Header$ .text .globl sto2~ -.globl save1~ sto2~: - mov (sp)+,save1~ + mov (sp)+,r3 cmp r0,$01 bne 1f movb (sp),(r1) tst (sp)+ - jmp *save1~ + jmp (r3) 1: asr r0 2: mov (sp)+,(r1)+ sob r0,2b - jmp *save1~ + jmp (r3) diff --git a/mach/pdp/libem/trp.s b/mach/pdp/libem/trp.s index 695484113..af8795125 100644 --- a/mach/pdp/libem/trp.s +++ b/mach/pdp/libem/trp.s @@ -1,7 +1,7 @@ / $Header$ .text .globl trp~,fat~ -.globl trppc~,trpim~ +.globl trppc~,trpim~,savearea,retar write=4. fat~: @@ -28,12 +28,44 @@ trp~: movf r2,-(sp) movf r3,-(sp) stfps -(sp) + mov $savearea,r2 + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov $retar,r2 + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) + mov (r2)+,-(sp) mov r0,-(sp) mov trppc~,r0 beq 9f clr trppc~ jsr pc,(r0) tst (sp)+ + mov $retar+16.,r2 + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov $savearea+12.,r2 + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) + mov (sp)+,-(r2) ldfps (sp)+ movf (sp)+,r3 movf (sp)+,r2 -- 2.34.1