Fixed for Sparc
This commit is contained in:
parent
9ec49cb6d9
commit
9225ee6a80
2 changed files with 50 additions and 6 deletions
|
@ -16,7 +16,7 @@ IMPLEMENTATION MODULE CSP;
|
||||||
FROM Storage IMPORT Allocate, Deallocate;
|
FROM Storage IMPORT Allocate, Deallocate;
|
||||||
FROM Traps IMPORT Message;
|
FROM Traps IMPORT Message;
|
||||||
|
|
||||||
CONST WorkSpaceSize = 1000;
|
CONST WorkSpaceSize = 2000;
|
||||||
|
|
||||||
TYPE ByteAddress = POINTER TO BYTE;
|
TYPE ByteAddress = POINTER TO BYTE;
|
||||||
Channel = POINTER TO ChannelDescriptor;
|
Channel = POINTER TO ChannelDescriptor;
|
||||||
|
|
|
@ -21,7 +21,22 @@
|
||||||
; This implementation assumes a continuous stack growing downwards
|
; This implementation assumes a continuous stack growing downwards
|
||||||
|
|
||||||
exp $topsize
|
exp $topsize
|
||||||
|
#ifdef __sparc
|
||||||
|
inp $topsize2
|
||||||
|
pro $topsize, 0
|
||||||
|
mes 11
|
||||||
|
zer EM_PSIZE
|
||||||
|
lal 0
|
||||||
|
loi EM_PSIZE
|
||||||
|
cal $topsize2
|
||||||
|
asp 2*EM_PSIZE
|
||||||
|
lfr EM_WSIZE
|
||||||
|
ret EM_WSIZE
|
||||||
|
end 0
|
||||||
|
pro $topsize2, 3*EM_WSIZE+3*EM_PSIZE
|
||||||
|
#else
|
||||||
pro $topsize, 3*EM_WSIZE+3*EM_PSIZE
|
pro $topsize, 3*EM_WSIZE+3*EM_PSIZE
|
||||||
|
#endif
|
||||||
; local space for line-number, ignoremask, filename, stack-break, size,
|
; local space for line-number, ignoremask, filename, stack-break, size,
|
||||||
; and stack-pointer (see the topsave routine)
|
; and stack-pointer (see the topsave routine)
|
||||||
mes 11
|
mes 11
|
||||||
|
@ -33,6 +48,9 @@
|
||||||
zne *1
|
zne *1
|
||||||
lxl 0
|
lxl 0
|
||||||
dch ; local base of caller
|
dch ; local base of caller
|
||||||
|
#ifdef __sparc
|
||||||
|
dch ; because of the extra layer
|
||||||
|
#endif
|
||||||
lal 0
|
lal 0
|
||||||
loi EM_PSIZE
|
loi EM_PSIZE
|
||||||
sti EM_PSIZE
|
sti EM_PSIZE
|
||||||
|
@ -51,7 +69,21 @@
|
||||||
end 3*EM_WSIZE+3*EM_PSIZE
|
end 3*EM_WSIZE+3*EM_PSIZE
|
||||||
|
|
||||||
exp $topsave
|
exp $topsave
|
||||||
|
#ifdef __sparc
|
||||||
|
inp $topsave2
|
||||||
pro $topsave,0
|
pro $topsave,0
|
||||||
|
mes 11
|
||||||
|
lal 0
|
||||||
|
loi 2*EM_PSIZE
|
||||||
|
cal $topsave2
|
||||||
|
asp 2*EM_PSIZE
|
||||||
|
lfr EM_WSIZE
|
||||||
|
ret EM_WSIZE
|
||||||
|
end 0
|
||||||
|
pro $topsave2,0
|
||||||
|
#else
|
||||||
|
pro $topsave, 0
|
||||||
|
#endif
|
||||||
mes 11
|
mes 11
|
||||||
loe 0
|
loe 0
|
||||||
lae 4 ; load line number and file name
|
lae 4 ; load line number and file name
|
||||||
|
@ -82,7 +114,20 @@ sv
|
||||||
bss EM_PSIZE,0,0
|
bss EM_PSIZE,0,0
|
||||||
|
|
||||||
exp $topload
|
exp $topload
|
||||||
|
#ifdef __sparc
|
||||||
|
inp $topload1
|
||||||
pro $topload,0
|
pro $topload,0
|
||||||
|
lal 0
|
||||||
|
loi EM_PSIZE
|
||||||
|
cal $topload1
|
||||||
|
asp EM_PSIZE
|
||||||
|
lfr EM_WSIZE
|
||||||
|
ret EM_WSIZE
|
||||||
|
end 0
|
||||||
|
pro $topload1, 0
|
||||||
|
#else
|
||||||
|
pro $topload, 0
|
||||||
|
#endif
|
||||||
mes 11
|
mes 11
|
||||||
|
|
||||||
lal 0
|
lal 0
|
||||||
|
@ -98,7 +143,7 @@ sv
|
||||||
loi EM_PSIZE
|
loi EM_PSIZE
|
||||||
cmp ; find another LB first
|
cmp ; find another LB first
|
||||||
zgt *1
|
zgt *1
|
||||||
dch ; just follow dinamic chain to make sure we find
|
dch ; just follow dynamic chain to make sure we find
|
||||||
; a legal one
|
; a legal one
|
||||||
bra *2
|
bra *2
|
||||||
1
|
1
|
||||||
|
@ -112,13 +157,12 @@ sv
|
||||||
lae sv
|
lae sv
|
||||||
loi EM_PSIZE ; source address
|
loi EM_PSIZE ; source address
|
||||||
lor 1
|
lor 1
|
||||||
adp EM_PSIZE ; destimation address
|
adp EM_PSIZE ; destination address
|
||||||
lae sv
|
lae sv
|
||||||
loi EM_PSIZE
|
loi EM_PSIZE
|
||||||
adp EM_PSIZE
|
adp EM_PSIZE
|
||||||
loi EM_WSIZE ; size of block
|
loi EM_WSIZE ; size of block
|
||||||
bls EM_WSIZE ; move block back (SP becomes the SP AFTER again,
|
bls EM_WSIZE
|
||||||
; because of the asp -EM_PSIZE!)
|
|
||||||
asp EM_PSIZE+EM_WSIZE ; drop size + SP
|
asp EM_PSIZE+EM_WSIZE ; drop size + SP
|
||||||
str 0 ; restore local base
|
str 0 ; restore local base
|
||||||
sim ; ignore mask
|
sim ; ignore mask
|
||||||
|
@ -126,5 +170,5 @@ sv
|
||||||
sti EM_PSIZE
|
sti EM_PSIZE
|
||||||
ste 0 ; line and file
|
ste 0 ; line and file
|
||||||
loc 0
|
loc 0
|
||||||
ret EM_WSIZE ; return 0
|
ret EM_WSIZE
|
||||||
end 0
|
end 0
|
||||||
|
|
Loading…
Reference in a new issue