home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PASCAL / TBTREE16.ZIP / FASTMOVE.PAS < prev    next >
Pascal/Delphi Source File  |  1989-07-13  |  3KB  |  69 lines

  1. (* TBTree16             Copyright (c)  1988,1989       Dean H. Farwell II    *)
  2.  
  3. unit FastMove;
  4.  
  5. (*****************************************************************************)
  6. (*                                                                           *)
  7. (*                    F A S T   M O V E   R O U T I N E                      *)
  8. (*                                                                           *)
  9. (*****************************************************************************)
  10.  
  11. (* This unit contains one assembly language routine which replaces the Turbo
  12.    Pascal Move routine.  Like the Turbo Pascal routine, FastMover will handle
  13.    cases where the source and destination overlap.  The advantage of using
  14.    this over the Turbo Pascal Move routine is that it is faster since it moves
  15.    the data a word at a time versus a byte at a time.
  16.  
  17.    This is actually an inline version of a variation on MOVES.ASM written by
  18.    James H LeMay.  I decided to use inline versus an object file since this
  19.    makes it easier for you to deal with.  There is no object file to try to
  20.    keep track of.  Also, MOVES.ASM contains a second routine which I did not
  21.    need.  I wanted to keep this as small as possible.                        *)
  22.  
  23. (* Version Information
  24.  
  25.    Version 1.5 - Unit Created
  26.  
  27.    Version 1.6 - No Changes                                                  *)
  28.  
  29.  
  30. (*\*)
  31. (*////////////////////////// I N T E R F A C E //////////////////////////////*)
  32.  
  33. interface
  34.  
  35. (* This routine will move a block of data from a source to a destination.  It
  36.    replaces Turbo Pascal's Move routine.                                     *)
  37.  
  38. procedure FastMover(var source;
  39.                     var dest;
  40.                     numToMove : word);
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. (*!*)
  51. (*///////////////////// I M P L E M E N T A T I O N /////////////////////////*)
  52.  
  53. implementation
  54.  
  55. (* This routine will move a block of data from a source to a destination.  It
  56.    replaces Turbo Pascal's Move routine.                                     *)
  57.  
  58. procedure FastMover(var source;
  59.                     var dest;
  60.                     numToMove : word);
  61.  
  62.     begin
  63.     Inline($8C/$DA/$C5/$B6/>SOURCE/$C4/$BE/>DEST/$8B/$8E/>NUMTOMOVE);
  64.     Inline($39/$FE/$72/$08/$FC/$D1/$E9/$73/$11/$A4/$EB/$0E/$FD/$01/$CE);
  65.     Inline($4E/$01/$CF/$4F/$D1/$E9/$73/$01/$A4/$4E/$4F/$F2/$A5/$8E/$DA);
  66.     end;                                         (* end of FastMover routine *)
  67.  
  68. end.                                                     (* end of Time unit *)
  69.