home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / nicol / sti_aloc / stialloc.txt < prev   
Encoding:
Text File  |  1990-12-10  |  10.1 KB  |  468 lines

  1.  
  2.  
  3.  
  4.         
  5.         
  6.         
  7.         
  8.         
  9.         
  10.         
  11.         
  12.         
  13.         
  14.         
  15.         
  16.                                MEMORY ALLOCATION SYSTEM 1.0
  17.         
  18.                                For Turbo Pascal Version 5.0
  19.         
  20.         
  21.         
  22.         
  23.         
  24.         
  25.         
  26.         
  27.         
  28.         
  29.         
  30.         
  31.                                   Copyright 1990, 1991 By
  32.         
  33.                              Software Technology International
  34.         
  35.                                     All Rights Reserved
  36.         
  37.         
  38.         
  39.         
  40.         
  41.         
  42.         
  43.         
  44.         
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                                            -1-
  67.                                           NOTICE
  68.                                           ------
  69.  
  70.         
  71.         
  72.                      All parts of this manual and the accompanying  soft-
  73.                   ware  are  copyrighted material. You, as  a  registered 
  74.                   user, are granted permission to make as many copies  of 
  75.                   the  software, or manual, as you wish, as long as  they 
  76.                   are for your personal use. You may not copy this  soft-
  77.                   ware,  or  manual,  in any form  whatsoever  for  usage 
  78.                   outside of your personal use. This includes, but is not 
  79.                   limited  to, duplication of the disk, the files on  the 
  80.                   disk or the manual, by manual or electronic means.
  81.         
  82.         
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.                                            -2-
  133.                                      TABLE OF CONTENTS
  134.                                      -----------------
  135.         
  136.                   
  137.                    Subject                                     Page
  138.                    -----------------------------------------------------
  139.         
  140.                    GENERAL DESCRIPTION ......................    4 
  141.                      Introduction ...........................    4 
  142.                      The software ...........................    4 
  143.                                                              
  144.                    THE SOFTWARE IN DETAIL ...................    5     
  145.                      Functions and Procedures ...............    5 
  146.                      Usage Pointers .........................    6 
  147.                                                              
  148.                    INDEX ....................................    7     
  149.         
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.                                            -3-
  201.                                     GENERAL DESCRIPTION
  202.                                     -------------------
  203.                   Introduction
  204.                   ------------
  205.  
  206.                      Welcome to Version 1.0 of Software Technology Inter-
  207.                   nationals'  Memory  Allocation System.  This  group  of 
  208.                   functions will enable your Turbo Pascal Version 5.0  to 
  209.                   allocate  blocks  of data up to the size  of  available 
  210.                   memory.  The functions were written to be flexible,  as 
  211.                   fast  as possible, and as easy to use as  possible.  We 
  212.                   hope  they  live up to your expectations.  Please  feel 
  213.                   free to write to us anytime with bug reports or sugges-
  214.                   tions  for  future versions. If you  are  a  registered 
  215.                   user, this will entitle you to a free upgrade.
  216.                      Remember  that  this  software  is  copyrighted,  so 
  217.                   please don't copy and distribute it, this is a  federal 
  218.                   offense. 
  219.         
  220.                   The Software
  221.                   ------------
  222.  
  223.                      These  are a group of functions and procedures  that
  224.                   allow  your programs to allocate large blocks of  data.
  225.                   They are loosely based on the functions provided as PDS
  226.                   by  Turbopower, but they have been  entirely  rewritten
  227.                   for speed and clarity.
  228.  
  229.                      They  allow  your program  to  dynamically  allocate
  230.                   memory  blocks  larger than 64k. Of  course,  they  are
  231.                   entirely  compatible  with the  standard  Turbo  Pascal
  232.                   routines.  Also,  of course, they can  allocate  blocks
  233.                   smaller than  64k. These routines will  enable  you  to
  234.                   provide  your  programs  with huge arrays,  as  in  the
  235.                   demonstration program.
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.                                           -4-
  268.                                   THE SOFTWARE IN DETAIL
  269.                                   ----------------------
  270.  
  271.  
  272.                   The Functions And Procedures
  273.                   ----------------------------
  274.  
  275.                   procedure STI_GetMem(var Point; NoBytes : LongInt);
  276.         
  277.                      This  procedure  is functionally  identical  to  the 
  278.                   standard Turbo Pascal GetMem, except that it can  allo-
  279.                   cate blocks of data larger than 64k. The variable POINT 
  280.                   is  any Turbo Pascal pointer, and the variable  NoBytes 
  281.                   is the size of the block to allocate. Point will be set 
  282.                   to NIL if the available memory is less than NoBytes.
  283.                   
  284.                   procedure STI_FreeMem(var Point; NoBytes : LongInt);
  285.         
  286.                      This  procedure  is functionally  identical  to  the 
  287.                   standard  Turbo  Pascal  FreeMem, except  that  it  can 
  288.                   deallocate  large  blocks of data. It checks  POINT  to 
  289.                   make sure that it is valid, and not NIL. If it succeeds 
  290.                   to deallocate NOBYTES, POINT will be set to NIL.
  291.                   
  292.                   function  STI_Ptr2Linear(Point : Pointer) : LongInt;
  293.         
  294.                      This  function  converts  a pointer  into  a  linear 
  295.                   address. This is useful for doing pointer arithmetic. 
  296.                   
  297.                   function  STI_Linear2Ptr(Long : LongInt) : Pointer;
  298.         
  299.                      This function returns a normalised pointer from  the 
  300.                   linear address provided in LONG.
  301.                   function STI_Difference(Point1,Point2 : Pointer) : LongInt;
  302.                      This  function  calculates  the  address  difference 
  303.                   between  POINT1  and POINT2. It returns the  number  of 
  304.                   bytes they are apart.
  305.                   
  306.                   function  STI_Normalise(Point : Pointer) : Pointer;
  307.         
  308.                      This  function return a normalised pointer from  the 
  309.                   pointer POINT.
  310.         
  311.         
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.                                       
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                           -5-
  335.                                       USAGE POINTERS
  336.                                       --------------
  337.         
  338.                      Basically,  you can feel free to use these  routines 
  339.                   in exactly the same way as you would the standard Turbo 
  340.                   Pascal functions. In the demonstration program you  can 
  341.                   see  how to use them to create a very large array,  but 
  342.                   some other areas where they would be useful would be in 
  343.                   graphics. In this case, if you are saving a large  area 
  344.                   of the screen, Turbo Pascals' standard routines do  not 
  345.                   suffice.
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.                                             -6-
  402.                                            INDEX
  403.                                            -----
  404.         
  405.                     Topic                                     Page Number
  406.                   -------------------------------------------------------
  407.         
  408.                  Address......................................      5
  409.         
  410.                  Contents.....................................      3
  411.                  Conversion...................................      5
  412.                  Copying......................................      2
  413.                  Copyright....................................      2
  414.         
  415.                  Descriptions.................................      5
  416.         
  417.                  Functions....................................      5
  418.         
  419.                  General Description..........................      4
  420.         
  421.                  Introduction.................................      4
  422.         
  423.                  Linear Address...............................      5
  424.         
  425.                  Memory.......................................      4
  426.                  Memory Allocation............................      4, 5
  427.                  Memory Deallocation..........................      5
  428.         
  429.                  Pointers.....................................      5
  430.                  Procedures...................................      5
  431.         
  432.                  STI_Difference...............................      5
  433.                  STI_FreeMem..................................      5
  434.                  STI_GetMem...................................      5
  435.                  STI_Linear2Ptr...............................      5
  436.                  STI_Normalise................................      5
  437.                  STI_Ptr2Linear...............................      5
  438.         
  439.                  Turbopower...................................      4
  440.         
  441.                  Usage........................................      6
  442.                  Users........................................      2
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.                                             -7-