From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,5de3b8bd954d5ed6 X-Google-Attributes: gid1164f8,public From: wall@rndhse.enet.dec.com (David F. Wall) Subject: Re: Vax-11 Macro Date: 1996/04/17 Message-ID: <4l2q7c$vk8@zk2nws.zko.dec.com>#1/1 X-Deja-AN: 148163969 distribution: world references: <00001be4+00001892@msn.com> followup-to: comp.sys.dec organization: Digital Equipment Corporation keywords: Dynamic, memory, allocation reply-to: wall@rndhse.enet.dec.com (David F. Wall) newsgroups: comp.sys.dec In article <00001be4+00001892@msn.com>, JohnnyO@msn.com (John Olavesen) writes: >Is it possible to dynamically allocate memory in using VAX-11 Macro >assembly language? If so, how would you go about doing it? Sure it is. The assembler on OpenVMS Vax and compiler on OpenVMS Alpha do it all the time. Here's a simple user-mode, IPL 0, OpenVMS case: pushab my$memory_block ; Address of the allocated block to here pushl #512 ; How much I want (in bytes) calls #2,lib$get_vm ; Ask the system for it blbs r0,okay ; Go off and use it not_ok: ; Deal with maybe not getting it... And when you're done with it... pushab my$memory_block ; Address of address of block pushl #512 ; Size of block (in bytes) calls #2,lib$free_vm ; Fly, be free! It occurs to me that you may not be working on an OpenVMS system, but any other operating system that supports an VAX-11 MACRO assembler will also have in it someplace primitives for memory allocation and deallocation. Call them in the approved fashion and away you go. -- Me, not Digital David F. Wall (Digital Equipment Corp., Nashua, NH) UUCP ...!decwrl!rndhse.enet!wall Internet wall@rndhse.enet.dec.com - or - wall%rndhse.enet@decwrl.dec.com ---