.TITLE MEMMNG ... Memory management module .IDENT /300583/ .ENABL LC ; ; ; Written by Ray Di Marco ; 2-Feb-83. ; ; ; Version 020283/02 ; ; ;---------------------------------------------------------------------------- ; ; This module is responsible for managing free memory. It has two entry ; points. The MEMMNT entry must be used under TSX-plus; the MEMMNR entry ; is for use under RT-11. In both cases R0 must hold the number of bytes ; desired; on exit R0 will hold the address of the memory segment allocated. ; Note that the module aborts program execution if the desired amount of ; free memory is not available. ; ; .SBTTL Modifications ; ; 30-May-83 Support RTST/E ; .SBTTL Declarations ; ; .MCALL .SETTOP ; RT-11 .MCALL .PUSH,.POP,ABORT ; DBSLIB ; ; .GLOBL MEMMNT,MEMMNR,MEMMNE ; entry points ; ; ; .PSECT CODE ; open code area ; ====== ==== ; ; ; .SBTTL Code ; ; Issue RT-11 .SETTOP request to gain extra memory ; MEMMNR: ADD @#50,R0 ; R0 = new memtop .PUSH <@#50,R0> ; save old and new memtop .SETTOP R0 ; request desired memory CMP R0,(SP)+ ; got desired amount of memory? ABORT ,LO .POP R0 ; yes -> return ADD #2,R0 ; address memory RETURN ; done ; ; Running under RSTS/E. In this case must issue a EMT to RSTS/E ; to increase amount of memory available to job. ; MEMMNE: .PUSH R0 ; Save for later ADD @#50,R0 ; R0 = new memtop ADD #2047.,R0 ; round to ASH #-11.,R0 ; kw of memory BIC #^C31.,R0 ; R0 = number KW wanted INC R0 ; allow 1kw for emulator EMT 366 ; request memory ABORT ,CS .POP R0 ; restore R0 JMP MEMMNR ; do RT-11 .SETTOP now ; ; Running under TSX-plus. In this case must issue a EMT to TSX-plus ; to increase amount of memory available to job. ; MEMMNT: ADD @#50,R0 ; R0 = new memtop .PUSH <@#50,R0> ; save old and new memtop MOV #E.MEM,R0 ; R0 -> eab MOV (SP),2(R0) ; setup amount memory needed EMT 375 ; request new memory size CMP R0,(SP)+ ; got desired amount of memory? ABORT ,LO .POP R0 ; yes -> return ADD #2,R0 ; address memory RETURN ; done ; ; Emt argument block ; E.MEM: .BYTE 0,141,0,0 ; EAB change memory limits .END