title COPY HUNKS QUICKLY (the quick brown hunk) ;The function COPY-HUNK takes a hunk as an argument, and returns an EQUAL ;hunk, using BLT to copy the elements of the hunk quickly. .FASL .insrt L;DEFNS > verprt HNKBLT .entry COPY-HUNK SUBR 002 retry: movei t,(a) ;Copy the argument lsh t,-seglog ;get the type bits move t,st(t) ;Get the segment table entry tlnn t,st.hnk ;Is it really a hunk? jrst nothnk ; Not really a hunk, give an error movei t,(t) ;Flush left half subi t,.atom HUNK2 ;get log of size of hunk movei b,(a) ;Save past the cons pushj p,@cnstab(t) ;CONS the right hunk movei tt,(a) ;BLT to the new hunk hrli tt,(b) ;from the old one xct blttab(t) ;perform the right blt retok: popj p, ;and return nothnk: jumpe a,retok ;Equal time for () wta [NOT A HUNK -- COPY-HUNK!] jrst retry ;If continued, A should have new value lossag: .lose irp x,,[alhnk0 alhnk1 alhnk2 alhnk3 alhnk4 alhnk5 alhnk6 alhnk7 alhnk8] .global x termin cnstab: alhnk0 alhnk1 alhnk2 alhnk3 alhnk4 alhnk5 alhnk6 alhnk7 alhnk8 lossag ;We've got hunk 1024 now? blttab: blt tt,(a) blt tt,1(a) blt tt,3(a) blt tt,7(a) blt tt,17(a) blt tt,37(a) blt tt,77(a) blt tt,177(a) blt tt,377(a) blt tt,777(a) .lose ;Hunk 1024??? fasend