home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / flex 2.4.6 / alloca.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-29  |  631 b   |  27 lines  |  [TEXT/MPS ]

  1. /*
  2.  *    alloca.h
  3.  *
  4.  *    For use with MPW C
  5.  *
  6.  *    Based on "alloca.a" found in an old port of GNU e?grep
  7.  *    Franklin Chen
  8.  *    Fri, Apr 16, 1993
  9.  */
  10.  
  11. #ifndef ALLOCA_H
  12. #define ALLOCA_H
  13.  
  14. void *alloca (unsigned int size) =
  15.   {
  16.     0x201F, /*    move.l    (sp)+,d0    ; pop parameter = size in bytes */
  17.     0x5680, /*    addq.l    #3,d0        ; round size up to long word */
  18.     0x0280,
  19.     0xFFFF,
  20.     0xFFFC, /*    andi.l    #-4,d0        ; mask out lower two bits of size */
  21.     0x9FC0, /*    suba.l    d0,sp        ; allocate by moving stack pointer */
  22.     0x200F, /*    move.l    sp,d0        ; return pointer */
  23.     0x598F  /*    subq.l    #4,sp        ; new top of stack */
  24.   };
  25.  
  26. #endif    /* ALLOCA_H */
  27.