home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / lang / getpargs.sha / allocpval.s next >
Text File  |  1985-01-17  |  534b  |  22 lines

  1. | allocpval - Allocate space on the stack for a pascal return value.
  2. |
  3. | Allocates the requested number of bytes (must be even) on top of the stack.
  4. | A pointer to the allocated area is returned.
  5. |
  6. |    pointer = allocpval(numbytes);
  7. |
  8. | The allocated space should be freed with freepval.
  9. |
  10. | History
  11. | 01/10/84    Moy    Created.
  12. |
  13.     .globl    allocpval
  14. allocpval:
  15.     movl    sp,a0        | current stack position
  16.     subl    sp@(4),a0    | new stack top
  17.     movl    sp@,a0@        | move return address
  18.     movl    a0,sp        | adjust stack
  19.     movl    sp,d0
  20.     addql    #8,d0        | return value
  21.     rts
  22.