ack/lang/occam/lib/par_misc.e

129 lines
2.1 KiB
Plaintext
Raw Normal View History

1987-02-25 16:41:09 +00:00
#
mes 2,EM_WSIZE,EM_PSIZE
exp $top_size
1991-09-25 15:04:05 +00:00
#ifdef __sparc
inp $top_size2
pro $top_size, 0
mes 11
zer EM_PSIZE
lal 0
loi EM_PSIZE
cal $top_size2
asp 2*EM_PSIZE
lfr EM_WSIZE
ret EM_WSIZE
end 0
pro $top_size2, 3*EM_WSIZE+3*EM_PSIZE
#else
1987-02-25 16:41:09 +00:00
pro $top_size, 3*EM_WSIZE+3*EM_PSIZE
1991-09-25 15:04:05 +00:00
#endif
1987-02-25 16:41:09 +00:00
mes 11
lal 0
loi EM_PSIZE ; s_brk
lor 1 ; s_brk SP
sbs EM_PSIZE ; s_brk-SP
ret EM_PSIZE ; return size of block to be saved
end 3*EM_WSIZE+3*EM_PSIZE
exp $top_save
1991-09-25 15:04:05 +00:00
#ifdef __sparc
inp $top_save2
pro $top_save,0
mes 11
lal 0
loi 2*EM_PSIZE
cal $top_save2
asp 2*EM_PSIZE
lfr EM_WSIZE
ret EM_WSIZE
end 0
pro $top_save2,0
#else
1987-02-25 16:41:09 +00:00
pro $top_save, 0
1991-09-25 15:04:05 +00:00
#endif
1988-02-15 18:08:46 +00:00
mes 11
1987-02-25 16:41:09 +00:00
loe 0
lae 4 ; load line number and file name
loi EM_PSIZE
lim ; ignore mask
lor 0 ; LB
lal 0
loi EM_PSIZE ; size of block
loc EM_PSIZE
loc EM_WSIZE
cuu
dup EM_WSIZE
stl 0 ; push & store size in 2 bytes
lor 1 ; SP (the SP BEFORE pushing)
lor 1 ; SP (address of stack top to save)
lal EM_PSIZE ; area
loi EM_PSIZE
lol 0 ; size
bls EM_WSIZE ; move whole block
asp 3*EM_PSIZE+3*EM_WSIZE ; remove the lot from the stack
loc 1
ret EM_WSIZE ; return 1
end 0
1991-09-25 15:04:05 +00:00
sv
bss EM_PSIZE, 0, 0
1987-02-25 16:41:09 +00:00
exp $top_load
1991-09-25 15:04:05 +00:00
#ifdef __sparc
inp $top_load1
pro $top_load,0
lal 0
loi EM_PSIZE
cal $top_load1
asp EM_PSIZE
lfr EM_WSIZE
ret EM_WSIZE
end 0
pro $top_load1, 0
#else
1987-02-25 16:41:09 +00:00
pro $top_load, 0
1991-09-25 15:04:05 +00:00
#endif
1988-02-15 18:08:46 +00:00
mes 11
1987-02-25 16:41:09 +00:00
lal 0
loi EM_PSIZE
1991-09-25 15:04:05 +00:00
lae sv
sti EM_PSIZE
lxl 0
2
1987-02-25 16:41:09 +00:00
dup EM_PSIZE
1991-09-25 15:04:05 +00:00
adp -3*EM_PSIZE
1988-02-15 18:08:46 +00:00
lal 0
1991-09-25 15:04:05 +00:00
loi EM_PSIZE ; compare target SP with current LB to see if we must
loi EM_PSIZE
cmp ; find another LB first
zgt *1
dch ; just follow dynamic chain to make sure we find
; a legal one
bra *2
1
str 0
lae sv
loi EM_PSIZE
1988-02-15 18:08:46 +00:00
loi EM_PSIZE
1987-02-25 16:41:09 +00:00
str 1 ; restore SP
1991-09-25 15:04:05 +00:00
asp -EM_PSIZE
lae sv
loi EM_PSIZE
1987-02-25 16:41:09 +00:00
lor 1 ; SP (the SP AFTER, see above)
adp EM_PSIZE
1991-09-25 15:04:05 +00:00
lae sv
1987-02-25 16:41:09 +00:00
loi EM_PSIZE
lof EM_PSIZE ; size of block
bls EM_WSIZE ; move block back (SP becomes the SP BEFORE again!)
1991-09-25 15:04:05 +00:00
asp EM_WSIZE+EM_PSIZE ; drop size + SP
1987-02-25 16:41:09 +00:00
str 0 ; LB
sim ; ignore mask
1987-02-25 16:58:32 +00:00
lae 4
1987-02-25 16:41:09 +00:00
sti EM_PSIZE
ste 0 ; line and file
loc 0
ret EM_WSIZE ; return 0
end 0