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

  1. unit Exec;
  2.  
  3. INTERFACE
  4. type
  5.     pshortint = ^shortint;
  6.     ppshortint = ^pshortint;
  7.     pppshortint = ^ppshortint;
  8.     pbyte = ^byte;
  9.     ppbyte = ^pbyte;
  10.     pppbyte = ^ppbyte;
  11.     pinteger = ^integer;
  12.     ppinteger = ^pinteger;
  13.     pword = ^word;
  14.     plongint = ^longint;
  15.     pplongint = ^plongint;
  16.     long = longint;
  17.     plong = ^longint;
  18.     ppointer = ^pointer;
  19.     STRPTR = ^byte;
  20.  
  21.     pNode = ^tNode;
  22.     tNode = record
  23.         ln_Succ: pNode;
  24.         ln_Pred: pNode;
  25.         ln_Type: byte;
  26.         ln_Pri: shortint;
  27.         ln_Name: pbyte;
  28.         end;
  29.  
  30.     pMsgPort = ^tMsgPort;
  31.     pMessage = ^tMessage;
  32.     tMessage = record
  33.         mn_Node: tNode;
  34.         mn_ReplyPort: pMsgPort;
  35.         mn_Length: word;
  36.         end;
  37.  
  38.     pList = ^tList;
  39.     tList = record
  40.         lh_Head: pNode;
  41.         lh_Tail: pNode;
  42.         lh_TailPred: pNode;
  43.         lh_Type: byte;
  44.         l_pad: byte;
  45.         end;
  46.  
  47.     pMemEntry = ^tMemEntry;
  48.     tMemEntry = record
  49.         case integer of
  50.         0: (
  51.         me_Reqs: long;
  52.         );
  53.         1: (
  54.         me_Addr: pointer;
  55.         me_Length: long;
  56.         );
  57.         end;
  58.  
  59.     pInterrupt = ^tInterrupt;
  60.     pTask = ^tTask;
  61.     tMsgPort = record
  62.         mp_Node: tNode;
  63.         mp_Flags: byte;
  64.         mp_SigBit: byte;
  65.         case integer of
  66.         0: (
  67.         mp_SoftInt: pInterrupt;
  68.         );
  69.         1: (
  70.         sm_LockMsg: pMessage;
  71.         );
  72.         2: (
  73.         mp_SigTask: pTask;
  74.         mp_MsgList: tList;
  75.         );
  76.         end;
  77.  
  78.     pSoftIntList = ^tSoftIntList;
  79.     tSoftIntList = record
  80.         sh_List: tList;
  81.         sh_Pad: word;
  82.         end;
  83.  
  84.     pUnit = ^tUnit;
  85.     tUnit = record
  86.         unit_MsgPort: tMsgPort;
  87.         unit_flags: byte;
  88.         unit_pad: byte;
  89.         unit_OpenCnt: word;
  90.         end;
  91.  
  92.     pIntVector = ^tIntVector;
  93.     tIntVector = record
  94.         iv_Data: pointer;
  95.         iv_Code: pointer;
  96.         iv_Node: pNode;
  97.         end;
  98.  
  99.     pLibrary = ^tLibrary;
  100.     tLibrary = record
  101.         lib_Node: tNode;
  102.         lib_Flags: byte;
  103.         lib_pad: byte;
  104.         lib_NegSize: word;
  105.         lib_PosSize: word;
  106.         lib_Version: word;
  107.         lib_Revision: word;
  108.         lib_IdString: pointer;
  109.         lib_Sum: long;
  110.         lib_OpenCnt: word;
  111.         end;
  112.  
  113.     pResident = ^tResident;
  114.     tResident = record
  115.         rt_MatchWord: word;
  116.         rt_MatchTag: pResident;
  117.         rt_EndSkip: pointer;
  118.         rt_Flags: byte;
  119.         rt_Version: byte;
  120.         rt_Type: byte;
  121.         rt_Pri: shortint;
  122.         rt_Name: pbyte;
  123.         rt_IdString: pbyte;
  124.         rt_Init: pointer;
  125.         end;
  126.  
  127.     pSemaphore = ^tSemaphore;
  128.     tSemaphore = record
  129.         sm_MsgPort: tMsgPort;
  130.         sm_Bids: integer;
  131.         end;
  132.  
  133.     pMinNode = ^tMinNode;
  134.     pMinList = ^tMinList;
  135.     tMinList = record
  136.         mlh_Head: pMinNode;
  137.         mlh_Tail: pMinNode;
  138.         mlh_TailPred: pMinNode;
  139.         end;
  140.  
  141.     tMinNode = record
  142.         mln_Succ: pMinNode;
  143.         mln_Pred: pMinNode;
  144.         end;
  145.  
  146.     pSemaphoreRequest = ^tSemaphoreRequest;
  147.     tSemaphoreRequest = record
  148.         sr_Link: tMinNode;
  149.         sr_Waiter: pTask;
  150.         end;
  151.  
  152.     pSignalSemaphore = ^tSignalSemaphore;
  153.     tSignalSemaphore = record
  154.         ss_Link: tNode;
  155.         ss_NestCount: integer;
  156.         ss_WaitQueue: tMinList;
  157.         ss_MultipleLink: tSemaphoreRequest;
  158.         ss_Owner: pTask;
  159.         ss_QueueCount: integer;
  160.         end;
  161.  
  162.     pDevice = ^tDevice;
  163.     pIOStdReq = ^tIOStdReq;
  164.     tIOStdReq = record
  165.         io_Message: tMessage;
  166.         io_Device: pDevice;
  167.         io_Unit: pUnit;
  168.         io_Command: word;
  169.         io_Flags: byte;
  170.         io_Error: shortint;
  171.         io_Actual: long;
  172.         io_Length: long;
  173.         io_Data: pointer;
  174.         io_Offset: long;
  175.         end;
  176.  
  177.     pExecBase = ^tExecBase;
  178.     tExecBase = record
  179.         LibNode: tLibrary;
  180.         SoftVer: word;
  181.         LowMemChkSum: integer;
  182.         ChkBase: long;
  183.         ColdCapture: pointer;
  184.         CoolCapture: pointer;
  185.         WarmCapture: pointer;
  186.         SysStkUpper: pointer;
  187.         SysStkLower: pointer;
  188.         MaxLocMem: long;
  189.         DebugEntry: pointer;
  190.         DebugData: pointer;
  191.         AlertData: pointer;
  192.         MaxExtMem: pointer;
  193.         ChkSum: word;
  194.         IntVects: array [0..15] of tIntVector;
  195.         ThisTask: pTask;
  196.         IdleCount: long;
  197.         DispCount: long;
  198.         Quantum: word;
  199.         Elapsed: word;
  200.         SysFlags: word;
  201.         IDNestCnt: shortint;
  202.         TDNestCnt: shortint;
  203.         AttnFlags: word;
  204.         AttnResched: word;
  205.         ResModules: pointer;
  206.         TaskTrapCode: pointer;
  207.         TaskExceptCode: pointer;
  208.         TaskExitCode: pointer;
  209.         TaskSigAlloc: long;
  210.         TaskTrapAlloc: word;
  211.         MemList: tList;
  212.         ResourceList: tList;
  213.         DeviceList: tList;
  214.         IntrList: tList;
  215.         LibList: tList;
  216.         PortList: tList;
  217.         TaskReady: tList;
  218.         TaskWait: tList;
  219.         SoftInts: array [0..4] of tSoftIntList;
  220.         LastAlert: array [0..3] of longint;
  221.         VBlankFrequency: byte;
  222.         PowerSupplyFrequency: byte;
  223.         SemaphoreList: tList;
  224.         KickMemPtr: pointer;
  225.         KickTagPtr: pointer;
  226.         KickCheckSum: pointer;
  227.         ExecBaseReserved: array [0..9] of byte;
  228.         ExecBaseNewReserved: array [0..19] of byte;
  229.         end;
  230.  
  231.     pMemChunk = ^tMemChunk;
  232.     pMemHeader = ^tMemHeader;
  233.     tMemHeader = record
  234.         mh_Node: tNode;
  235.         mh_Attributes: word;
  236.         mh_First: pMemChunk;
  237.         mh_Lower: pointer;
  238.         mh_Upper: pointer;
  239.         mh_Free: long;
  240.         end;
  241.  
  242.     tInterrupt = record
  243.         is_Node: tNode;
  244.         is_Data: pointer;
  245.         is_Code: pointer;
  246.         end;
  247.  
  248.     tMemChunk = record
  249.         mc_Next: pMemChunk;
  250.         mc_Bytes: long;
  251.         end;
  252.  
  253.     tDevice = record
  254.         dd_Library: tLibrary;
  255.         end;
  256.  
  257.     pIORequest = ^tIORequest;
  258.     tIORequest = record
  259.         io_Message: tMessage;
  260.         io_Device: pDevice;
  261.         io_Unit: pUnit;
  262.         io_Command: word;
  263.         io_Flags: byte;
  264.         io_Error: shortint;
  265.         end;
  266.  
  267.     pMemList = ^tMemList;
  268.     tMemList = record
  269.         ml_Node: tNode;
  270.         ml_NumEntries: word;
  271.         end;
  272.  
  273.     tTask = record
  274.         tc_Node: tNode;
  275.         tc_Flags: byte;
  276.         tc_State: byte;
  277.         tc_IDNestCnt: shortint;
  278.         tc_TDNestCnt: shortint;
  279.         tc_SigAlloc: long;
  280.         tc_SigWait: long;
  281.         tc_SigRecvd: long;
  282.         tc_SigExcept: long;
  283.         tc_TrapAlloc: word;
  284.         tc_TrapAble: word;
  285.         tc_ExceptData: pointer;
  286.         tc_ExceptCode: pointer;
  287.         tc_TrapData: pointer;
  288.         tc_TrapCode: pointer;
  289.         tc_SPReg: pointer;
  290.         tc_SPLower: pointer;
  291.         tc_SPUpper: pointer;
  292.         tc_Switch: pointer;
  293.         tc_Launch: pointer;
  294.         tc_MemEntry: tList;
  295.         tc_UserData: pointer;
  296.         end;
  297.  
  298.  
  299.  
  300. const
  301.     NT_SOFTINT = $B;
  302.     AN_FreeVec = $7000005;
  303.     AN_IconLib = $9000000;
  304.     BYTEMASK = $FF;
  305.     TS_RUN = 2;
  306.     AO_IconLib = $8009;
  307.     AN_MathLib = $5000000;
  308.     AN_TMBadSupply = $15000002;
  309.     AG_OpenLib = $30000;
  310.     AO_MathLib = $8005;
  311.     AN_BitMap = $7000007;
  312.     TB_SWITCH = 6;
  313.     AN_BadState = $8400000C;
  314.     NT_MSGPORT = 4;
  315.     AN_InitAPtr = $81000007;
  316.     AN_TrackDiskDev = $14000000;
  317.     TF_SWITCH = $40;
  318.     AO_TrackDiskDev = $8014;
  319.     NT_UNKNOWN = 0;
  320.     MEMF_LARGEST = $20000;
  321.     LIB_RESERVED = 4;
  322.     SF_ALERTWACK = 2;
  323.     RTF_COLDSTART = 1;
  324.     LIB_OPEN = $FFFFFFFA;
  325.     AG_OpenDev = $40000;
  326.     AN_EndTask = $7000002;
  327.     AN_GamePortDev = $12000000;
  328.     NULL = 0;
  329.     TS_EXCEPT = 5;
  330.     SIGB_DOS = 8;
  331.     AO_GamePortDev = $8012;
  332.     AN_KeyFree = $7000008;
  333.     AN_PlaneAlloc = $84010005;
  334.     AN_AudioDev = $10000000;
  335.     AO_AudioDev = $8010;
  336.     LIBF_SUMMING = 1;
  337.     SIGF_DOS = $100;
  338.     AG_NoSignal = $70000;
  339.     AN_MakeVPort = $82010030;
  340.     TRUE_ = 1;
  341.     AN_ItemAlloc = $4010003;
  342.     AN_SubAlloc = $4010004;
  343.     AN_WeirdEcho = $8400000E;
  344.     INTB_NMI = $F;
  345.     CMD_INVALID = 0;
  346.     IOERR_BADLENGTH = $FFFFFFFC;
  347.     AN_LongFrame = $82010006;
  348.     AN_KeyRange = $700000B;
  349.     AN_BadExpansionFree = $A000001;
  350.     DEV_BEGINIO = $FFFFFFE2;
  351.     UNITF_ACTIVE = 1;
  352.     LIBF_SUMUSED = 4;
  353.     AN_FreeTwice = $81000009;
  354.     AN_GraphicsLib = $2000000;
  355.     INTF_NMI = $8000;
  356.     LIB_VECTSIZE = 6;
  357.     LIBF_DELEXP = 8;
  358.     AG_OpenRes = $50000;
  359.     AO_GraphicsLib = $8002;
  360.     NT_MEMORY = $A;
  361.     NT_SIGNALSEM = $F;
  362.     NT_SEMAPHORE = $E;
  363.     TB_STACKCHK = 4;
  364.     AN_LayersNoMem = $83010000;
  365.     RTW_NEVER = 0;
  366.     RTW_COLDSTART = 1;
  367.     MEMF_PUBLIC = 1;
  368.     CMD_STOP = 6;
  369.     AN_BadOverlay = $700000C;
  370.     LIB_USERDEF = $FFFFFFE2;
  371.     AN_TimerDev = $15000000;
  372.     TF_STACKCHK = $10;
  373.     TS_READY = 3;
  374.     AO_TimerDev = $8015;
  375.     AN_IntrMem = $81000006;
  376.     AN_ItemBoxTop = $84000006;
  377.     AN_KeyboardDev = $13000000;
  378.     SIGB_SINGLE = 4;
  379.     AO_KeyboardDev = $8013;
  380.     AN_LayersLib = $3000000;
  381.     AO_LayersLib = $8003;
  382.     AN_GfxNoLCM = $82011234;
  383.     AN_GadgetType = $84000001;
  384.     AN_DiskRsrc = $21000000;
  385.     SIGF_SINGLE = $10;
  386.     UNITF_INTASK = 2;
  387.     AO_DiskRsrc = $8021;
  388.     AN_RAMLib = $8000000;
  389.     AN_MiscRsrc = $22000000;
  390.     AN_DiskCopy = $32000000;
  391.     AO_RAMLib = $8008;
  392.     AO_MiscRsrc = $8022;
  393.     AN_OpenScreen = $84010007;
  394.     AN_ConsoleDev = $11000000;
  395.     SIGB_CHILD = 1;
  396.     AO_ConsoleDev = $8011;
  397.     DEV_ABORTIO = $FFFFFFDC;
  398.     RTM_WHEN = 3;
  399.     AN_NoConsole = $8400000F;
  400.     MEMF_CLEAR = $10000;
  401.     AN_DOSLib = $7000000;
  402.     SIGF_CHILD = 2;
  403.     IOERR_NOCMD = $FFFFFFFD;
  404.     AO_DOSLib = $8007;
  405.     AN_StartMem = $7010001;
  406.     AN_AsyncPkt = $7000004;
  407.     LIB_EXPUNGE = $FFFFFFEE;
  408.     AN_OpenScrnRast = $84010008;
  409.     LIB_EXTFUNC = $FFFFFFE8;
  410.     AG_NoMemory = $10000;
  411.     AN_CreatePort = $84010002;
  412.     RTF_AUTOINIT = $80;
  413.     AN_DiskError = $700000A;
  414.     SYSBASESIZE = $24C;
  415.     AN_ExcptVect = $81000001;
  416.     AN_ShortFrame = $82010007;
  417.     AN_TDCalibSeek = $14000001;
  418.     AN_CIARsrc = $20000000;
  419.     AN_DRIntNoAct = $21000002;
  420.     AFB_68010 = 0;
  421.     AO_CIARsrc = $8020;
  422.     AN_TextTmpRas = $2010009;
  423.     AFB_68020 = 1;
  424.     TB_PROCTIME = 0;
  425.     AN_AddSWGadget = $8401000A;
  426.     AN_TMBadReq = $15000001;
  427.     SIH_PRIMASK = $F0;
  428.     AFF_68010 = 1;
  429.     NT_BOOTNODE = $10;
  430.     CMD_UPDATE = 4;
  431.     AFF_68020 = 2;
  432.     AFB_RESERVED8 = 8;
  433.     TF_PROCTIME = 1;
  434.     AFB_RESERVED9 = 9;
  435.     AN_ExpansionLib = $A000000;
  436.     AO_ExpansionLib = $800A;
  437.     AN_BootStrap = $30000000;
  438.     AN_BootError = $30000001;
  439.     AO_BootStrap = $8030;
  440.     AN_BogusExcpt = $8100000A;
  441.     SIGB_ABORT = 0;
  442.     AN_DRHasDisk = $21000001;
  443.     AN_Workbench = $31000000;
  444.     NT_TASK = 1;
  445.     AO_Workbench = $8031;
  446.     FALSE_ = 0;
  447.     CMD_CLEAR = 5;
  448.     IOERR_OPENFAIL = $FFFFFFFF;
  449.     AN_OpenWindow = $8401000B;
  450.     SIGF_ABORT = 1;
  451.     LIBF_CHANGED = 2;
  452.     AFB_68881 = 4;
  453.     NT_FONT = $C;
  454.     AN_MemCorrupt = $81000005;
  455.     NT_INTERRUPT = 2;
  456.     NT_RESOURCE = 8;
  457.     TS_WAIT = 4;
  458.     AFF_68881 = $10;
  459.     LIBRARY_VERSION = $22;
  460.     NT_MESSAGE = 5;
  461.     AN_SysScrnType = $84000009;
  462.     AN_RegionMemory = $8201000B;
  463.     CMD_NONSTD = 9;
  464.     AN_SemCorrupt = $81000008;
  465.     NT_FREEMSG = 6;
  466.     MEM_BLOCKMASK = 7;
  467.     LIB_NONSTD = $FFFFFFE2;
  468.     TS_INVALID = 0;
  469.     MEMF_CHIP = 2;
  470.     NT_REPLYMSG = 7;
  471.     EXECNAME = 'exec.library';
  472.     AN_TDDelay = $14000002;
  473.     LIB_CLOSE = $FFFFFFF4;
  474.     AN_BadChkSum = $7000009;
  475.     AN_BadGadget = $4000001;
  476.     PA_SIGNAL = 0;
  477.     SIGB_BLIT = 4;
  478.     AT_DeadEnd = $80000000;
  479.     AT_Recovery = 0;
  480.     TB_LAUNCH = 7;
  481.     NT_DEVICE = 3;
  482.     NT_LIBRARY = 9;
  483.     PA_SOFTINT = 1;
  484.     MEMF_FAST = 4;
  485.     IOERR_ABORTED = $FFFFFFFE;
  486.     AG_MakeLib = $20000;
  487.     TS_REMOVED = 6;
  488.     SIGF_BLIT = $10;
  489.     PF_ACTION = 3;
  490.     TF_LAUNCH = $80;
  491.     PA_IGNORE = 2;
  492.     CMD_READ = 2;
  493.     MEM_BLOCKSIZE = 8;
  494.     CMD_FLUSH = 8;
  495.     AN_CListLib = $6000000;
  496.     LIB_BASE = $FFFFFFFA;
  497.     IOB_QUICK = 0;
  498.     CMD_RESET = 1;
  499.     AO_CListLib = $8006;
  500.     AN_BadSegList = $8000001;
  501.     AN_Intuition = $4000000;
  502.     AO_Intuition = $8004;
  503.     AN_BltBitMap = $8201000A;
  504.     IOF_QUICK = 1;
  505.     NT_PROCESS = $D;
  506.     AN_BaseChkSum = $81000002;
  507.     AN_QPktFail = $7000003;
  508.     AN_LibChkSum = $81000003;
  509.     TS_ADDED = 1;
  510.     TB_EXCEPT = 5;
  511.     CMD_WRITE = 3;
  512.     AG_IOError = $60000;
  513.     AN_LibMem = $81000004;
  514.     AN_ExecLib = $1000000;
  515.     AN_GfxNoMem = $82010000;
  516.     CMD_START = 7;
  517.     AO_ExecLib = $8001;
  518.     AN_BadMessage = $8400000D;
  519.     TF_EXCEPT = $20;
  520.     AN_DiskBlkSeq = $7000006;
  521.     RTC_MATCHWORD = $4AFC;
  522.  
  523.  
  524. function Supervisor (userFunction: pointer): long;
  525. procedure InitCode
  526.         (startClass: long;
  527.         version: long);
  528.  
  529. procedure InitStruct
  530.         (initTable: pointer;
  531.         memory: pointer;
  532.         size: long);
  533.  
  534. function MakeLibrary
  535.         (funcInit: pointer;
  536.         structInit: pointer;
  537.         libInit: pointer;
  538.         dataSize: long;
  539.         codeSize: longint): pLibrary;
  540.  
  541. function MakeFunctions
  542.         (target: pointer;
  543.         functionArray: pointer;
  544.         funcDispBase: pointer): long;
  545.  
  546. function FindResident (name: STRPTR): pResident;
  547. procedure InitResident
  548.         (resident: pResident;
  549.         segList: long);
  550.  
  551. procedure Alert
  552.         (alertNum: long;
  553.         parameters: pointer);
  554.  
  555. procedure Debug (flags: long);
  556. procedure Disable;
  557. procedure Enable;
  558. procedure Forbid;
  559. procedure Permit;
  560. function SetSR
  561.         (newSR: long;
  562.         mask: long): long;
  563.  
  564. function SuperState: pointer;
  565. procedure UserState (sysStack: pointer);
  566. function SetIntVector
  567.         (intNumber: long;
  568.         interrupt: pInterrupt): pInterrupt;
  569.  
  570. procedure AddIntServer
  571.         (intNumber: long;
  572.         interrupt: pInterrupt);
  573.  
  574. procedure RemIntServer
  575.         (intNumber: long;
  576.         interrupt: pInterrupt);
  577.  
  578. procedure Cause (interrupt: pInterrupt);
  579. function Allocate
  580.         (freeList: pMemHeader;
  581.         byteSize: long): pointer;
  582.  
  583. procedure Deallocate
  584.         (freeList: pMemHeader;
  585.         memoryBlock: pointer;
  586.         byteSize: long);
  587.  
  588. function AllocMem
  589.         (byteSize: long;
  590.         requirements: long): pointer;
  591.  
  592. function AllocAbs
  593.         (byteSize: long;
  594.         location: pointer): pointer;
  595.  
  596. procedure FreeMem_
  597.         (memoryBlock: pointer;
  598.         byteSize: long);
  599.  
  600. function AvailMem (requirements: long): long;
  601. function AllocEntry (entry: pMemList): pMemList;
  602. procedure FreeEntry (entry: pMemList);
  603. procedure Insert_
  604.         (list: pList;
  605.         node: pNode;
  606.         pred: pNode);
  607.  
  608. procedure AddHead
  609.         (list: pList;
  610.         node: pNode);
  611.  
  612. procedure AddTail
  613.         (list: pList;
  614.         node: pNode);
  615.  
  616. procedure Remove (node: pNode);
  617. function RemHead (list: pList): pNode;
  618. function RemTail (list: pList): pNode;
  619. procedure Enqueue
  620.         (list: pList;
  621.         node: pNode);
  622.  
  623. function FindName
  624.         (list: pList;
  625.         name: STRPTR): pNode;
  626.  
  627. function AddTask
  628.         (task: pTask;
  629.         initPC: pointer;
  630.         finalPC: pointer): pointer;
  631.  
  632. procedure RemTask (task: pTask);
  633. function FindTask (name: STRPTR): pTask;
  634. function SetTaskPri
  635.         (task: pTask;
  636.         priority: longint): shortint;
  637.  
  638. function SetSignal
  639.         (newSignals: long;
  640.         signalSet: long): long;
  641.  
  642. function SetExcept
  643.         (newSignals: long;
  644.         signalSet: long): long;
  645.  
  646. function Wait (signalSet: long): long;
  647. procedure Signal
  648.         (task: pTask;
  649.         signalSet: long);
  650.  
  651. function AllocSignal (signalNum: shortint): shortint;
  652. procedure FreeSignal (signalNum: shortint);
  653. function AllocTrap (trapNum: longint): longint;
  654. procedure FreeTrap (trapNum: long);
  655. procedure AddPort (port: pMsgPort);
  656. procedure RemPort (port: pMsgPort);
  657. procedure PutMsg
  658.         (port: pMsgPort;
  659.         message: pMessage);
  660.  
  661. function GetMsg (port: pMsgPort): pMessage;
  662. procedure ReplyMsg (message: pMessage);
  663. function WaitPort (port: pMsgPort): pMessage;
  664. function FindPort (name: STRPTR): pMsgPort;
  665. procedure AddLibrary (library: pLibrary);
  666. procedure RemLibrary (library: pLibrary);
  667. function OldOpenLibrary (libName: string): pLibrary;
  668. procedure CloseLibrary (library: pLibrary);
  669. function SetFunction
  670.         (library: pLibrary;
  671.         funcOffset: longint;
  672.         funcEntry: pointer): pointer;
  673.  
  674. procedure SumLibrary (library: pLibrary);
  675. procedure AddDevice (device: pDevice);
  676. procedure RemDevice (device: pDevice);
  677. function OpenDevice
  678.         (devName: string;
  679.         unit_: long;
  680.         ioRequest: pIORequest;
  681.         flags: long): shortint;
  682.  
  683. procedure CloseDevice (ioRequest: pIORequest);
  684. function DoIO (ioRequest: pIORequest): shortint;
  685. procedure SendIO (ioRequest: pIORequest);
  686. function CheckIO (ioRequest: pIORequest): boolean;
  687. function WaitIO (ioRequest: pIORequest): shortint;
  688. procedure AbortIO (ioRequest: pIORequest);
  689. procedure AddResource (resource: pointer);
  690. procedure RemResource (resource: pointer);
  691. function OpenResource (resName: string): pointer;
  692. procedure RawDoFmt
  693.         (formatString: STRPTR;
  694.         dataStream: pointer;
  695.         putChProc: pointer;
  696.         putChData: pointer);
  697.  
  698. function GetCC: word;
  699. function TypeOfMem (address: pointer): long;
  700. function Procure
  701.         (semaport: pSemaphore;
  702.         bidMsg: pMessage): shortint;
  703.  
  704. procedure Vacate (semaport: pSemaphore);
  705. function OpenLibrary
  706.         (libName: string;
  707.         version: long): pLibrary;
  708.  
  709. procedure InitSemaphore (sigSem: pSignalSemaphore);
  710. procedure ObtainSemaphore (sigSem: pSignalSemaphore);
  711. procedure ReleaseSemaphore (sigSem: pSignalSemaphore);
  712. function AttemptSemaphore (sigSem: pSignalSemaphore): longint;
  713. procedure ObtainSemaphoreList (sigSem: pList);
  714. procedure ReleaseSemaphoreList (sigSem: pList);
  715. function FindSemaphore (sigSem: STRPTR): pSignalSemaphore;
  716. procedure AddSemaphore (sigSem: pSignalSemaphore);
  717. procedure RemSemaphore (sigSem: pSignalSemaphore);
  718. function SumKickData: long;
  719. procedure AddMemList
  720.         (size: long;
  721.         attributes: long;
  722.         pri: longint;
  723.         base: pointer;
  724.         name: STRPTR);
  725.  
  726. procedure CopyMem
  727.         (source: pointer;
  728.         dest: pointer;
  729.         size: long);
  730.  
  731. procedure CopyMemQuick
  732.         (source: plong;
  733.         dest: plong;
  734.         size: long);
  735.  
  736.  
  737.  
  738. procedure PasToC (p: string; var c);
  739. procedure CToPas (var c; var p: string);
  740. function BitMask (no: shortint): longint;
  741. function IsListEmpty (list: pList): boolean;
  742. function IsMsgPortEmpty (mp: pMsgPort): boolean;
  743.  
  744.  
  745. IMPLEMENTATION
  746. procedure PasToC; xassembler;
  747. asm
  748.     movem.l    4(sp),a0-a1
  749.     moveq    #0,d0
  750.     move.b    (a1)+,d0
  751.     bra        @2
  752. @1:
  753.     move.b    (a1)+,(a0)+
  754. @2:
  755.     dbra    d0,@1
  756.     clr.b    (a0)
  757. end;
  758.  
  759. procedure CToPas; xassembler;
  760. asm
  761.     movem.l    4(sp),a0-a1
  762.     addq.l    #1,a0
  763.     move.w    #254,d0
  764. @1:
  765.     move.b    (a1)+,d1
  766.     beq        @2
  767.     move.b    d1,(a0)+
  768.     dbra    d0,@1
  769. @2:
  770.     addq.b    #1,d0
  771.     not.b    d0
  772.     move.l    4(sp),a0
  773.     move.b    d0,(a0)
  774. end;
  775.  
  776. function BitMask; xassembler;
  777. asm
  778.     moveq    #0,d0
  779.     move.b    4(sp),d1
  780.     bset    d1,d0
  781.     move.l    d0,6(sp)
  782. end;
  783.  
  784. function IsListEmpty;
  785. begin
  786.     IsListEmpty := list^.lh_TailPred = pNode(list)
  787. end;
  788.  
  789. function IsMsgPortEmpty;
  790. begin
  791.     with mp^ do
  792.         IsMsgPortEmpty := mp_MsgList.lh_TailPred = pNode(@mp_MsgList)
  793. end;
  794.  
  795. function Supervisor; xassembler;
  796. asm
  797.     movem.l    a5-a6,-(sp)
  798.     move.l    $C(sp),a5
  799.     move.l    SysBase,a6
  800.     jsr        -$1E(a6)
  801.     move.l    d0,$10(sp)
  802.     movem.l    (sp)+,a5-a6
  803. end;
  804.  
  805. procedure InitCode; xassembler;
  806. asm
  807.     move.l    a6,-(sp)
  808.     lea        8(sp),a6
  809.     move.l    (a6)+,d1
  810.     move.l    (a6)+,d0
  811.     move.l    SysBase,a6
  812.     jsr        -$48(a6)
  813.     move.l    (sp)+,a6
  814. end;
  815.  
  816. procedure InitStruct; xassembler;
  817. asm
  818.     movem.l    a2/a6,-(sp)
  819.     lea        $C(sp),a6
  820.     move.l    (a6)+,d0
  821.     move.l    (a6)+,a2
  822.     move.l    (a6)+,a1
  823.     move.l    SysBase,a6
  824.     jsr        -$4E(a6)
  825.     movem.l    (sp)+,a2/a6
  826. end;
  827.  
  828. function MakeLibrary; xassembler;
  829. asm
  830.     movem.l    a2/a6,-(sp)
  831.     lea        $C(sp),a6
  832.     move.l    (a6)+,d1
  833.     move.l    (a6)+,d0
  834.     move.l    (a6)+,a2
  835.     move.l    (a6)+,a1
  836.     move.l    (a6)+,a0
  837.     move.l    SysBase,a6
  838.     jsr        -$54(a6)
  839.     move.l    d0,$20(sp)
  840.     movem.l    (sp)+,a2/a6
  841. end;
  842.  
  843. function MakeFunctions; xassembler;
  844. asm
  845.     movem.l    a2/a6,-(sp)
  846.     lea        $C(sp),a6
  847.     move.l    (a6)+,a2
  848.     move.l    (a6)+,a1
  849.     move.l    (a6)+,a0
  850.     move.l    SysBase,a6
  851.     jsr        -$5A(a6)
  852.     move.l    d0,$18(sp)
  853.     movem.l    (sp)+,a2/a6
  854. end;
  855.  
  856. function FindResident; xassembler;
  857. asm
  858.     move.l    a6,-(sp)
  859.     move.l    8(sp),a1
  860.     move.l    SysBase,a6
  861.     jsr        -$60(a6)
  862.     move.l    d0,$C(sp)
  863.     move.l    (sp)+,a6
  864. end;
  865.  
  866. procedure InitResident; xassembler;
  867. asm
  868.     move.l    a6,-(sp)
  869.     movem.l    8(sp),d1/a1
  870.     move.l    SysBase,a6
  871.     jsr        -$66(a6)
  872.     move.l    (sp)+,a6
  873. end;
  874.  
  875. procedure Alert; xassembler;
  876. asm
  877.     movem.l    d7/a5-a6,-(sp)
  878.     lea        $10(sp),a6
  879.     move.l    (a6)+,a5
  880.     move.l    (a6)+,d7
  881.     move.l    SysBase,a6
  882.     jsr        -$6C(a6)
  883.     movem.l    (sp)+,d7/a5-a6
  884. end;
  885.  
  886. procedure Debug; xassembler;
  887. asm
  888.     move.l    a6,-(sp)
  889.     move.l    8(sp),d0
  890.     move.l    SysBase,a6
  891.     jsr        -$72(a6)
  892.     move.l    (sp)+,a6
  893. end;
  894.  
  895. procedure Disable; xassembler;
  896. asm
  897.     move.l    a6,-(sp)
  898.     move.l    SysBase,a6
  899.     jsr        -$78(a6)
  900.     move.l    (sp)+,a6
  901. end;
  902.  
  903. procedure Enable; xassembler;
  904. asm
  905.     move.l    a6,-(sp)
  906.     move.l    SysBase,a6
  907.     jsr        -$7E(a6)
  908.     move.l    (sp)+,a6
  909. end;
  910.  
  911. procedure Forbid; xassembler;
  912. asm
  913.     move.l    a6,-(sp)
  914.     move.l    SysBase,a6
  915.     jsr        -$84(a6)
  916.     move.l    (sp)+,a6
  917. end;
  918.  
  919. procedure Permit; xassembler;
  920. asm
  921.     move.l    a6,-(sp)
  922.     move.l    SysBase,a6
  923.     jsr        -$8A(a6)
  924.     move.l    (sp)+,a6
  925. end;
  926.  
  927. function SetSR; xassembler;
  928. asm
  929.     move.l    a6,-(sp)
  930.     lea        8(sp),a6
  931.     move.l    (a6)+,d1
  932.     move.l    (a6)+,d0
  933.     move.l    SysBase,a6
  934.     jsr        -$90(a6)
  935.     move.l    d0,$10(sp)
  936.     move.l    (sp)+,a6
  937. end;
  938.  
  939. function SuperState; xassembler;
  940. asm
  941.     move.l    a6,-(sp)
  942.     move.l    SysBase,a6
  943.     jsr        -$96(a6)
  944.     move.l    d0,8(sp)
  945.     move.l    (sp)+,a6
  946. end;
  947.  
  948. procedure UserState; xassembler;
  949. asm
  950.     move.l    a6,-(sp)
  951.     move.l    8(sp),d0
  952.     move.l    SysBase,a6
  953.     jsr        -$9C(a6)
  954.     move.l    (sp)+,a6
  955. end;
  956.  
  957. function SetIntVector; xassembler;
  958. asm
  959.     move.l    a6,-(sp)
  960.     lea        8(sp),a6
  961.     move.l    (a6)+,a1
  962.     move.l    (a6)+,d0
  963.     move.l    SysBase,a6
  964.     jsr        -$A2(a6)
  965.     move.l    d0,$10(sp)
  966.     move.l    (sp)+,a6
  967. end;
  968.  
  969. procedure AddIntServer; xassembler;
  970. asm
  971.     move.l    a6,-(sp)
  972.     lea        8(sp),a6
  973.     move.l    (a6)+,a1
  974.     move.l    (a6)+,d0
  975.     move.l    SysBase,a6
  976.     jsr        -$A8(a6)
  977.     move.l    (sp)+,a6
  978. end;
  979.  
  980. procedure RemIntServer; xassembler;
  981. asm
  982.     move.l    a6,-(sp)
  983.     lea        8(sp),a6
  984.     move.l    (a6)+,a1
  985.     move.l    (a6)+,d0
  986.     move.l    SysBase,a6
  987.     jsr        -$AE(a6)
  988.     move.l    (sp)+,a6
  989. end;
  990.  
  991. procedure Cause; xassembler;
  992. asm
  993.     move.l    a6,-(sp)
  994.     move.l    8(sp),a1
  995.     move.l    SysBase,a6
  996.     jsr        -$B4(a6)
  997.     move.l    (sp)+,a6
  998. end;
  999.  
  1000. function Allocate; xassembler;
  1001. asm
  1002.     move.l    a6,-(sp)
  1003.     movem.l    8(sp),d0/a0
  1004.     move.l    SysBase,a6
  1005.     jsr        -$BA(a6)
  1006.     move.l    d0,$10(sp)
  1007.     move.l    (sp)+,a6
  1008. end;
  1009.  
  1010. procedure Deallocate; xassembler;
  1011. asm
  1012.     move.l    a6,-(sp)
  1013.     lea        8(sp),a6
  1014.     move.l    (a6)+,d0
  1015.     move.l    (a6)+,a1
  1016.     move.l    (a6)+,a0
  1017.     move.l    SysBase,a6
  1018.     jsr        -$C0(a6)
  1019.     move.l    (sp)+,a6
  1020. end;
  1021.  
  1022. function AllocMem; xassembler;
  1023. asm
  1024.     move.l    a6,-(sp)
  1025.     lea        8(sp),a6
  1026.     move.l    (a6)+,d1
  1027.     move.l    (a6)+,d0
  1028.     move.l    SysBase,a6
  1029.     jsr        -$C6(a6)
  1030.     move.l    d0,$10(sp)
  1031.     move.l    (sp)+,a6
  1032. end;
  1033.  
  1034. function AllocAbs; xassembler;
  1035. asm
  1036.     move.l    a6,-(sp)
  1037.     lea        8(sp),a6
  1038.     move.l    (a6)+,a1
  1039.     move.l    (a6)+,d0
  1040.     move.l    SysBase,a6
  1041.     jsr        -$CC(a6)
  1042.     move.l    d0,$10(sp)
  1043.     move.l    (sp)+,a6
  1044. end;
  1045.  
  1046. procedure FreeMem_; xassembler;
  1047. asm
  1048.     move.l    a6,-(sp)
  1049.     movem.l    8(sp),d0/a1
  1050.     move.l    SysBase,a6
  1051.     jsr        -$D2(a6)
  1052.     move.l    (sp)+,a6
  1053. end;
  1054.  
  1055. function AvailMem; xassembler;
  1056. asm
  1057.     move.l    a6,-(sp)
  1058.     move.l    8(sp),d1
  1059.     move.l    SysBase,a6
  1060.     jsr        -$D8(a6)
  1061.     move.l    d0,$C(sp)
  1062.     move.l    (sp)+,a6
  1063. end;
  1064.  
  1065. function AllocEntry; xassembler;
  1066. asm
  1067.     move.l    a6,-(sp)
  1068.     move.l    8(sp),a0
  1069.     move.l    SysBase,a6
  1070.     jsr        -$DE(a6)
  1071.     move.l    d0,$C(sp)
  1072.     move.l    (sp)+,a6
  1073. end;
  1074.  
  1075. procedure FreeEntry; xassembler;
  1076. asm
  1077.     move.l    a6,-(sp)
  1078.     move.l    8(sp),a0
  1079.     move.l    SysBase,a6
  1080.     jsr        -$E4(a6)
  1081.     move.l    (sp)+,a6
  1082. end;
  1083.  
  1084. procedure Insert_; xassembler;
  1085. asm
  1086.     movem.l    a2/a6,-(sp)
  1087.     lea        $C(sp),a6
  1088.     move.l    (a6)+,a2
  1089.     move.l    (a6)+,a1
  1090.     move.l    (a6)+,a0
  1091.     move.l    SysBase,a6
  1092.     jsr        -$EA(a6)
  1093.     movem.l    (sp)+,a2/a6
  1094. end;
  1095.  
  1096. procedure AddHead; xassembler;
  1097. asm
  1098.     move.l    a6,-(sp)
  1099.     lea        8(sp),a6
  1100.     move.l    (a6)+,a1
  1101.     move.l    (a6)+,a0
  1102.     move.l    SysBase,a6
  1103.     jsr        -$F0(a6)
  1104.     move.l    (sp)+,a6
  1105. end;
  1106.  
  1107. procedure AddTail; xassembler;
  1108. asm
  1109.     move.l    a6,-(sp)
  1110.     lea        8(sp),a6
  1111.     move.l    (a6)+,a1
  1112.     move.l    (a6)+,a0
  1113.     move.l    SysBase,a6
  1114.     jsr        -$F6(a6)
  1115.     move.l    (sp)+,a6
  1116. end;
  1117.  
  1118. procedure Remove; xassembler;
  1119. asm
  1120.     move.l    a6,-(sp)
  1121.     move.l    8(sp),a1
  1122.     move.l    SysBase,a6
  1123.     jsr        -$FC(a6)
  1124.     move.l    (sp)+,a6
  1125. end;
  1126.  
  1127. function RemHead; xassembler;
  1128. asm
  1129.     move.l    a6,-(sp)
  1130.     move.l    8(sp),a0
  1131.     move.l    SysBase,a6
  1132.     jsr        -$102(a6)
  1133.     move.l    d0,$C(sp)
  1134.     move.l    (sp)+,a6
  1135. end;
  1136.  
  1137. function RemTail; xassembler;
  1138. asm
  1139.     move.l    a6,-(sp)
  1140.     move.l    8(sp),a0
  1141.     move.l    SysBase,a6
  1142.     jsr        -$108(a6)
  1143.     move.l    d0,$C(sp)
  1144.     move.l    (sp)+,a6
  1145. end;
  1146.  
  1147. procedure Enqueue; xassembler;
  1148. asm
  1149.     move.l    a6,-(sp)
  1150.     lea        8(sp),a6
  1151.     move.l    (a6)+,a1
  1152.     move.l    (a6)+,a0
  1153.     move.l    SysBase,a6
  1154.     jsr        -$10E(a6)
  1155.     move.l    (sp)+,a6
  1156. end;
  1157.  
  1158. function FindName; xassembler;
  1159. asm
  1160.     move.l    a6,-(sp)
  1161.     lea        8(sp),a6
  1162.     move.l    (a6)+,a1
  1163.     move.l    (a6)+,a0
  1164.     move.l    SysBase,a6
  1165.     jsr        -$114(a6)
  1166.     move.l    d0,$10(sp)
  1167.     move.l    (sp)+,a6
  1168. end;
  1169.  
  1170. function AddTask; xassembler;
  1171. asm
  1172.     movem.l    a2-a3/a6,-(sp)
  1173.     lea        $10(sp),a6
  1174.     move.l    (a6)+,a3
  1175.     move.l    (a6)+,a2
  1176.     move.l    (a6)+,a1
  1177.     move.l    SysBase,a6
  1178.     jsr        -$11A(a6)
  1179.     move.l    d0,$1C(sp)
  1180.     movem.l    (sp)+,a2-a3/a6
  1181. end;
  1182.  
  1183. procedure RemTask; xassembler;
  1184. asm
  1185.     move.l    a6,-(sp)
  1186.     move.l    8(sp),a1
  1187.     move.l    SysBase,a6
  1188.     jsr        -$120(a6)
  1189.     move.l    (sp)+,a6
  1190. end;
  1191.  
  1192. function FindTask; xassembler;
  1193. asm
  1194.     move.l    a6,-(sp)
  1195.     move.l    8(sp),a1
  1196.     move.l    SysBase,a6
  1197.     jsr        -$126(a6)
  1198.     move.l    d0,$C(sp)
  1199.     move.l    (sp)+,a6
  1200. end;
  1201.  
  1202. function SetTaskPri; xassembler;
  1203. asm
  1204.     move.l    a6,-(sp)
  1205.     movem.l    8(sp),d0/a1
  1206.     move.l    SysBase,a6
  1207.     jsr        -$12C(a6)
  1208.     move.b    d0,$10(sp)
  1209.     move.l    (sp)+,a6
  1210. end;
  1211.  
  1212. function SetSignal; xassembler;
  1213. asm
  1214.     move.l    a6,-(sp)
  1215.     lea        8(sp),a6
  1216.     move.l    (a6)+,d1
  1217.     move.l    (a6)+,d0
  1218.     move.l    SysBase,a6
  1219.     jsr        -$132(a6)
  1220.     move.l    d0,$10(sp)
  1221.     move.l    (sp)+,a6
  1222. end;
  1223.  
  1224. function SetExcept; xassembler;
  1225. asm
  1226.     move.l    a6,-(sp)
  1227.     lea        8(sp),a6
  1228.     move.l    (a6)+,d1
  1229.     move.l    (a6)+,d0
  1230.     move.l    SysBase,a6
  1231.     jsr        -$138(a6)
  1232.     move.l    d0,$10(sp)
  1233.     move.l    (sp)+,a6
  1234. end;
  1235.  
  1236. function Wait; xassembler;
  1237. asm
  1238.     move.l    a6,-(sp)
  1239.     move.l    8(sp),d0
  1240.     move.l    SysBase,a6
  1241.     jsr        -$13E(a6)
  1242.     move.l    d0,$C(sp)
  1243.     move.l    (sp)+,a6
  1244. end;
  1245.  
  1246. procedure Signal; xassembler;
  1247. asm
  1248.     move.l    a6,-(sp)
  1249.     movem.l    8(sp),d0/a1
  1250.     move.l    SysBase,a6
  1251.     jsr        -$144(a6)
  1252.     move.l    (sp)+,a6
  1253. end;
  1254.  
  1255. function AllocSignal; xassembler;
  1256. asm
  1257.     move.l    a6,-(sp)
  1258.     move.b    8(sp),d0
  1259.     move.l    SysBase,a6
  1260.     jsr        -$14A(a6)
  1261.     move.b    d0,$A(sp)
  1262.     move.l    (sp)+,a6
  1263. end;
  1264.  
  1265. procedure FreeSignal; xassembler;
  1266. asm
  1267.     move.l    a6,-(sp)
  1268.     move.b    8(sp),d0
  1269.     move.l    SysBase,a6
  1270.     jsr        -$150(a6)
  1271.     move.l    (sp)+,a6
  1272. end;
  1273.  
  1274. function AllocTrap; xassembler;
  1275. asm
  1276.     move.l    a6,-(sp)
  1277.     move.l    8(sp),d0
  1278.     move.l    SysBase,a6
  1279.     jsr        -$156(a6)
  1280.     move.l    d0,$C(sp)
  1281.     move.l    (sp)+,a6
  1282. end;
  1283.  
  1284. procedure FreeTrap; xassembler;
  1285. asm
  1286.     move.l    a6,-(sp)
  1287.     move.l    8(sp),d0
  1288.     move.l    SysBase,a6
  1289.     jsr        -$15C(a6)
  1290.     move.l    (sp)+,a6
  1291. end;
  1292.  
  1293. procedure AddPort; xassembler;
  1294. asm
  1295.     move.l    a6,-(sp)
  1296.     move.l    8(sp),a1
  1297.     move.l    SysBase,a6
  1298.     jsr        -$162(a6)
  1299.     move.l    (sp)+,a6
  1300. end;
  1301.  
  1302. procedure RemPort; xassembler;
  1303. asm
  1304.     move.l    a6,-(sp)
  1305.     move.l    8(sp),a1
  1306.     move.l    SysBase,a6
  1307.     jsr        -$168(a6)
  1308.     move.l    (sp)+,a6
  1309. end;
  1310.  
  1311. procedure PutMsg; xassembler;
  1312. asm
  1313.     move.l    a6,-(sp)
  1314.     lea        8(sp),a6
  1315.     move.l    (a6)+,a1
  1316.     move.l    (a6)+,a0
  1317.     move.l    SysBase,a6
  1318.     jsr        -$16E(a6)
  1319.     move.l    (sp)+,a6
  1320. end;
  1321.  
  1322. function GetMsg; xassembler;
  1323. asm
  1324.     move.l    a6,-(sp)
  1325.     move.l    8(sp),a0
  1326.     move.l    SysBase,a6
  1327.     jsr        -$174(a6)
  1328.     move.l    d0,$C(sp)
  1329.     move.l    (sp)+,a6
  1330. end;
  1331.  
  1332. procedure ReplyMsg; xassembler;
  1333. asm
  1334.     move.l    a6,-(sp)
  1335.     move.l    8(sp),a1
  1336.     move.l    SysBase,a6
  1337.     jsr        -$17A(a6)
  1338.     move.l    (sp)+,a6
  1339. end;
  1340.  
  1341. function WaitPort; xassembler;
  1342. asm
  1343.     move.l    a6,-(sp)
  1344.     move.l    8(sp),a0
  1345.     move.l    SysBase,a6
  1346.     jsr        -$180(a6)
  1347.     move.l    d0,$C(sp)
  1348.     move.l    (sp)+,a6
  1349. end;
  1350.  
  1351. function FindPort; xassembler;
  1352. asm
  1353.     move.l    a6,-(sp)
  1354.     move.l    8(sp),a1
  1355.     move.l    SysBase,a6
  1356.     jsr        -$186(a6)
  1357.     move.l    d0,$C(sp)
  1358.     move.l    (sp)+,a6
  1359. end;
  1360.  
  1361. procedure AddLibrary; xassembler;
  1362. asm
  1363.     move.l    a6,-(sp)
  1364.     move.l    8(sp),a1
  1365.     move.l    SysBase,a6
  1366.     jsr        -$18C(a6)
  1367.     move.l    (sp)+,a6
  1368. end;
  1369.  
  1370. procedure RemLibrary; xassembler;
  1371. asm
  1372.     move.l    a6,-(sp)
  1373.     move.l    8(sp),a1
  1374.     move.l    SysBase,a6
  1375.     jsr        -$192(a6)
  1376.     move.l    (sp)+,a6
  1377. end;
  1378.  
  1379. function OldOpenLibrary; assembler;
  1380. var c_libName: string;
  1381. asm
  1382.     move.l    libName,-(sp)
  1383.     pea        c_libName
  1384.     jsr        PasToC
  1385.     move.l    a6,-(sp)
  1386.     lea        c_libName,a1
  1387.     move.l    SysBase,a6
  1388.     jsr        -$198(a6)
  1389.     move.l    d0,$110(sp)
  1390.     move.l    (sp)+,a6
  1391. end;
  1392.  
  1393. procedure CloseLibrary; xassembler;
  1394. asm
  1395.     move.l    a6,-(sp)
  1396.     move.l    8(sp),a1
  1397.     move.l    SysBase,a6
  1398.     jsr        -$19E(a6)
  1399.     move.l    (sp)+,a6
  1400. end;
  1401.  
  1402. function SetFunction; xassembler;
  1403. asm
  1404.     move.l    a6,-(sp)
  1405.     movem.l    8(sp),d0/a0-a1
  1406.     move.l    SysBase,a6
  1407.     jsr        -$1A4(a6)
  1408.     move.l    d0,$14(sp)
  1409.     move.l    (sp)+,a6
  1410. end;
  1411.  
  1412. procedure SumLibrary; xassembler;
  1413. asm
  1414.     move.l    a6,-(sp)
  1415.     move.l    8(sp),a1
  1416.     move.l    SysBase,a6
  1417.     jsr        -$1AA(a6)
  1418.     move.l    (sp)+,a6
  1419. end;
  1420.  
  1421. procedure AddDevice; xassembler;
  1422. asm
  1423.     move.l    a6,-(sp)
  1424.     move.l    8(sp),a1
  1425.     move.l    SysBase,a6
  1426.     jsr        -$1B0(a6)
  1427.     move.l    (sp)+,a6
  1428. end;
  1429.  
  1430. procedure RemDevice; xassembler;
  1431. asm
  1432.     move.l    a6,-(sp)
  1433.     move.l    8(sp),a1
  1434.     move.l    SysBase,a6
  1435.     jsr        -$1B6(a6)
  1436.     move.l    (sp)+,a6
  1437. end;
  1438.  
  1439. function OpenDevice; assembler;
  1440. var c_devName: string;
  1441. asm
  1442.     move.l    devName,-(sp)
  1443.     pea        c_devName
  1444.     jsr        PasToC
  1445.     move.l    a6,-(sp)
  1446.     lea        c_devName,a0
  1447.     lea        $10C(sp),a6
  1448.     move.l    (a6)+,d1
  1449.     move.l    (a6)+,a1
  1450.     move.l    (a6)+,d0
  1451.     move.l    SysBase,a6
  1452.     jsr        -$1BC(a6)
  1453.     move.b    d0,$11C(sp)
  1454.     move.l    (sp)+,a6
  1455. end;
  1456.  
  1457. procedure CloseDevice; xassembler;
  1458. asm
  1459.     move.l    a6,-(sp)
  1460.     move.l    8(sp),a1
  1461.     move.l    SysBase,a6
  1462.     jsr        -$1C2(a6)
  1463.     move.l    (sp)+,a6
  1464. end;
  1465.  
  1466. function DoIO; xassembler;
  1467. asm
  1468.     move.l    a6,-(sp)
  1469.     move.l    8(sp),a1
  1470.     move.l    SysBase,a6
  1471.     jsr        -$1C8(a6)
  1472.     move.b    d0,$C(sp)
  1473.     move.l    (sp)+,a6
  1474. end;
  1475.  
  1476. procedure SendIO; xassembler;
  1477. asm
  1478.     move.l    a6,-(sp)
  1479.     move.l    8(sp),a1
  1480.     move.l    SysBase,a6
  1481.     jsr        -$1CE(a6)
  1482.     move.l    (sp)+,a6
  1483. end;
  1484.  
  1485. function CheckIO; xassembler;
  1486. asm
  1487.     move.l    a6,-(sp)
  1488.     move.l    8(sp),a1
  1489.     move.l    SysBase,a6
  1490.     jsr        -$1D4(a6)
  1491.     tst.l    d0
  1492.     sne        d0
  1493.     neg.b    d0
  1494.     move.b    d0,$C(sp)
  1495.     move.l    (sp)+,a6
  1496. end;
  1497.  
  1498. function WaitIO; xassembler;
  1499. asm
  1500.     move.l    a6,-(sp)
  1501.     move.l    8(sp),a1
  1502.     move.l    SysBase,a6
  1503.     jsr        -$1DA(a6)
  1504.     move.b    d0,$C(sp)
  1505.     move.l    (sp)+,a6
  1506. end;
  1507.  
  1508. procedure AbortIO; xassembler;
  1509. asm
  1510.     move.l    a6,-(sp)
  1511.     move.l    8(sp),a1
  1512.     move.l    SysBase,a6
  1513.     jsr        -$1E0(a6)
  1514.     move.l    (sp)+,a6
  1515. end;
  1516.  
  1517. procedure AddResource; xassembler;
  1518. asm
  1519.     move.l    a6,-(sp)
  1520.     move.l    8(sp),a1
  1521.     move.l    SysBase,a6
  1522.     jsr        -$1E6(a6)
  1523.     move.l    (sp)+,a6
  1524. end;
  1525.  
  1526. procedure RemResource; xassembler;
  1527. asm
  1528.     move.l    a6,-(sp)
  1529.     move.l    8(sp),a1
  1530.     move.l    SysBase,a6
  1531.     jsr        -$1EC(a6)
  1532.     move.l    (sp)+,a6
  1533. end;
  1534.  
  1535. function OpenResource; assembler;
  1536. var c_resName: string;
  1537. asm
  1538.     move.l    resName,-(sp)
  1539.     pea        c_resName
  1540.     jsr        PasToC
  1541.     move.l    a6,-(sp)
  1542.     lea        c_resName,a1
  1543.     move.l    SysBase,a6
  1544.     jsr        -$1F2(a6)
  1545.     move.l    d0,$110(sp)
  1546.     move.l    (sp)+,a6
  1547. end;
  1548.  
  1549. procedure RawDoFmt; xassembler;
  1550. asm
  1551.     movem.l    a2-a3/a6,-(sp)
  1552.     lea        $10(sp),a6
  1553.     move.l    (a6)+,a3
  1554.     move.l    (a6)+,a2
  1555.     move.l    (a6)+,a1
  1556.     move.l    (a6)+,a0
  1557.     move.l    SysBase,a6
  1558.     jsr        -$20A(a6)
  1559.     movem.l    (sp)+,a2-a3/a6
  1560. end;
  1561.  
  1562. function GetCC; xassembler;
  1563. asm
  1564.     movem.l    a2-a3/a6,-(sp)
  1565.     move.l    SysBase,a6
  1566.     jsr        -$210(a6)
  1567.     move.w    d0,$10(sp)
  1568.     movem.l    (sp)+,a2-a3/a6
  1569. end;
  1570.  
  1571. function TypeOfMem; xassembler;
  1572. asm
  1573.     move.l    a6,-(sp)
  1574.     move.l    8(sp),a1
  1575.     move.l    SysBase,a6
  1576.     jsr        -$216(a6)
  1577.     move.l    d0,$C(sp)
  1578.     move.l    (sp)+,a6
  1579. end;
  1580.  
  1581. function Procure; xassembler;
  1582. asm
  1583.     move.l    a6,-(sp)
  1584.     lea        8(sp),a6
  1585.     move.l    (a6)+,a1
  1586.     move.l    (a6)+,a0
  1587.     move.l    SysBase,a6
  1588.     jsr        -$21C(a6)
  1589.     move.b    d0,$10(sp)
  1590.     move.l    (sp)+,a6
  1591. end;
  1592.  
  1593. procedure Vacate; xassembler;
  1594. asm
  1595.     move.l    a6,-(sp)
  1596.     move.l    8(sp),a0
  1597.     move.l    SysBase,a6
  1598.     jsr        -$222(a6)
  1599.     move.l    (sp)+,a6
  1600. end;
  1601.  
  1602. function OpenLibrary; assembler;
  1603. var c_libName: string;
  1604. asm
  1605.     move.l    libName,-(sp)
  1606.     pea        c_libName
  1607.     jsr        PasToC
  1608.     move.l    a6,-(sp)
  1609.     lea        c_libName,a1
  1610.     move.l    $10C(sp),d0
  1611.     move.l    SysBase,a6
  1612.     jsr        -$228(a6)
  1613.     move.l    d0,$114(sp)
  1614.     move.l    (sp)+,a6
  1615. end;
  1616.  
  1617. procedure InitSemaphore; xassembler;
  1618. asm
  1619.     move.l    a6,-(sp)
  1620.     move.l    8(sp),a0
  1621.     move.l    SysBase,a6
  1622.     jsr        -$22E(a6)
  1623.     move.l    (sp)+,a6
  1624. end;
  1625.  
  1626. procedure ObtainSemaphore; xassembler;
  1627. asm
  1628.     move.l    a6,-(sp)
  1629.     move.l    8(sp),a0
  1630.     move.l    SysBase,a6
  1631.     jsr        -$234(a6)
  1632.     move.l    (sp)+,a6
  1633. end;
  1634.  
  1635. procedure ReleaseSemaphore; xassembler;
  1636. asm
  1637.     move.l    a6,-(sp)
  1638.     move.l    8(sp),a0
  1639.     move.l    SysBase,a6
  1640.     jsr        -$23A(a6)
  1641.     move.l    (sp)+,a6
  1642. end;
  1643.  
  1644. function AttemptSemaphore; xassembler;
  1645. asm
  1646.     move.l    a6,-(sp)
  1647.     move.l    8(sp),a0
  1648.     move.l    SysBase,a6
  1649.     jsr        -$240(a6)
  1650.     move.l    d0,$C(sp)
  1651.     move.l    (sp)+,a6
  1652. end;
  1653.  
  1654. procedure ObtainSemaphoreList; xassembler;
  1655. asm
  1656.     move.l    a6,-(sp)
  1657.     move.l    8(sp),a0
  1658.     move.l    SysBase,a6
  1659.     jsr        -$246(a6)
  1660.     move.l    (sp)+,a6
  1661. end;
  1662.  
  1663. procedure ReleaseSemaphoreList; xassembler;
  1664. asm
  1665.     move.l    a6,-(sp)
  1666.     move.l    8(sp),a0
  1667.     move.l    SysBase,a6
  1668.     jsr        -$24C(a6)
  1669.     move.l    (sp)+,a6
  1670. end;
  1671.  
  1672. function FindSemaphore; xassembler;
  1673. asm
  1674.     move.l    a6,-(sp)
  1675.     move.l    8(sp),a1
  1676.     move.l    SysBase,a6
  1677.     jsr        -$252(a6)
  1678.     move.l    d0,$C(sp)
  1679.     move.l    (sp)+,a6
  1680. end;
  1681.  
  1682. procedure AddSemaphore; xassembler;
  1683. asm
  1684.     move.l    a6,-(sp)
  1685.     move.l    8(sp),a1
  1686.     move.l    SysBase,a6
  1687.     jsr        -$258(a6)
  1688.     move.l    (sp)+,a6
  1689. end;
  1690.  
  1691. procedure RemSemaphore; xassembler;
  1692. asm
  1693.     move.l    a6,-(sp)
  1694.     move.l    8(sp),a1
  1695.     move.l    SysBase,a6
  1696.     jsr        -$25E(a6)
  1697.     move.l    (sp)+,a6
  1698. end;
  1699.  
  1700. function SumKickData; xassembler;
  1701. asm
  1702.     move.l    a6,-(sp)
  1703.     move.l    SysBase,a6
  1704.     jsr        -$264(a6)
  1705.     move.l    d0,8(sp)
  1706.     move.l    (sp)+,a6
  1707. end;
  1708.  
  1709. procedure AddMemList; xassembler;
  1710. asm
  1711.     move.l    a6,-(sp)
  1712.     lea        8(sp),a6
  1713.     move.l    (a6)+,a1
  1714.     move.l    (a6)+,a0
  1715.     move.l    (a6)+,d2
  1716.     move.l    (a6)+,d1
  1717.     move.l    (a6)+,d0
  1718.     move.l    SysBase,a6
  1719.     jsr        -$26A(a6)
  1720.     move.l    (sp)+,a6
  1721. end;
  1722.  
  1723. procedure CopyMem; xassembler;
  1724. asm
  1725.     move.l    a6,-(sp)
  1726.     lea        8(sp),a6
  1727.     move.l    (a6)+,d0
  1728.     move.l    (a6)+,a1
  1729.     move.l    (a6)+,a0
  1730.     move.l    SysBase,a6
  1731.     jsr        -$270(a6)
  1732.     move.l    (sp)+,a6
  1733. end;
  1734.  
  1735. procedure CopyMemQuick; xassembler;
  1736. asm
  1737.     move.l    a6,-(sp)
  1738.     lea        8(sp),a6
  1739.     move.l    (a6)+,d0
  1740.     move.l    (a6)+,a1
  1741.     move.l    (a6)+,a0
  1742.     move.l    SysBase,a6
  1743.     jsr        -$276(a6)
  1744.     move.l    (sp)+,a6
  1745. end;
  1746.  
  1747. end.
  1748.