procedure seg,global nul = 0 ; ;called from fortran by the call ; call seg (instring,outstring,from,to) ; ; where instring= the input string (which is not changed) ; outstring= the output string to contain the ; segment from the instring ; from = pointer to first character of the segment ; wanted ; to = pointer to the last character of the segment ; wanted. ; ; from must be <= to ; ; ifb (r5) = #4 then ; we have a legal list of arguments probe (5)+ ; skip into argument list let r0 := (r5)+ ; fetch instring address let r1 := (5)+ ; fetch outstring address let r2 := @(5)+ ; fetch 'from' let r3 := @(5)+ ; fetch 'to' if r2 <= r3 then let r2 := r2 + r0 - #1 ; add offsets to pointers let r3 := r3 + r0 - #1 while r2 <= r3 do ; shovel .... letb (r1)+ := (r2)+ end ; shovel fi ; if we have an actual string to move letb (r1) := # ; put a null at end of string return ; to caller fi ; if have 4 arguments trap 0 .end