some mods from Charles Lindsey

This commit is contained in:
ceriel 1988-10-04 13:59:51 +00:00
parent e1b871a6ea
commit a54c470fef
2 changed files with 26 additions and 18 deletions

View file

@ -1,18 +1,25 @@
# $Header$
# special version to work with A68S, by CHL
.globl .lpb
# compute AB, given LB
.lpb:
cmpl r0,fp
bneq L1
moval 4(ap),r0
rsb
L1:
movl fp,r1
movl 4(r0),r1 # mask for saved registers
addl2 $24,r0 # position of AB if no registers saved
movl $16,r2 # position of first bit to test
L2:
cmpl 12(r1),r0
beql L3
movl 12(r1),r1
subl3 r2,$28,r3 # remaining size of mask
ffs r2,r3,r1,r2 # find first bit set in mask
beql L3 # no more bits set
addl2 $4,r0 # for each saved register
incl r2
jbr L2
L3:
addl3 $4,8(r1),r0 # Argument Base = ap + 4
extzv $30,$2,r1,r2 # Now find out about the stack alignment
# between fp and ap
addl2 r2,r0 # add alignment
rsb

View file

@ -1,4 +1,5 @@
# $Header$
# revised version by CHL
.globl .strlb
# Store the value that is on the stack in fp.
# Compute ap.
@ -9,16 +10,16 @@
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
movl 4(fp),r3 # mask for saved registers
movl $16,r2 # position of first bit to test
L4:
subl3 r2,$28,r1 # remaining size of mask
ffs r2,r1,r3,r2 # find first bit set in mask
beql L5 # no more bits set
addl2 $4,ap # for each saved register
incl r2
jbr L4
L5:
extzv $14,$2,6(fp),r3 # Now find out about the stack alignment
# between fp and ap
addl2 r3,ap # add alignment