home *** CD-ROM | disk | FTP | other *** search
- PROGRAM PasDemo;
-
- { Test program, to be linked to externals in PASDEMO.OBJ }
- {$D+} { include debugging info }
-
- CONST value : Integer = 1234; { typed-constant declaration }
-
- TYPE IntPtr = Integer; { pointer to integer type }
-
- VAR cr,lf : Char; { Global variables }
-
- PROCEDURE PasProc; FORWARD;
- FUNCTION PasFunc: Char; FORWARD;
-
- {$L PASDEMO.OBJ} { tell Turbo Pascal to load the assembled object code }
-
- { External declarations, telling Turbo Pascal the format of the
- external routines in PASDEMO.asm }
-
- PROCEDURE AsmProc; EXTERNAL;
- FUNCTION CountPtr: IntPtr; EXTERNAL;
-
- PROCEDURE PasProc;
- VAR i : Integer;
- BEGIN
- Writeln( 'PasProc: Inside the Pascal procedure' )
- END; { PasProc }
-
- FUNCTION PasFunc: Char;
- BEGIN
- PasFunc := '#'
- END; { PasFunc }
-
- BEGIN
- cr := chr( 13 );
- lf := chr( 10 );
- AsmProc;
- Writeln( 'Main: asmCount = ', countPtr^ )
- END.