APPENDIX H: INTER-PROCESSOR PORTABILIY
This appendix describes those features of Pascal/MT+ which are not
portable to other versions of Pascal/MT+ for other microprocessors and
operating systems. A program written avoiding the following features
should compile with another Pascal/MT+ compiler with little or no
changes to the source code. This does not mean that all of the
features listed below are not implemented on any other target
processors. It only indicates that they are hardware dependent and
(if implemented) will be implemented differently in different versions
of the compiler. If any of these hardware dependent features are
used, isolate them so that they are easily modified when the program
is ported.
MT MicroSYSTEMS does not guarantee complete portability to all
processors supported by the Pascal/MT+ compiler. The guidelines which
follow are subject to change without notice. There is no more
information concerning portability to other Pascal/MT+ compilers.
If the user wishes to write portable programs the following rules
should followed:
- Avoid pointer arithmetic. On the 8080 the pointer and
integer data types have been made somewhat compatible to
allow address arithmetic.
- Avoid mini-assembler and INLINE
- Avoid I/O ports (hardware dependent )
- Avoid re-directed I/O (hardware dependent)
- Avoid device names such as CON:, RDR:, etc.
- Avoid scattering calls to IORESULT througout the the program and
isolate the calls. IORESULT values depend upon the operating system.
- Avoid ABSOLUTE addressing (hardware dependent)
- Avoid INTERRUPT procedures (hardware dependent)
- Avoid the use of variant records which are used to circumvent
type checking.
- Avoid chaining, this is not possible to use on all operating
systems.
- Avoid having overlays call other overlays, this is not possible
on other operating systems.
- Avoid WAIT and RIM85/SIM85. (these use 8080 and 8085
instructions)
- Avoid dependence upon EOF for non-TEXT files. It will probably
work differently on other operating systems. This is because some
operating systems keep track of how much information is in the file to
the exact byte and some only keep track to the sector/block level and
the last sector/block contains "garbage" information.
- Avoid using "temporary" files.
- Avoid BLOCKREAD/BLOCKWRITE as these may not be implemented on all
operating systems. Use SEEKREAD/SEEKWRITE instead.
- Avoid the FULLHEAP logic as some operating systems provide memory
management which is incompatible with our garbage collection.