home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 256_01 / fun4ah.a < prev    next >
Text File  |  1988-01-08  |  2KB  |  55 lines

  1. ;---------------------------------------------------------------------
  2. ;    ASM88 FILE:     FUN4AH.A     Set Block Size (paragraphs)
  3. ;    ----------
  4. ;    WRITTEN:        25/10/87
  5. ;    -------
  6. ;    PURPOSE:        This is one of a series of files which take
  7. ;    -------         advantage of INT 21H functions under MS-DOS.
  8. ;                    In each case the error situation is marked by
  9. ;                    the carry flag being set.   We use the De Smet
  10. ;                    external variable '_carryf' to see whether the
  11. ;                    carry is set on return from the function.
  12. ;                    If so, the error code can be used to obtain
  13. ;                    information about the specific error.
  14. ;
  15. ;    USAGE:          int FUN4AH(num_par, seg_addr, &_carryf)
  16. ;    -----           int num_par, /* number of paragraphs needed */
  17. ;                        seg_addr; /* segment address of memory area */
  18. ;                    char *_carryf;
  19. ;
  20. ;    DEPENDENCIES:           De Smet C V 2.44+
  21. ;    ------------
  22. ;    Copyright 1987 - Cogar Computer Services Pty. Ltd
  23. ;---------------------------------------------------------------------
  24.  
  25. CSEG
  26. PUBLIC FUN4AH_
  27.  
  28. FUN4AH_:
  29.     push    bp    ; normal De Smet C start
  30.     mov    bp,sp    ; point to the stack
  31.     mov    ax,ds    ; and make ES common with DS
  32.     mov    es,ax
  33. ;----------------------------------------------------------------------
  34. ;  The unique programme follows.
  35. ;----------------------------------------------------------------------
  36.     mov    bx,[bp+4]    ; number of paragraphs of memory
  37.     mov    ax,[bp+6]    ; segment address
  38.     mov    es,ax
  39.     mov    ah,4ah    ; the Function No.
  40.     int    21h
  41.     jc    FUN4AH_ERROR
  42.     xor    ax,ax    ; prepare for normal return
  43.     jmp    FUN4AH_QUIT
  44. FUN4AH_ERROR:
  45.     mov    ax,bx    ; tell user number of available paragraphs
  46.     mov    si,[bp+8]    ; get address of '_carryf' variable
  47.     mov    byte [si],1    ; return with _carryf = 1
  48. ;----------------------------------------------------------------------
  49. ;  Normal programme termination.
  50. ;----------------------------------------------------------------------
  51. FUN4AH_QUIT:
  52.     pop    bp    ; restore starting conditions
  53.     ret
  54. ;----------------------------------------------------------------------
  55.