home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / mscwattc / elib / semaphor.asm < prev    next >
Encoding:
Assembly Source File  |  1992-01-14  |  734 b   |  43 lines

  1. PAGE    66,132
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. ;  semaphor
  11. ;
  12. ;  perform semaphor stuff
  13. ;
  14. ;  (c) 1990 University of Waterloo,
  15. ;           Faculty of Engineering,
  16. ;           Engineering Microcomputer Network Development Office
  17. ;
  18. ;
  19. ;
  20.     include masmdefs.hsm
  21.     include    model.hsm
  22.  
  23. codedef semaphor
  24. datadef
  25.  
  26. ;*************************************************************************
  27. ;  USAGE:  int sem_up( UINT far * p)
  28. ;       1 on failure
  29. ;       0 on success
  30. ;*************************************************************************
  31. cstart  semaphor
  32.  
  33. cpublic    sem_up
  34.     mov    AX, 1
  35.     push    di 
  36.     les    DI, +@AB [BP]        ; get pointer
  37.     xchg    AX, word ptr ES:[DI]    ; perform swap
  38.     pop        di
  39. creturn sem_up
  40.  
  41. cend    semaphor
  42.         end
  43.