.title $$falo Allocate memory for i/o subroutines .ident /000001/ ; ;+ ; ; Internal ; ; Index Allocate memory for i/o subroutines ; ; Usage ; ; mov size,r0 ;Memory needed ; call $$falo ;Allocate it ; ;return, r0 -> allocation ; ;no room: return to caller via $$fope ; ; Description ; ; A block of memory is allocated. If this fails, the return ; is to the caller of fopen (or fwild/fnext) with i/o control ; blocks deleted as necessary. ; ; Bugs ; ;- ; ; Edit history ; 000001 14-Oct-81 MM Split out from fopen.mac ; .iif ndf rsx rsx = 1 ;Assume RSX11M ; ; ** $$FALO ; ; Subroutine $$FALO is called with the space needed in ; R0. If it returns, R0 has a pointer to the free buffer. ; ; All other registers are preserved ; .psect c$code $$FALO:: CALL $$ALOC ;Call global allocator TST R0 ;Which returns NULL on error BEQ 10$ ;Yes, sorry. RETURN ;Got it this time. 10$: .if ne rsx MOV #IE.NBF,R0 ;Error code "No buffer space" .iff MOV #E$$NSP,R0 ;Error code "no buffer space" .endc JMP $$FOPE ;And exit .END