home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Pascal / HISOFTPASCAL2,0-2.DMS / in.adf / Units / Misc.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-05-20  |  858 b   |  61 lines

  1. unit Misc;
  2.  
  3. INTERFACE
  4. uses Exec;
  5.  
  6.  
  7. type
  8.     pMiscResource = ^tMiscResource;
  9.     tMiscResource = record
  10.         mr_Library: tLibrary;
  11.         mr_AllocArray: array [0..3] of long;
  12.         end;
  13.  
  14.  
  15.  
  16. var
  17.     MiscBase: pMiscResource;
  18.  
  19.  
  20. const
  21.     MR_SERIALPORT = 0;
  22.     MR_ALLOCMISCRESOURCE = $FFFFFFFA;
  23.     MR_PARALLELBITS = 3;
  24.     MR_FREEMISCRESOURCE = 0;
  25.     MR_PARALLELPORT = 2;
  26.     MISCNAME = 'misc.resource';
  27.     NUMMRTYPES = 4;
  28.     MR_SERIALBITS = 1;
  29.  
  30.  
  31. function AllocMiscResource
  32.         (unitNum: long;
  33.         name: STRPTR): STRPTR;
  34.  
  35. procedure FreeMiscResource (unitNum: long);
  36.  
  37.  
  38. IMPLEMENTATION
  39. function AllocMiscResource; xassembler;
  40. asm
  41.     move.l    a6,-(sp)
  42.     lea        8(sp),a6
  43.     move.l    (a6)+,a1
  44.     move.l    (a6)+,d0
  45.     move.l    MiscBase,a6
  46.     jsr        -6(a6)
  47.     move.l    d0,$10(sp)
  48.     move.l    (sp)+,a6
  49. end;
  50.  
  51. procedure FreeMiscResource; xassembler;
  52. asm
  53.     move.l    a6,-(sp)
  54.     move.l    8(sp),d0
  55.     move.l    MiscBase,a6
  56.     jsr        -$C(a6)
  57.     move.l    (sp)+,a6
  58. end;
  59.  
  60. end.
  61.