home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / psion / opp16f_zip / INCLUDE / OS / CALL.OPH < prev    next >
Encoding:
Text File  |  1996-02-26  |  906 b   |  40 lines

  1. /*
  2.  * Some usefull macros for handling OS calls.
  3.  *
  4.  * USAGE:
  5.  *
  6.  * Include OSREGS as either a local
  7.  * or global variable def, e.g local OSREGS
  8.  *
  9.  * Next set the appropriate register values AX, BX,...
  10.  *
  11.  * Then use the following OS call macros:
  12.  *
  13.  * OSFN(OS_fn_number)
  14.  * OSSUB(OS_fn_number,OS_sub_number)
  15.  *
  16.  * Any results will be in the registers AX,BX,... 
  17.  */
  18. #ifndef OS_CALL_OPH
  19. #define OS_CALL_OPH
  20.  
  21. #define OSREGS    axreg%,bxreg%,cxreg%,dxreg%,sireg%,direg%,osflags%
  22. #define AX    axreg%
  23. #define BX    bxreg%
  24. #define CX    cxreg%
  25. #define DX    dxreg%
  26. #define SI    sireg%
  27. #define DI    direg%
  28. #define OSFLAGS    osflags%
  29.  
  30. #define AH    peekb(addr(AX))
  31. #define AL    (AX and $ff)
  32. #define UL    (osflags% and 1)
  33. #define EQ    (osflags% and $40)
  34. #define SL    (osflags% and $80)
  35.  
  36. #define OSFN(fn)    OSFLAGS=os(fn,addr(AX))
  37. #define OSSUB(fn,sub)    AX=(sub|(AX and $ff)) :OSFLAGS=os(fn,addr(AX))
  38.  
  39. #endif
  40.