home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 287_02 / stack.asm < prev    next >
Encoding:
Assembly Source File  |  1989-05-23  |  1.4 KB  |  62 lines

  1.         TITLE   VHLN of GDS
  2.         page    60,132
  3.         .SFCOND
  4. ;
  5. ; *==========================================================*
  6. ; * This file contain level 1 horizontal line, vertical line *
  7. ; * drawing and dot plotting routines                        *
  8. ; *==========================================================*
  9.  
  10. IFDEF   COLOR
  11.   IFDEF HERC
  12.    .err both display type defined
  13.   ENDIF
  14. else
  15.   IFNDEF HERC
  16.     HERC equ 0
  17.   ENDIF
  18. ENDIF
  19.  
  20. smo     equ     4       ; small model offset value
  21.  
  22. DGROUP  group   _DATA
  23. _DATA   segment word public 'DATA'
  24.         assume  ds:DGROUP
  25.         extrn   ___brklvl:word
  26. _DATA   ends
  27.  
  28. _TEXT   segment byte public 'CODE'
  29.         assume  cs:_TEXT,ds:DGROUP
  30.  
  31.         public  _stackavail,_alloca
  32.  
  33. _stackavail proc near
  34.         pop     cx
  35.         cmp     ___brklvl,sp
  36.         jb      stka10
  37.         xor     ax,ax
  38.         jmp     cx
  39. stka10: mov     ax,sp
  40.         sub     ax,___brklvl
  41.         jmp     cx
  42. _stackavail endp
  43.  
  44. _alloca proc    near
  45.         pop     cx
  46.         pop     dx
  47.         inc     dx
  48.         and     dl,0feh
  49.         mov     bx,sp
  50.         sub     sp,dx
  51.         mov     ax,sp
  52.         push    [bx+2]
  53.         push    [bx]
  54.         push    dx
  55.         jmp     cx
  56. _alloca endp
  57.  
  58. _TEXT   ends
  59.         end
  60.  
  61.  
  62.