home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 9.ddi / CHAPXMPL.ZIP / SAMPLE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-02-13  |  1.2 KB  |  57 lines

  1. {
  2.   Turbo Assembler    Copyright (c) 1988, 1991 By Borland International, Inc.
  3.  
  4.   SAMPLE.PAS
  5.   Accessing Turbo Pascal procedures and functions.
  6.  
  7.   From the Turbo Assembler Users Guide - Interfacing Turbo Assembler
  8.                                          with Turbo Pascal
  9. }
  10.  
  11.  
  12. unit Sample;
  13. { Sample unit that defines several pascal procedures that are
  14.   called from an assembly language procedure. }
  15. interface
  16.  
  17. procedure TestSample;
  18.  
  19. procedure PublicProc;         { Must be far since it is visibleoutside }
  20.  
  21. implementation
  22.  
  23. var
  24.   A : word;
  25.  
  26. procedure AsmProc; external;
  27. {$L ASMPROC.OBJ}
  28.  
  29. procedure PublicProc;
  30.   begin { PublicProc }
  31.     Writeln('In PublicProc');
  32.   end;  { PublicProc }
  33.  
  34. procedure NearProc;           { Must be near }
  35.   begin { NearProc }
  36.     Writeln('In NearProc');
  37.   end;  { NearProc }
  38.  
  39. {$F+}
  40. procedure FarProc;            { Must be far due to compilerdirective }
  41.   begin { FarProc }
  42.     Writeln('In FarProc');
  43.   end;  { FarProc }
  44.  
  45. {$F-}
  46.  
  47. procedure TestSample;
  48.   begin { TestSample }
  49.     Writeln('In TestSample');
  50.     A := 10;
  51.     Writeln('Value of A before ASMPROC = ',A);
  52.     AsmProc;
  53.     Writeln('Value of A after ASMPROC = ',A);
  54.   end { TestSample };
  55.  
  56. end.
  57.