home *** CD-ROM | disk | FTP | other *** search
- { -----------------------------------------------------------------------------
-
- NOTICE:
-
- THESE MATERIALS are UNSUPPORTED by OSS! If you do not understand how to
- use them do not contact OSS for help! We will not teach you how to
- program in Pascal. If you find an error in these materials, feel free
- to SEND US A LETTER explaining the error, and how to fix it.
-
- THE BOTTOM LINE:
-
- Use it, enjoy it, but you are on your own when using these materials!
-
-
- DISCLAIMER:
-
- OSS makes no representations or warranties with respect to the contents
- hereof and specifically disclaim all warranties of merchantability or
- fitness for any particular purpose. This document is subject to change
- without notice.
-
- OSS provides these materials for use with Personal Pascal. Use them in
- any way you wish.
-
- -------------------------------------------------------------------------- }
-
-
- { peekpoke.pas - Include this file when you compile to implement PEEK and
- POKE functions. }
-
- {$P-}
-
- FUNCTION peek( address: long_integer ): long_integer;
-
- TYPE
- byte_ptr = ^byte;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: byte_ptr );
- END;
-
- BEGIN
- funny.a := address;
- peek := funny.p^;
- END;
-
- FUNCTION wpeek( address: long_integer ): long_integer;
-
- TYPE
- int_ptr = ^integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: int_ptr );
- END;
-
- BEGIN
- funny.a := address;
- wpeek := funny.p^;
- END;
-
- FUNCTION lpeek( address: long_integer ): long_integer;
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- lpeek := funny.p^;
- END;
-
- PROCEDURE poke( address: long_integer; value: byte );
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- PROCEDURE wpoke( address: long_integer; value: integer );
-
- TYPE
- int_ptr = ^integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: int_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- PROCEDURE lpoke( address, value: long_integer );
-
- TYPE
- lint_ptr = ^long_integer;
-
- VAR
- funny: RECORD
- CASE boolean OF
- true: ( a: long_integer );
- false: ( p: lint_ptr );
- END;
-
- BEGIN
- funny.a := address;
- funny.p^ := value;
- END;
-
- {$P=}
-