.TITLE NAMRST STORAGE ALLOCATION SUBROUTINE .NLIST BEX .ENABL LC ; ; Pdp11/dcn basic operating system - storage allocation subroutine ; ; This module is designed to overlay the name server tables. it ; Uses .setto to determine the end of the area available and returns ; The address and extent of the area after clearing it. note that this ; Overlay segment must be the l*a*s*t. ; ; External symbols ; ; Entry symbols ; .GLOBL NAMRST ;this enemy is us ; ; System definitions ; .ASECT .MCALL .EXIT,.SETTO,.PRINT ;rt-11 definitions ; ; Procedure segment ; .PSECT $BOSI,RO,I ; ; Storage allocator subroutine ; R0 = length (bytes), returns r0 = region pointer ; NAMRST: MOV R1,-(SP) ;save base MOV @#50,R1 ADD R1,R0 ;compute upper limit MOV R0,-(SP) .SETTO MOV (SP)+,R0 CMP R0,@#50 ;did we get what we asked for BHI 3$ ;branch if no 1$: CMP R0,R1 BLOS 2$ CLR -(R0) BR 1$ ; 2$: MOV (SP)+,R1 RTS PC ; 3$: .PRINT #COM99 ;insufficient storage .EXIT ; ; Data segments ; .PSECT $BOSD,RO,D ; COM99: .ASCIZ '?INET-F-Insufficient storage' .EVEN ; .END