TAL Reference Manual

Privileged Procedures
TAL Reference Manual526371-001
15-15
Examples of TARGET Directive
Any TARGET Directive
If any TARGET directive is in effect, the compiler:
Compiles code between IF TARGETSPECIFIED and ENDIF TARGETSPECIFIED
Skips code between IFNOT TARGETSPECIFIED and ENDIF TARGETSPECIFIED
If no TARGET directive is in effect, the compiler:
Compiles code between IFNOT TARGETSPECIFIED and ENDIF
TARGETSPECIFIED
Skips code between IF TARGETSPECIFIED and ENDIF TARGETSPECIFIED
Examples of TARGET Directive
1. Use TARGET to source in system-specific declarations from a library file. The
following fragment from a library file applies to Examples 2, 3, and 4:
?SECTION part1
?IF TNS_ARCH
LITERAL pagesize = 2048;
LITERAL pages_in_seg = 64;
?ENDIF TNS_ARCH
?IF TNS_R_ARCH
LITERAL pagesize = 4069;
LITERAL pages_in_seg = 32;
?ENDIF TNS_R_ARCH
LITERAL bytes_in_seg = pages_in_seg * pagesize;
!System-specific
LITERAL max_file_size = 12; !Not system-specific
?SECTION part2
LITERAL max_buffer_size = 1024; !Not system-specific
2. If your program uses MAX_BUFFER_SIZE, source in section PART2. Do not
specify a TARGET directive when you compile your program.
3. If your program uses BYTES_IN_SEG, produce two object files by compiling once
with TARGET TNS_ARCH and then again with TARGET TNS_R_ARCH. Specify
each TARGET directive in a compilation command or at the beginning of the
source file. For example, you can specify TARGET in compilation commands as
follows:
TAL /IN mysource /objtns; TARGET TNS_ARCH
TAL /IN mysource /objtnsr; TARGET TNS_R_ARCH