mooO mcoo
rrodes 7 fie Ids can assllJlE expression in register An
expr
Define symbols in descending order
Define symbols in ascending order
name DFSECT [attributes] Define section (attributes are: READONLY, OVERLAY, DroP Define unintialized storage Do top of form
Set location counter within section
Set location counter to end of named section [,proc-sect-name [,
data-set-name]]] Program header
name Set location counter to eoo
PJIOLLO CONFIDENTIAL. INlERNAL USE ONLY. 7-5 Programming Information
fields of instructions. Program instructions must load the address register with the address of the expression and and preserve it over the static range that begins with the USIN} pseudo-op. The DROP pseudo-op ends the static range.
3. There is an implicit USIN} at the beginning of each assembly language roodule. The assembler assUIIeS that AS contains the address of the start of the IlI\TA$
section. DROP can be used to disable this.
Register usage AS - DB A6 - SB A7 - SF Structures
DEE'S defines a structure, addressed in ascending order.
DEFDS defines a descending structure. ENDS narks the end of a definition.
For example:
DEFS 4 (sp) a ds.w I b ds.l I c ds.l I ENDS
An assembly language roodule rray have any number of sections. The assembler creates two sections automatically - a read-only, concatenate, instruction section named PR(XE)URE$, and a read/write, concatenate, data section named DATA$. The names PROCEDURE$ and IlI\TA$
can be changed in the PROG!W\ or IDDULE statenent.
Sections and labels nay have the same n3It\e. The name is recognized as a section name only in the context of DFSEcr and SECI' statements.
DFSECl' defines a section. Its syntax is:
section-name DFSECI' section-attr ibutes-list e.g. DEBUG$ DFSECl' REI\DONLY
Valid section attr ibutes are READONLY, OVERLAY, ZERO, and INSI'RUCl'ION. If no attributes are specified, the section will be a data, concatenate, read/write section. OVERLAY
Programming Information 7-6 APOLLO CONFIDENTIAL INTERNAL USE ONLY.
sections overlay FORI'RAN (DM)N blocks and Pascal sections of tbe same name. ZERl instructs tbe loader to initialize the section to zero before loading.
SEer directs tbe assembler to use a named section. Its syntax is:
SEer section-name e.g. SEer DE!lJG$
This pseudo-op directs tbe assembler to put data or instructions in tbe specified section. It is similar to tbe PROC and DATA pseudo-ops, except tbat any section may be used.
Usage Information Conmmd line:
l\SM source-file [options]
Options: (* indicates default options)
*
-L [<listing file>]*
-NL -B [<binary file>]-NB -XREF
*
-NXREFGenerate assembly listing Suwress assembly listing Generate binary file Suwress binary file
Generate cross reference listing Suwress cross reference listing Source file names nust end in .asm. OUtput listing files and binary files end in .lst and .bin, respectively. For example, asm foo looks for foo.asm as input, and creates foo.bin and foo.lst.
Conditional I\ssembly ~
Note: ASH has conditional processor directives similar to PASCAL (see (l)NDITIONIIL l'roCESSIliG below) •
IFEQ expr IFNE expr IE'!' expr IFF expr ELSE
moe
II!lWi
1. IE'!' and IFNE assemble if expr <> O.
2. IFF and IFEQ assemble i f expr =
o.
APOLLO C(WFlDENTIAL. INTERNAL USE ONLY. 7-7 Programming Information
~:
PEA PEA IDVE.L JSR ADD.W
ARGn ARGI ECBADR,AO
(AO)
#4*n,SP
PUSH ADDRESS OF LAST ARG PUSH ADDRESS OF FIRSr ARG GET ADDRESS OF ECB
JUMP AND PUSH PC FOP ARG Pl'RS OFF srACK SUbrolltioe entry:
IDVE.L CLR.L IDVE.L IDVE.L LINK IDVE.L
DB,-(SP) SAVE CALLER'S llI\TA BASE REG - (SP) PUSH A RESERVID IIDRD AO ,- (SP) PUSH ADDRESS OF MY ECB 6(AO) ,DB WAD MY DATA BASE FRCM ECB tautosize,SB LOAD MY STACK BASE
& DEFINE l\lYlmATIC sroPAGE 20 (SE) ,IIDRK GET ADDR FIRST ARG
SUbroutine return:
UNLK ADD.W IDVE.L RI'S
SB
*8,SP (SP)+,DB
REWAD CALLER'S SE FOP LINKAGE STUFF REWAD CALLER'S DB RE.WRN '!O CALLER See also srACK FRAME, ECB.
Note: registers other than DB, SB, SP not preserved.
Programming Informati~n 7-8 APOLLO OONFIDENTIAL INTERNAL use ONLY.
CPNDITION/\L ProCESSING
Conditional processing applies to both PAS and ASM.
Conmmd Line S$¢ax
F"s [filename] -<XlNFIG namel name2 Coooitional Compilation Control Structure Syntax
%if <predicate> %then text
%elseif <predicate> %then text
%else text
%endif
<predicate> is of the form:
name
not <predicate>
<predicate> and <predicate>
<predicate> or <predicate>
«predicate> ) Additional Syntax:
%var namel narne2 ••• ;
%enable namel name2 .•• ;
%config
%error I string I
%warning I str ing I
%exit
%ifdef <predicate> %then text
%elseifdef <predicate> %then text
%else text
%endif
- attr ibute name -- highest precedence - "and" higher than "or"
- lowest precedence - grouping
- enumerate (declare) set of valid attr ibutes - enable attr ibutes - predeclared attribute - generate compiler diagnostic - generate compiler diagnostic - Stop processing this file ( (%elsif, %elsifdef, and %end nay also be used»
Syntax Restr j ctions
• Lines must exclusively contain either oonditional compilation directives or language source text.
• Only attribute names given on the oomrrand line and names created with %var nay be used in a
<predicate>.
• %error and %warning must be on lines by themselves.
APOLLO CONFIDENTIAL. INTERNAL USE ONl V. 7-9 Progranuning Infornation
• Names must be declared in a %Vl\R statanent before being used. Names given on the comnand line with -aJNFIG rust also appear in a %Vl\R statanent before being used in a predicate.
• A name evaluates to '!RUE in a %IF /%ELSEIF statanent if it is enabled on the comnand line with the -aJNFIG option, or enabled with a %ENABLE statanent.
• A name evaluates to '!RUE in a %IFDEF/%ELSEIFDEF statanent if-and-only-if it is declared with a
%Vl\R statanent.
• '!be pre-declsred attribute name %<DNFIG is 'mIJE iff a -aJNFIG option was given on the COITI1Blld line with non-null arguments.
• Declaring an alreadY declared name will resUlt in a warning. Using an undeclared name will result in a warning. Enabling a name that is alreadY enabled will result in a warning.
Programming Information 7-10 APOLLO CONFIDENTIAL NTERNAL USE ONLY.
mrRY mN:mDL BI.DCK CECal
(type db_$ecbJec in /us/deoog/db.deoog$.ins.J;as) 15
+ - - - + +00 I JUMP I • jrnp
+ +
I TO I
+ + .cs
I PROCEDURE I - t - - - + +06 I -)DATA I
+ + .db
I AREA I
+ - - - + +OA I - - - - -BlAND I .keys
+---+
+OC I DEBUG I
+ + .detug
I
INFOI
+10
+---+
B = 1 =) Stop looking back in stack for inhbt routines I = 1 =) Inhibit async faults for routine
A = 1 =) Apollo software N = 1 =) Detug info present D
=
1 =) DB reg not savedAPOLLO CONFIDENTIAL. INTERNAL USE ONLY. 7-11 Programming Information
FlLEJ:0ME SnFFIXES Display nanager (output) Canpilers (output) RFC 00IIlIIBIld (output),
/sysboot (inp.1t)
Schema, subschena, aggregate schena DDL Outp.1t from the RDL
ASCII listing of the schena, subschema, aggregate schema COIIPiler
Outp.1t from the D3M/FO~
Executable D3M/IlATAVIEW COJDI1BI1ds Source for report writer
Progrannning Information 7-12 APOLLO CONRDENTIAL. INTERNAL USE ONL V.
PATHNI\ME SYNr/\X
Starting Point SynOOl
//
/
\ or none
Network root directory Node entry directory Naming directory Parent directory Working directory /sys/node_data [.nn]
Legal characters in names:
A-Z
a-z 0-9
$ (dollar sign) (tmderscore) (period) Names cannot start with Valid pathnames:
/PASCAL
\MISC/SAU_SCURCE
.
-. ,
/ /US/INS/STREAMS. INS. F"lN -com
-liniularne
PASCAL EXTENSIONS
or digits •
PAS compiler: Features for internal Ap:>11o use only are marked with (*).
A Pascal "procedure" or "function" may be given a variety of attributes or options which may be used to change the behavior of the routine or the system usage of the routine.
llllIi...I'lIIW: (*)
"VAL.-_PARAM" is an attribute which can be specified for a procedure or function. When it is given, argurrents which are not to be changed by the called routine (Le. 'value' argurrents and 'IN' argtJm:!nts) and which are 32 bits or less, are passed by "value" instead of by "reference".
'Ibis makes the code a little more efficient. If you use this attr ibute, you may WI' invoke the routine from Fortran or C. Note that VAIcPARAM is superfluous i f the INrERNAL attribute is used, or the routine is nested.
APOLLO CONFIDENTIAL INTERNAL USE ONL v. 7-13 Programming Information
Example:
FUNCTION fnCLname (IN!'li'ffie : IDNLN_ROC;
IN p:lefJlag : BOCLEAN) OBJEO'_Pm;
VAIJ'ARl\M; EXTERN;
OPl'IONSO clause
The "OPl'IONS" clause is another way of giving procedure or flmction attributes. I t allows you to group your attributes in one place. If you use the "OPl'IONS"' clause, you nay WI' have attributes outside it. Furthermore, the
"OPl'IONS" clause ~rmits additional attributes.
In the example above, the function could have been specified as follows:
FUNCTION fnCLname (IN ~ : IDNLN.- ROC;
IN p:lefJlag : 13OOLE1\N) : OBJECT_Pm;
OPrIONS(~PARl\M, EXTERN);
Note that the attr ibutes of VAL_PARAM. and EXTERN are separate by comras in the OPI'IONS clause.
Furthenoore, the following attributes, if desired, nay ONLY be given in an OPl'IONS clause. These are;
IN!illUT: (*)
The inhibit attribute sets a bit in the OCB flags which inhibits asynchronous faults for the routine.
~:(*)
The backstop attribute sets a bit in the OCB flags which stop looking back in stack for "inhibit"ed routines.
Yl\IUl\.!ll.& :
The variable attr ibute allows a variable nurrber of arguments to be given to the routine invocation. The number of arguments may be less than or equal to the number of parameters in the declaration. It nay IDT be more. It is up to the writer of the routine to know how roany arguments were actually passed. Generally, scme kind of argument count should be given as one of the arguments
(such as the first one).
Programning Information 7-14 APOllO CONFIDENTIAL. INTERNAL USE ONl
STACK FRAME
SP