Seq # *Modification Id* Act
----------------------------+
00001 M00S00001.sympcod +++|*NOSEQ
00002 M00S00002.sympcod +++|*WIDTH 132
00003 M00S00003.sympcod +++|1
00004 M00S00004.sympcod +++|
00005 M00S00005.sympcod +++|
00006 M00S00006.sympcod +++|
00007 M00S00007.sympcod +++|
00008 M00S00008.sympcod +++|
00009 M00S00009.sympcod +++|
00010 M00S00010.sympcod +++|
00011 M00S00011.sympcod +++|
00012 M00S00012.sympcod +++|
00013 M00S00013.sympcod +++|
00014 M00S00014.sympcod +++|
00015 M00S00015.sympcod +++|
00016 M00S00016.sympcod +++|
00017 M00S00017.sympcod +++|
00018 M00S00018.sympcod +++|
00019 M00S00019.sympcod +++| ------------------------------------------------
00020 M00S00020.sympcod +++| ! !
00021 M00S00021.sympcod +++| ! NOS SYMPL CODING STANDARD !
00022 M00S00022.sympcod +++| ! !
00023 M00S00023.sympcod +++| ------------------------------------------------
00024 M00S00024.sympcod +++|
00025 M00S00025.sympcod +++|1 1
00026 M00S00026.sympcod +++| 06/01/83
00027 M00S00027.sympcod +++|
00028 M00S00028.sympcod +++| TABLE OF CONTENTS
00029 M00S00029.sympcod +++|
00030 M00S00030.sympcod +++|
00031 M00S00031.sympcod +++|
00032 M00S00032.sympcod +++|
00033 M00S00033.sympcod +++| 1.0 Introduction . . . . . . . . . . . . . . . . . . . . . 1-1
00034 M00S00034.sympcod +++|
00035 M00S00035.sympcod +++| 2.0 Coding Standards . . . . . . . . . . . . . . . . . . . 2-1
00036 M00S00036.sympcod +++| 2.1 General . . . . . . . . . . . . . . . . . . . . . . . 2-1
00037 M00S00037.sympcod +++| 2.2 Parameters . . . . . . . . . . . . . . . . . . . . . . 2-2
00038 M00S00038.sympcod +++| 2.3 XREF . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
00039 M00S00039.sympcod +++| 2.4 DEF . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
00040 M00S00040.sympcod +++| 2.5 STATUS . . . . . . . . . . . . . . . . . . . . . . . . 2-3
00041 M00S00041.sympcod +++| 2.6 COMDECK . . . . . . . . . . . . . . . . . . . . . . . 2-3
00042 M00S00042.sympcod +++| 2.7 Non-array Items . . . . . . . . . . . . . . . . . . . 2-4
00043 M00S00043.sympcod +++| 2.8 Arrays . . . . . . . . . . . . . . . . . . . . . . . . 2-4
00044 M00S00044.sympcod +++| 2.9 FOR Loops (Fast or Slow) . . . . . . . . . . . . . . . 2-5
00045 M00S00045.sympcod +++| 2.10 GOTOs and SWITCHes (Case Statement) . . . . . . . . . 2-5
00046 M00S00046.sympcod +++| 2.11 IF . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
00047 M00S00047.sympcod +++| 2.12 Bead . . . . . . . . . . . . . . . . . . . . . . . . 2-6
00048 M00S00048.sympcod +++| 2.13 PROCs, FUNCs, and PRGMs . . . . . . . . . . . . . . . 2-6
00049 M00S00049.sympcod +++|
00050 M00S00050.sympcod +++| 3.0 Naming Conventions . . . . . . . . . . . . . . . . . 3-1
00051 M00S00051.sympcod +++|
00052 M00S00052.sympcod +++| 4.0 Code Readability . . . . . . . . . . . . . . . . . . . 4-1
00053 M00S00053.sympcod +++| 4.1 Format of Statements . . . . . . . . . . . . . . . . . 4-1
00054 M00S00054.sympcod +++| 4.2 Column 1 . . . . . . . . . . . . . . . . . . . . . . . 4-2
00055 M00S00055.sympcod +++| 4.3 Blank Lines . . . . . . . . . . . . . . . . . . . . . 4-2
00056 M00S00056.sympcod +++| 4.4 Page Ejects . . . . . . . . . . . . . . . . . . . . . 4-2
00057 M00S00057.sympcod +++|
00058 M00S00058.sympcod +++| 5.0 Documentation Standards . . . . . . . . . . . . . . . 5-1
00059 M00S00059.sympcod +++| 5.1 Comment Formats and Types . . . . . . . . . . . . . . 5-1
00060 M00S00060.sympcod +++| 5.1.1 Embedded Comments . . . . . . . . . . . . . . . . 5-1
00061 M00S00061.sympcod +++| 5.1.2 Single Line Comments . . . . . . . . . . . . . . . 5-1
00062 M00S00062.sympcod +++| 5.1.3 Stand Alone Comments . . . . . . . . . . . . . . . 5-2
00063 M00S00063.sympcod +++| 5.1.3.1 Brackets (****) . . . . . . . . . . . . . . . 5-2
00064 M00S00064.sympcod +++| 5.1.3.2 External Comments (***) . . . . . . . . . . . 5-2
00065 M00S00065.sympcod +++| 5.1.3.3 Internal Comments (**) . . . . . . . . . . . . 5-2
00066 M00S00066.sympcod +++| 5.1.3.4 Module Comments (*) . . . . . . . . . . . . . 5-3
00067 M00S00067.sympcod +++| 5.2 Program Level Documentation . . . . . . . . . . . . . 5-3
00068 M00S00068.sympcod +++| 5.3 Documentation of PROCs and FUNCs . . . . . . . . . . . 5-4
00069 M00S00069.sympcod +++| 5.4 Documentation with Embedded Comments . . . . . . . . . 5-4
00070 M00S00070.sympcod +++| 5.4.1 Data Declaration Embedded Comments . . . . . . . . 5-4
00071 M00S00071.sympcod +++| 5.4.2 Action Code Embedded Comments . . . . . . . . . . 5-5
00072 M00S00072.sympcod +++| 5.5 General Documentation for PROCs, PRGMs or FUNCs . . . 5-5
00073 M00S00073.sympcod +++|
00074 M00S00074.sympcod +++| 6.0 Examples . . . . . . . . . . . . . . . . . . . . . . . 6-1
00075 M00S00075.sympcod +++| 6.1 COMDECK Examples . . . . . . . . . . . . . . . . . . . 6-1
00076 M00S00076.sympcod +++| 6.2 PROC Example . . . . . . . . . . . . . . . . . . . . . 6-2
00077 M00S00077.sympcod +++| 6.3 Status List/Status Switch Example . . . . . . . . . . 6-4
00078 M00S00078.sympcod +++|
00079 M00S00079.sympcod +++|
00080 M00S00080.sympcod +++|
00081 M00S00081.sympcod +++| A1.0 Addendum for SMF Project . . . . . . . . . . . . . . A1-1
00082 M00S00082.sympcod +++|
00083 M00S00083.sympcod +++|1
00084 M00S00084.sympcod +++| 1-1
00085 M00S00085.sympcod +++| NOS SYMPL CODING STANDARD
00086 M00S00086.sympcod +++| 06/01/83
00087 M00S00087.sympcod +++| -----------------------------------------------------------------
00088 M00S00088.sympcod +++| 1.0 Introduction
00089 M00S00089.sympcod +++| -----------------------------------------------------------------
00090 M00S00090.sympcod +++|
00091 M00S00091.sympcod +++|
00092 M00S00092.sympcod +++| 1.0 Introduction
00093 M00S00093.sympcod +++|
00094 M00S00094.sympcod +++|
00095 M00S00095.sympcod +++|
00096 M00S00096.sympcod +++|
00097 M00S00097.sympcod +++|
00098 M00S00098.sympcod +++| The purpose of this standard is to provide a meaningful set of
00099 M00S00099.sympcod +++| practices which will lead to "good", consistent, maintainable,
00100 M00S00100.sympcod +++| organized and optimized SYMPL code. This document used the SYMPL
00101 M00S00101.sympcod +++| Coding Standards DAP (DCS S1831), the NOS COMPASS Programming
00102 M00S00102.sympcod +++| Standard, and the SYMPL Coding Standards for the SYMPL project in
00103 M00S00103.sympcod +++| SVL as guidelines.
00104 M00S00104.sympcod +++|
00105 M00S00105.sympcod +++| This standard is in addition to the NOS COMPASS Programming
00106 M00S00106.sympcod +++| Standard. The procedures established in the COMPASS standard
00107 M00S00107.sympcod +++| which are not unique to the COMPASS language (i.e. General
00108 M00S00108.sympcod +++| Requirements, Code Transmittal Rules, and Dayfile Messages) are
00109 M00S00109.sympcod +++| to be adhered to for SYMPL programming also.
00110 M00S00110.sympcod +++|
00111 M00S00111.sympcod +++| Where the word "must" appears in this standard, deviations
00112 M00S00112.sympcod +++| will not be approved. Where the word "should" appears, reviewers
00113 M00S00113.sympcod +++| may allow a deviation if the analyst can present convincing
00114 M00S00114.sympcod +++| reasons for the deviation.
00115 M00S00115.sympcod +++|
00116 M00S00116.sympcod +++|1
00117 M00S00117.sympcod +++| 2-1
00118 M00S00118.sympcod +++| NOS SYMPL CODING STANDARD
00119 M00S00119.sympcod +++| 06/01/83
00120 M00S00120.sympcod +++| -----------------------------------------------------------------
00121 M00S00121.sympcod +++| 2.0 Coding Standards
00122 M00S00122.sympcod +++| -----------------------------------------------------------------
00123 M00S00123.sympcod +++|
00124 M00S00124.sympcod +++|
00125 M00S00125.sympcod +++| 2.0 Coding Standards
00126 M00S00126.sympcod +++|
00127 M00S00127.sympcod +++|
00128 M00S00128.sympcod +++|
00129 M00S00129.sympcod +++|
00130 M00S00130.sympcod +++|
00131 M00S00131.sympcod +++| 2.1 General
00132 M00S00132.sympcod +++|
00133 M00S00133.sympcod +++|
00134 M00S00134.sympcod +++| All declarations pertaining to a PROC or FUNC should use the
00135 M00S00135.sympcod +++| following grouping
00136 M00S00136.sympcod +++|
00137 M00S00137.sympcod +++| Formal Parameters
00138 M00S00138.sympcod +++| XREFs
00139 M00S00139.sympcod +++| DEFs
00140 M00S00140.sympcod +++| STATUS names
00141 M00S00141.sympcod +++| COMDECKs
00142 M00S00142.sympcod +++| ITEMs
00143 M00S00143.sympcod +++| BASED ARRAYs
00144 M00S00144.sympcod +++| ARRAYs
00145 M00S00145.sympcod +++| SWITCHes
00146 M00S00146.sympcod +++| Other
00147 M00S00147.sympcod +++|
00148 M00S00148.sympcod +++| All declarations or calls to COMDECKs should be in alphabetic
00149 M00S00149.sympcod +++| order.
00150 M00S00150.sympcod +++|
00151 M00S00151.sympcod +++| Each declaration must start on a separate line and must be
00152 M00S00152.sympcod +++| accompanied by a comment describing its function.
00153 M00S00153.sympcod +++|
00154 M00S00154.sympcod +++| Each executable statement must start on a separate line.
00155 M00S00155.sympcod +++|
00156 M00S00156.sympcod +++| Each BEGIN and END must be on a separate line.
00157 M00S00157.sympcod +++|
00158 M00S00158.sympcod +++| A declaration which is a one-bit field should be Boolean.
00159 M00S00159.sympcod +++|
00160 M00S00160.sympcod +++| Self modifying code must not be used.
00161 M00S00161.sympcod +++|
00162 M00S00162.sympcod +++| All labels begin in column one. Labels must appear on lines
00163 M00S00163.sympcod +++| by themselves except for embedded comments. All label names must
00164 M00S00164.sympcod +++| be unique within a PROC/FUNC.
00165 M00S00165.sympcod +++|
00166 M00S00166.sympcod +++| TEST must never be used without explicitly stating the
00167 M00S00167.sympcod +++| induction variable it is testing.
00168 M00S00168.sympcod +++|
00169 M00S00169.sympcod +++| Define CONTROL DISJOINT and CONTROL INERT in a COMDECK. Use
00170 M00S00170.sympcod +++| CONTROL OVERLAP and CONTROL REACTIVE to define the exceptions.
00171 M00S00171.sympcod +++|
00172 M00S00172.sympcod +++| Where numeric constants are established via DEFs or STATUS
00173 M00S00173.sympcod +++| lists, the assumed numeric values should not appear in the
00174 M00S00174.sympcod +++| coding documentation.
00175 M00S00175.sympcod +++|
00176 M00S00176.sympcod +++| Items I, J and K should be reserved as simple loop or control
00177 M00S00177.sympcod +++| variables.
00178 M00S00178.sympcod +++|1
00179 M00S00179.sympcod +++| 2-2
00180 M00S00180.sympcod +++| NOS SYMPL CODING STANDARD
00181 M00S00181.sympcod +++| 06/01/83
00182 M00S00182.sympcod +++| -----------------------------------------------------------------
00183 M00S00183.sympcod +++| 2.0 Coding Standards
00184 M00S00184.sympcod +++| 2.1 General
00185 M00S00185.sympcod +++| -----------------------------------------------------------------
00186 M00S00186.sympcod +++|
00187 M00S00187.sympcod +++| The code must not make assumptions about the octal representa-
00188 M00S00188.sympcod +++| tion of characters. This representation varies between the
00189 M00S00189.sympcod +++| various NOS character sets.
00190 M00S00190.sympcod +++|
00191 M00S00191.sympcod +++| Machine independent instructions when available should be used
00192 M00S00192.sympcod +++| in preference to dependent structures.
00193 M00S00193.sympcod +++|
00194 M00S00194.sympcod +++|
00195 M00S00195.sympcod +++| 2.2 Parameters
00196 M00S00196.sympcod +++|
00197 M00S00197.sympcod +++|
00198 M00S00198.sympcod +++| Use call-by-value parameters whenever possible. Only use
00199 M00S00199.sympcod +++| call-by-address when the parameter is modified within the
00200 M00S00200.sympcod +++| procedure and the new value of the parameters is returned to the
00201 M00S00201.sympcod +++| calling program.
00202 M00S00202.sympcod +++|
00203 M00S00203.sympcod +++| Reuse actual parameter lists whenever possible. If the
00204 M00S00204.sympcod +++| parameters are used for a number of calls, use the same order of
00205 M00S00205.sympcod +++| parameters for more efficient coding.
00206 M00S00206.sympcod +++|
00207 M00S00207.sympcod +++| Formal parameters must be declared within the PROC/FUNC rather
00208 M00S00208.sympcod +++| than in a common deck. They can be ordered alphabetically or
00209 M00S00209.sympcod +++| according to the calling sequence.
00210 M00S00210.sympcod +++|
00211 M00S00211.sympcod +++| An array item must not be used as a parameter where a new
00212 M00S00212.sympcod +++| value of the parameter is returned, since this feature is not
00213 M00S00213.sympcod +++| supported in SYMPL.
00214 M00S00214.sympcod +++|
00215 M00S00215.sympcod +++|
00216 M00S00216.sympcod +++| 2.3 XREF
00217 M00S00217.sympcod +++|
00218 M00S00218.sympcod +++|
00219 M00S00219.sympcod +++| Declaration of external procedure names are to be done in the
00220 M00S00220.sympcod +++| following format. The referenced PROC/FUNC names are to be in
00221 M00S00221.sympcod +++| alphabetic sequence.
00222 M00S00222.sympcod +++|
00223 M00S00223.sympcod +++| Example:
00224 M00S00224.sympcod +++|
00225 M00S00225.sympcod +++| #
00226 M00S00226.sympcod +++| **** PROC Y - XREF LIST BEGIN.
00227 M00S00227.sympcod +++| #
00228 M00S00228.sympcod +++|
00229 M00S00229.sympcod +++| XREF
00230 M00S00230.sympcod +++| BEGIN
00231 M00S00231.sympcod +++| PROC APPLE; # PARES APPLE #
00232 M00S00232.sympcod +++| PROC BANANA; # PEELS BANANA #
00233 M00S00233.sympcod +++| PROC ORANGE; # SQUEEZES ORANGE #
00234 M00S00234.sympcod +++| END
00235 M00S00235.sympcod +++|
00236 M00S00236.sympcod +++| #
00237 M00S00237.sympcod +++| **** PROC Y - XREF LIST END.
00238 M00S00238.sympcod +++| #
00239 M00S00239.sympcod +++|
00240 M00S00240.sympcod +++|1
00241 M00S00241.sympcod +++| 2-3
00242 M00S00242.sympcod +++| NOS SYMPL CODING STANDARD
00243 M00S00243.sympcod +++| 06/01/83
00244 M00S00244.sympcod +++| -----------------------------------------------------------------
00245 M00S00245.sympcod +++| 2.0 Coding Standards
00246 M00S00246.sympcod +++| 2.4 DEF
00247 M00S00247.sympcod +++| -----------------------------------------------------------------
00248 M00S00248.sympcod +++|
00249 M00S00249.sympcod +++| 2.4 DEF
00250 M00S00250.sympcod +++|
00251 M00S00251.sympcod +++|
00252 M00S00252.sympcod +++| Use DEF to provide symbolic constants for numeric constants
00253 M00S00253.sympcod +++| for ease in finding, identifying and modifying parameters.
00254 M00S00254.sympcod +++|
00255 M00S00255.sympcod +++| A DEF must not be used to rename a variable.
00256 M00S00256.sympcod +++|
00257 M00S00257.sympcod +++| A DEF must not be used to redefine a function call, a reserved
00258 M00S00258.sympcod +++| word, or an operation unless it is used consistently throughout
00259 M00S00259.sympcod +++| the system to improve clarity. Otherwise, this may tend to
00260 M00S00260.sympcod +++| obscure the actual code. All DEFs which redefine the code or
00261 M00S00261.sympcod +++| make it a conditional compilation will be placed in a COMDECK.
00262 M00S00262.sympcod +++|
00263 M00S00263.sympcod +++| The DEF format for a full word octal constant is in 4-digit
00264 M00S00264.sympcod +++| parcels. For example:
00265 M00S00265.sympcod +++|
00266 M00S00266.sympcod +++| DEF ERRMASK #O"0037 7740 0505 0000 7777"#; # ERROR BIT MASK #
00267 M00S00267.sympcod +++|
00268 M00S00268.sympcod +++|
00269 M00S00269.sympcod +++| 2.5 STATUS
00270 M00S00270.sympcod +++|
00271 M00S00271.sympcod +++|
00272 M00S00272.sympcod +++| Status lists should contain no unused positions. Any unused
00273 M00S00273.sympcod +++| positions must be filled with a dummy argument and have a
00274 M00S00274.sympcod +++| # RESERVED # or # NOT USED # comment. It may be better to use
00275 M00S00275.sympcod +++| DEFs if there are many unused positions or any of the elements
00276 M00S00276.sympcod +++| are expected to change.
00277 M00S00277.sympcod +++|
00278 M00S00278.sympcod +++|
00279 M00S00279.sympcod +++| 2.6 COMDECK
00280 M00S00280.sympcod +++|
00281 M00S00281.sympcod +++|
00282 M00S00282.sympcod +++| Executable code should not be placed in a COMDECK.
00283 M00S00283.sympcod +++|
00284 M00S00284.sympcod +++| The declarations for a data structure must be wholly contained
00285 M00S00285.sympcod +++| within a single common deck. Where two or more data structures
00286 M00S00286.sympcod +++| are interdependent, the declarations for the interdependent
00287 M00S00287.sympcod +++| structures must be in the same common deck.
00288 M00S00288.sympcod +++|
00289 M00S00289.sympcod +++| Logically associated data items and structures should be
00290 M00S00290.sympcod +++| declared in one COMDECK unless they are only to be used by one
00291 M00S00291.sympcod +++| module where they may be declared locally.
00292 M00S00292.sympcod +++|
00293 M00S00293.sympcod +++| One or more COMDECKs must contain all declarations affecting
00294 M00S00294.sympcod +++| table size which could be changed with the system. This is to
00295 M00S00295.sympcod +++| facilitate maintenance.
00296 M00S00296.sympcod +++|
00297 M00S00297.sympcod +++| Common decks must not be listed.
00298 M00S00298.sympcod +++|
00299 M00S00299.sympcod +++| A PRGM, PROC or FUNC should only call the common decks that it
00300 M00S00300.sympcod +++| references.
00301 M00S00301.sympcod +++|
00302 M00S00302.sympcod +++|1
00303 M00S00303.sympcod +++| 2-4
00304 M00S00304.sympcod +++| NOS SYMPL CODING STANDARD
00305 M00S00305.sympcod +++| 06/01/83
00306 M00S00306.sympcod +++| -----------------------------------------------------------------
00307 M00S00307.sympcod +++| 2.0 Coding Standards
00308 M00S00308.sympcod +++| 2.6 COMDECK
00309 M00S00309.sympcod +++| -----------------------------------------------------------------
00310 M00S00310.sympcod +++|
00311 M00S00311.sympcod +++| Every common deck must have an overview description of what it
00312 M00S00312.sympcod +++| does. The following format is to be used. The list control
00313 M00S00313.sympcod +++| statements begin in column 48.
00314 M00S00314.sympcod +++|
00315 M00S00315.sympcod +++| # deck name - description. #
00316 M00S00316.sympcod +++| CONTROL NOLIST;
00317 M00S00317.sympcod +++| CONTROL IFEQ LISTCON,1;
00318 M00S00318.sympcod +++| CONTROL LIST;
00319 M00S00319.sympcod +++| CONTROL FI;
00320 M00S00320.sympcod +++|
00321 M00S00321.sympcod +++| #
00322 M00S00322.sympcod +++| *** deck name - description.
00323 M00S00323.sympcod +++| *
00324 M00S00324.sympcod +++| * (purpose) (several lines can be used)
00325 M00S00325.sympcod +++| #
00326 M00S00326.sympcod +++|
00327 M00S00327.sympcod +++| CONTROL LIST;
00328 M00S00328.sympcod +++|
00329 M00S00329.sympcod +++|
00330 M00S00330.sympcod +++| 2.7 Non-array Items
00331 M00S00331.sympcod +++|
00332 M00S00332.sympcod +++|
00333 M00S00333.sympcod +++| The items, the variable names, the types, the presets and the
00334 M00S00334.sympcod +++| embedded comments should each be vertically aligned. Leave room
00335 M00S00335.sympcod +++| for ten character variable names and leave room for character
00336 M00S00336.sympcod +++| counts on character type items for ease of future maintenance.
00337 M00S00337.sympcod +++|
00338 M00S00338.sympcod +++| Variables should be declared alphabetically.
00339 M00S00339.sympcod +++|
00340 M00S00340.sympcod +++|
00341 M00S00341.sympcod +++| 2.8 Arrays
00342 M00S00342.sympcod +++|
00343 M00S00343.sympcod +++|
00344 M00S00344.sympcod +++| Arrays used by more than one PROC must be defined in
00345 M00S00345.sympcod +++| COMDECKs.
00346 M00S00346.sympcod +++|
00347 M00S00347.sympcod +++| Usage of items from an array must always be subscripted. It
00348 M00S00348.sympcod +++| is confusing to default subscripts.
00349 M00S00349.sympcod +++|
00350 M00S00350.sympcod +++| Item declarations must be in ascending order (i.e. word 0 bit
00351 M00S00351.sympcod +++| 0 to word n bit n). If overlapping declarations are used, then
00352 M00S00352.sympcod +++| the item which spans other items must be first.
00353 M00S00353.sympcod +++|
00354 M00S00354.sympcod +++| Array indices should start with zero.
00355 M00S00355.sympcod +++|
00356 M00S00356.sympcod +++| The array name, bounds and the allocation/size must be
00357 M00S00357.sympcod +++| separated by blanks (e.g. ARRAY EXMAPLE [0:10] P(2); ).
00358 M00S00358.sympcod +++|
00359 M00S00359.sympcod +++| Items within an array are aligned with the begin for ease of
00360 M00S00360.sympcod +++| reading. Each item must be documented.
00361 M00S00361.sympcod +++|
00362 M00S00362.sympcod +++|1
00363 M00S00363.sympcod +++| 2-5
00364 M00S00364.sympcod +++| NOS SYMPL CODING STANDARD
00365 M00S00365.sympcod +++| 06/01/83
00366 M00S00366.sympcod +++| -----------------------------------------------------------------
00367 M00S00367.sympcod +++| 2.0 Coding Standards
00368 M00S00368.sympcod +++| 2.8 Arrays
00369 M00S00369.sympcod +++| -----------------------------------------------------------------
00370 M00S00370.sympcod +++|
00371 M00S00371.sympcod +++| The item names, type/positions, preset values, and embedded
00372 M00S00372.sympcod +++| comments should each be vertically aligned. Leave room for ten
00373 M00S00373.sympcod +++| character item names and for two digit "ep", "fbit", and "size"
00374 M00S00374.sympcod +++| fields and use at least two spaces after the semicolon to ease
00375 M00S00375.sympcod +++| future maintenance.
00376 M00S00376.sympcod +++|
00377 M00S00377.sympcod +++|
00378 M00S00378.sympcod +++| 2.9 FOR Loops (Fast or Slow)
00379 M00S00379.sympcod +++|
00380 M00S00380.sympcod +++|
00381 M00S00381.sympcod +++| FOR loops are of two types. In the slow FOR loop, the object
00382 M00S00382.sympcod +++| code has a direct correspondence with the SYMPL statements. This
00383 M00S00383.sympcod +++| is not the case with fast loops. A fast-for-loop is optimized by
00384 M00S00384.sympcod +++| pre-evaluating the STEP and UNTIL/WHILE elements. At least one
00385 M00S00385.sympcod +++| cycle of the loop is executed.
00386 M00S00386.sympcod +++|
00387 M00S00387.sympcod +++| Fast FOR loops and slow FOR loops must be used. A simple
00388 M00S00388.sympcod +++| FOR statement must not be used. For easier readability and
00389 M00S00389.sympcod +++| programming, use DEF statements to set up FASTFOR or SLOWFOR
00390 M00S00390.sympcod +++| instead of the CONTROL FASTLOOP or CONTROL SLOWLOOP. These DEF
00391 M00S00391.sympcod +++| statements should be placed in a COMDECK.
00392 M00S00392.sympcod +++|
00393 M00S00393.sympcod +++| DEF FASTFOR #CONTROL FASTLOOP; FOR#
00394 M00S00394.sympcod +++| DEF SLOWFOR #CONTROL SLOWLOOP; FOR#
00395 M00S00395.sympcod +++|
00396 M00S00396.sympcod +++| For better optimization consider using STEP/WHILE as an
00397 M00S00397.sympcod +++| alternative to STEP/UNTIL.
00398 M00S00398.sympcod +++|
00399 M00S00399.sympcod +++| The induction variable must not be changed during the loop or
00400 M00S00400.sympcod +++| by a FUNC called while evaluating the STEP/UNTIL/WHILE part.
00401 M00S00401.sympcod +++|
00402 M00S00402.sympcod +++| The exit from a loop should be through an UNTIL/WHILE or a
00403 M00S00403.sympcod +++| return statement. The entry into a loop must not be in the
00404 M00S00404.sympcod +++| middle of the loop.
00405 M00S00405.sympcod +++|
00406 M00S00406.sympcod +++| The executable statement(s) after the DO part of a FOR loop
00407 M00S00407.sympcod +++| must be enclosed in a BEGIN/END pair.
00408 M00S00408.sympcod +++|
00409 M00S00409.sympcod +++|
00410 M00S00410.sympcod +++| 2.10 GOTOs and SWITCHes (Case Statement)
00411 M00S00411.sympcod +++|
00412 M00S00412.sympcod +++|
00413 M00S00413.sympcod +++| GOTO should be employed only if the resulting source code is
00414 M00S00414.sympcod +++| demonstrably superior in performance, clarity, maintainability,
00415 M00S00415.sympcod +++| or extendibility. In spite of structured programming, GOTOs may
00416 M00S00416.sympcod +++| make the code more efficient if employed properly. GOTOs may
00417 M00S00417.sympcod +++| make it difficult to follow logic. Jumps into FOR loops must not
00418 M00S00418.sympcod +++| be used. Jumps into code within a THEN or ELSE should not be
00419 M00S00419.sympcod +++| used. Jumps backwards in the code should not be used.
00420 M00S00420.sympcod +++|1
00421 M00S00421.sympcod +++| 2-6
00422 M00S00422.sympcod +++| NOS SYMPL CODING STANDARD
00423 M00S00423.sympcod +++| 06/01/83
00424 M00S00424.sympcod +++| -----------------------------------------------------------------
00425 M00S00425.sympcod +++| 2.0 Coding Standards
00426 M00S00426.sympcod +++| 2.10 GOTOs and SWITCHes (Case Statement)
00427 M00S00427.sympcod +++| -----------------------------------------------------------------
00428 M00S00428.sympcod +++|
00429 M00S00429.sympcod +++| A GOTO statement specifying a subscripted switch list may be
00430 M00S00430.sympcod +++| used to simulate a case statement. Each case should end with a
00431 M00S00431.sympcod +++| GOTO branching to a common exit, a RETURN statement, or an ABORT
00432 M00S00432.sympcod +++| call.
00433 M00S00433.sympcod +++|
00434 M00S00434.sympcod +++| Simulated case statements may use a multiplicity of labels
00435 M00S00435.sympcod +++| for exits, provided that the selection of exit points is done
00436 M00S00436.sympcod +++| to achieve consolidation of similar sequences of code, and that
00437 M00S00437.sympcod +++| all such labels are grouped together. See the Examples section
00438 M00S00438.sympcod +++| for an example of a simulated case statement.
00439 M00S00439.sympcod +++|
00440 M00S00440.sympcod +++|
00441 M00S00441.sympcod +++| 2.11 IF
00442 M00S00442.sympcod +++|
00443 M00S00443.sympcod +++|
00444 M00S00444.sympcod +++| The THEN and ELSE part of an IF statement must always use a
00445 M00S00445.sympcod +++| BEGIN/END pair. If embedded comments are needed to describe the
00446 M00S00446.sympcod +++| condition, they should be placed with either the THEN/ELSE or the
00447 M00S00447.sympcod +++| associated BEGIN/END pair rather than on the IF. A stand alone
00448 M00S00448.sympcod +++| comment following the THEN or ELSE may be used instead if
00449 M00S00449.sympcod +++| embedded comments would be too long or would restrict the
00450 M00S00450.sympcod +++| readability of the code.
00451 M00S00451.sympcod +++|
00452 M00S00452.sympcod +++| Related IF statements should not be nested more than 3 deep.
00453 M00S00453.sympcod +++| A simulated case statement may be used.
00454 M00S00454.sympcod +++|
00455 M00S00455.sympcod +++| Compound conditionals on an IF statement should be ordered
00456 M00S00456.sympcod +++| such that the first condition is the one which will most likely
00457 M00S00457.sympcod +++| terminate the condition evaluation.
00458 M00S00458.sympcod +++|
00459 M00S00459.sympcod +++|
00460 M00S00460.sympcod +++| 2.12 Bead
00461 M00S00461.sympcod +++|
00462 M00S00462.sympcod +++|
00463 M00S00463.sympcod +++| Avoid using bead functions unless necessary. Instead, the use
00464 M00S00464.sympcod +++| of an array with partial-word items is preferred. Bead functions
00465 M00S00465.sympcod +++| are difficult to update in a program if the data item that is
00466 M00S00466.sympcod +++| beaded is ever changed. If used, do not cross-type (bit
00467 M00S00467.sympcod +++| functions should be used only on numeric data, byte functions
00468 M00S00468.sympcod +++| only on characters).
00469 M00S00469.sympcod +++|
00470 M00S00470.sympcod +++| Bead functions may be used to simulate data definition
00471 M00S00471.sympcod +++| features not currently implemented with SYMPL such as repeating
00472 M00S00472.sympcod +++| groups within a word.
00473 M00S00473.sympcod +++|1
00474 M00S00474.sympcod +++| 2-7
00475 M00S00475.sympcod +++| NOS SYMPL CODING STANDARD
00476 M00S00476.sympcod +++| 06/01/83
00477 M00S00477.sympcod +++| -----------------------------------------------------------------
00478 M00S00478.sympcod +++| 2.0 Coding Standards
00479 M00S00479.sympcod +++| 2.13 PROCs, FUNCs, and PRGMs
00480 M00S00480.sympcod +++| -----------------------------------------------------------------
00481 M00S00481.sympcod +++|
00482 M00S00482.sympcod +++| 2.13 PROCs, FUNCs, and PRGMs
00483 M00S00483.sympcod +++|
00484 M00S00484.sympcod +++|
00485 M00S00485.sympcod +++| XDEFs, alternate entry points, and internal PROCs should not
00486 M00S00486.sympcod +++| be used. they are hard to locate in the program and will make
00487 M00S00487.sympcod +++| debugging and modification more difficult.
00488 M00S00488.sympcod +++|
00489 M00S00489.sympcod +++| PROCs and FUNCs must have a fixed (not variable) number of
00490 M00S00490.sympcod +++| parameters.
00491 M00S00491.sympcod +++|
00492 M00S00492.sympcod +++| The F option on the SYMPL command must not be used. Instead,
00493 M00S00493.sympcod +++| use CONTROL FTN in the source when needed.
00494 M00S00494.sympcod +++|
00495 M00S00495.sympcod +++|1
00496 M00S00496.sympcod +++| 3-1
00497 M00S00497.sympcod +++| NOS SYMPL CODING STANDARD
00498 M00S00498.sympcod +++| 06/01/83
00499 M00S00499.sympcod +++| -----------------------------------------------------------------
00500 M00S00500.sympcod +++| 3.0 Naming Conventions
00501 M00S00501.sympcod +++| -----------------------------------------------------------------
00502 M00S00502.sympcod +++|
00503 M00S00503.sympcod +++| 3.0 Naming Conventions
00504 M00S00504.sympcod +++|
00505 M00S00505.sympcod +++|
00506 M00S00506.sympcod +++|
00507 M00S00507.sympcod +++|
00508 M00S00508.sympcod +++|
00509 M00S00509.sympcod +++| All declarations and PROC/FUNC names should be descriptive.
00510 M00S00510.sympcod +++|
00511 M00S00511.sympcod +++| Routines may use simple local variables named TMP1, TMP2,
00512 M00S00512.sympcod +++| etc. However, such names can be used only for multi-purpose
00513 M00S00513.sympcod +++| items. Items with a specific computational purpose should have
00514 M00S00514.sympcod +++| a meaningful name.
00515 M00S00515.sympcod +++|
00516 M00S00516.sympcod +++| All external identifiers (PRGM, PROC, FUNC names) must be 7 or
00517 M00S00517.sympcod +++| less characters. The loader truncates a name to 7 characters.
00518 M00S00518.sympcod +++|
00519 M00S00519.sympcod +++| All internal identifiers (declarations, arrays, status list
00520 M00S00520.sympcod +++| names) must be 10 or less characters. A $ may be used as another
00521 M00S00521.sympcod +++| letter in the alphabet. However, $ is invalid in the deck name
00522 M00S00522.sympcod +++| because of MODIFY.
00523 M00S00523.sympcod +++|
00524 M00S00524.sympcod +++| All array items should be prefixed by the first 3 or 4
00525 M00S00525.sympcod +++| characters of the array name. The last 6 or 7 characters of the
00526 M00S00526.sympcod +++| array item are the descriptive name.
00527 M00S00527.sympcod +++|
00528 M00S00528.sympcod +++| All related DEFs should use the same prefix.
00529 M00S00529.sympcod +++|
00530 M00S00530.sympcod +++| All COMDECK names should be 7 characters in length and should
00531 M00S00531.sympcod +++| be in the following form
00532 M00S00532.sympcod +++|
00533 M00S00533.sympcod +++| COMxaaa
00534 M00S00534.sympcod +++|
00535 M00S00535.sympcod +++| where
00536 M00S00536.sympcod +++| aaa = Symbolic name of COMDECK
00537 M00S00537.sympcod +++| x = One of the COMDECK indicators:
00538 M00S00538.sympcod +++| A = COMDECKs used by more than one of the
00539 M00S00539.sympcod +++| E, U, or Z SYMPL groups
00540 M00S00540.sympcod +++| B = Data manager
00541 M00S00541.sympcod +++| C = CPU code
00542 M00S00542.sympcod +++| D = Display driver code
00543 M00S00543.sympcod +++| E = EXEC portion of MSS (SYMPL)
00544 M00S00544.sympcod +++| F = Full screen editor (FSE)
00545 M00S00545.sympcod +++| I = Initialization
00546 M00S00546.sympcod +++| K = Transaction subsystem
00547 M00S00547.sympcod +++| M = Mass storage error equivalents
00548 M00S00548.sympcod +++| P = PP code
00549 M00S00549.sympcod +++| S = Subsystem text symbols, constants
00550 M00S00550.sympcod +++| T = Tables
00551 M00S00551.sympcod +++| U = Utilities (SYMPL)
00552 M00S00552.sympcod +++| Z = Driver portion of MSS (SYMPL)
00553 M00S00553.sympcod +++|
00554 M00S00554.sympcod +++|1
00555 M00S00555.sympcod +++| 4-1
00556 M00S00556.sympcod +++| NOS SYMPL CODING STANDARD
00557 M00S00557.sympcod +++| 06/01/83
00558 M00S00558.sympcod +++| -----------------------------------------------------------------
00559 M00S00559.sympcod +++| 4.0 Code Readability
00560 M00S00560.sympcod +++| -----------------------------------------------------------------
00561 M00S00561.sympcod +++|
00562 M00S00562.sympcod +++|
00563 M00S00563.sympcod +++| 4.0 Code Readability
00564 M00S00564.sympcod +++|
00565 M00S00565.sympcod +++|
00566 M00S00566.sympcod +++|
00567 M00S00567.sympcod +++|
00568 M00S00568.sympcod +++|
00569 M00S00569.sympcod +++| 4.1 Format of Statements
00570 M00S00570.sympcod +++|
00571 M00S00571.sympcod +++|
00572 M00S00572.sympcod +++| All declarations must begin in column 7 and be finished before
00573 M00S00573.sympcod +++| column 72. Column 72 must be blank to separate SYMPL code and
00574 M00S00574.sympcod +++| comments from MODIFY sequence numbers. Each line of indentation
00575 M00S00575.sympcod +++| is two spaces.
00576 M00S00576.sympcod +++|
00577 M00S00577.sympcod +++| Each BEGIN/END is on a separate line. The first BEGIN is in
00578 M00S00578.sympcod +++| column 7. Subsequent BEGINs are each indented two spaces. Code
00579 M00S00579.sympcod +++| following the BEGIN, up to and including the next END, has the
00580 M00S00580.sympcod +++| same indentation as the BEGIN unless exempted by some other rule
00581 M00S00581.sympcod +++| (i.e. labels are in column 1). The END statement reduces the
00582 M00S00582.sympcod +++| following indentation by two spaces. Any BEGIN/END pair that
00583 M00S00583.sympcod +++| brackets more than ten statements should have matching embedded
00584 M00S00584.sympcod +++| comments on the BEGIN and END. Redundant BEGIN/END pairs should
00585 M00S00585.sympcod +++| not be used to highlight module structure. This function is
00586 M00S00586.sympcod +++| better accomplished with stand alone comments.
00587 M00S00587.sympcod +++|
00588 M00S00588.sympcod +++| Each THEN/ELSE/DO is on a separate line and is placed directly
00589 M00S00589.sympcod +++| beneath the IF or FOR portion of the statement.
00590 M00S00590.sympcod +++|
00591 M00S00591.sympcod +++| A statement which overflows the line must indent 2 spaces from
00592 M00S00592.sympcod +++| the original statement.
00593 M00S00593.sympcod +++|
00594 M00S00594.sympcod +++| Compound conditionals in an IF statement must be separated at
00595 M00S00595.sympcod +++| the OR/AND if the entire statement does not fit on a single
00596 M00S00596.sympcod +++| line. If the statement needs to be separated because of its
00597 M00S00597.sympcod +++| length or at the programmer-s option, then the AND/OR plus its
00598 M00S00598.sympcod +++| condition needs a separate line and is indented two spaces.
00599 M00S00599.sympcod +++|
00600 M00S00600.sympcod +++| Examples
00601 M00S00601.sympcod +++|
00602 M00S00602.sympcod +++| IF C IF B IF B OR C OR D
00603 M00S00603.sympcod +++| OR (A AND B) OR C THEN
00604 M00S00604.sympcod +++| THEN OR D BEGIN
00605 M00S00605.sympcod +++| BEGIN THEN .
00606 M00S00606.sympcod +++| . BEGIN .
00607 M00S00607.sympcod +++| . . .
00608 M00S00608.sympcod +++| . . .
00609 M00S00609.sympcod +++| END END END
00610 M00S00610.sympcod +++|
00611 M00S00611.sympcod +++| The format of the FOR statement follows the IF. If the entire
00612 M00S00612.sympcod +++| statement will not fit on a single line, then the statement must
00613 M00S00613.sympcod +++| be separated into two lines and indented two spaces.
00614 M00S00614.sympcod +++|
00615 M00S00615.sympcod +++|1
00616 M00S00616.sympcod +++| 4-2
00617 M00S00617.sympcod +++| NOS SYMPL CODING STANDARD
00618 M00S00618.sympcod +++| 06/01/83
00619 M00S00619.sympcod +++| -----------------------------------------------------------------
00620 M00S00620.sympcod +++| 4.0 Code Readability
00621 M00S00621.sympcod +++| 4.1 Format of Statements
00622 M00S00622.sympcod +++| -----------------------------------------------------------------
00623 M00S00623.sympcod +++|
00624 M00S00624.sympcod +++| FASTFOR I=1 STEP 1
00625 M00S00625.sympcod +++| UNTIL 7
00626 M00S00626.sympcod +++| DO
00627 M00S00627.sympcod +++| BEGIN
00628 M00S00628.sympcod +++| .
00629 M00S00629.sympcod +++| .
00630 M00S00630.sympcod +++| .
00631 M00S00631.sympcod +++| END
00632 M00S00632.sympcod +++|
00633 M00S00633.sympcod +++|
00634 M00S00634.sympcod +++| 4.2 Column 1
00635 M00S00635.sympcod +++|
00636 M00S00636.sympcod +++|
00637 M00S00637.sympcod +++| The following items must begin in column 1:
00638 M00S00638.sympcod +++| Labels
00639 M00S00639.sympcod +++| PRGM/PROC/FUNC statements
00640 M00S00640.sympcod +++| Single line comments
00641 M00S00641.sympcod +++| Stand alone comments
00642 M00S00642.sympcod +++|
00643 M00S00643.sympcod +++|
00644 M00S00644.sympcod +++| 4.3 Blank Lines
00645 M00S00645.sympcod +++|
00646 M00S00646.sympcod +++|
00647 M00S00647.sympcod +++| A blank line must be used in the following cases:
00648 M00S00648.sympcod +++|
00649 M00S00649.sympcod +++| As the first line in each common deck
00650 M00S00650.sympcod +++| Between all declaration groupings
00651 M00S00651.sympcod +++| Before and after every stand-alone comment
00652 M00S00652.sympcod +++| Before and after all groups of conditional code
00653 M00S00653.sympcod +++| (except COMDECK list control)
00654 M00S00654.sympcod +++| After every END statement
00655 M00S00655.sympcod +++| Before every label (or sequence of labels)
00656 M00S00656.sympcod +++|
00657 M00S00657.sympcod +++| Blank lines (in addition to those required) may be
00658 M00S00658.sympcod +++| used to improve the readability of the code.
00659 M00S00659.sympcod +++|
00660 M00S00660.sympcod +++| 4.4 Page Ejects
00661 M00S00661.sympcod +++|
00662 M00S00662.sympcod +++|
00663 M00S00663.sympcod +++| A page eject must be used as a separator between the
00664 M00S00664.sympcod +++| declaration groups and the body of code.
00665 M00S00665.sympcod +++|
00666 M00S00666.sympcod +++| If the declaration groups and the body of code will fit
00667 M00S00667.sympcod +++| on a single page, five blank lines may be used rather than
00668 M00S00668.sympcod +++| a page eject.
00669 M00S00669.sympcod +++|
00670 M00S00670.sympcod +++|1
00671 M00S00671.sympcod +++| 5-1
00672 M00S00672.sympcod +++| NOS SYMPL CODING STANDARD
00673 M00S00673.sympcod +++| 06/01/83
00674 M00S00674.sympcod +++| -----------------------------------------------------------------
00675 M00S00675.sympcod +++| 5.0 Documentation Standards
00676 M00S00676.sympcod +++| -----------------------------------------------------------------
00677 M00S00677.sympcod +++|
00678 M00S00678.sympcod +++|
00679 M00S00679.sympcod +++| 5.0 Documentation Standards
00680 M00S00680.sympcod +++|
00681 M00S00681.sympcod +++|
00682 M00S00682.sympcod +++|
00683 M00S00683.sympcod +++|
00684 M00S00684.sympcod +++|
00685 M00S00685.sympcod +++| All documentation must conform to the NOS operating system
00686 M00S00686.sympcod +++| requirements. This includes rules concerning complete sentences,
00687 M00S00687.sympcod +++| capitalization, punctuation, abreviations, etc. All stand-alone
00688 M00S00688.sympcod +++| comments are complete English sentences with correct punctuation,
00689 M00S00689.sympcod +++| ending with a period.
00690 M00S00690.sympcod +++|
00691 M00S00691.sympcod +++|
00692 M00S00692.sympcod +++| 5.1 Comment Formats and Types
00693 M00S00693.sympcod +++|
00694 M00S00694.sympcod +++|
00695 M00S00695.sympcod +++| Comments can appear in three different formats: stand alone,
00696 M00S00696.sympcod +++| single line and embedded. Stand alone comments have four types
00697 M00S00697.sympcod +++| determined by the number of asterisks on the initial line of a
00698 M00S00698.sympcod +++| sequence of lines with asterisks in column 1. These four types
00699 M00S00699.sympcod +++| are recognized by the DOCMENT utility and cause some comments (or
00700 M00S00700.sympcod +++| code) to be included in DOCMENT output depending on DOCMENT run
00701 M00S00701.sympcod +++| time parameters.
00702 M00S00702.sympcod +++|
00703 M00S00703.sympcod +++|
00704 M00S00704.sympcod +++| 5.1.1 Embedded Comments
00705 M00S00705.sympcod +++|
00706 M00S00706.sympcod +++|
00707 M00S00707.sympcod +++| Embedded comments appear on the same line following a
00708 M00S00708.sympcod +++| declaration or executable statement. The left delimiter must be
00709 M00S00709.sympcod +++| preceded by at least two spaces and followed by only one space.
00710 M00S00710.sympcod +++| At least one space follows the comment text before the right
00711 M00S00711.sympcod +++| delimiter. At least one space must follow the right delimiter.
00712 M00S00712.sympcod +++| Column positioning rules for the left delimiter are given in the
00713 M00S00713.sympcod +++| section "Documentation with Embedded Comments".
00714 M00S00714.sympcod +++|
00715 M00S00715.sympcod +++|
00716 M00S00716.sympcod +++| 5.1.2 Single Line Comments
00717 M00S00717.sympcod +++|
00718 M00S00718.sympcod +++|
00719 M00S00719.sympcod +++| These comments have a left comment delimiter in column 1, the
00720 M00S00720.sympcod +++| text starting in column 3 for title lines or in column 7 for
00721 M00S00721.sympcod +++| common deck headers, and a right comment delimiter proceeded by
00722 M00S00722.sympcod +++| at least one space all on a single line. This comment form is
00723 M00S00723.sympcod +++| used in the following cases:
00724 M00S00724.sympcod +++| -- Title lines
00725 M00S00725.sympcod +++| -- Common deck headers
00726 M00S00726.sympcod +++|
00727 M00S00727.sympcod +++|1
00728 M00S00728.sympcod +++| 5-2
00729 M00S00729.sympcod +++| NOS SYMPL CODING STANDARD
00730 M00S00730.sympcod +++| 06/01/83
00731 M00S00731.sympcod +++| -----------------------------------------------------------------
00732 M00S00732.sympcod +++| 5.0 Documentation Standards
00733 M00S00733.sympcod +++| 5.1.3 Stand Alone Comments
00734 M00S00734.sympcod +++| -----------------------------------------------------------------
00735 M00S00735.sympcod +++|
00736 M00S00736.sympcod +++| 5.1.3 Stand Alone Comments
00737 M00S00737.sympcod +++|
00738 M00S00738.sympcod +++|
00739 M00S00739.sympcod +++| These comments consist of at least 5 lines with the first and
00740 M00S00740.sympcod +++| last being blank lines, the second and next to last having (only)
00741 M00S00741.sympcod +++| a comment delimiter in column 1 with the comment body starting
00742 M00S00742.sympcod +++| with line 3. Each line of the comment body has an asterisk in
00743 M00S00743.sympcod +++| column 1 with blanks normally found in columns 2-6.
00744 M00S00744.sympcod +++|
00745 M00S00745.sympcod +++| The initial line of the comment body (line 3) may have 1, 2, 3
00746 M00S00746.sympcod +++| or 4 asterisks starting in column 1 depending on the type of
00747 M00S00747.sympcod +++| output desired from the DOCMENT utility.
00748 M00S00748.sympcod +++|
00749 M00S00749.sympcod +++| 5.1.3.1 Brackets (****)
00750 M00S00750.sympcod +++|
00751 M00S00751.sympcod +++|
00752 M00S00752.sympcod +++| A pair of stand alone comments of this form causes DOCMENT to
00753 M00S00753.sympcod +++| copy the comment body starting with the opening bracket, and all
00754 M00S00754.sympcod +++| subsequent code until the closing bracket. This is required for
00755 M00S00755.sympcod +++| XREF declarations. An example is indicated with the XREF
00756 M00S00756.sympcod +++| description. It may also be employed for other declarations or
00757 M00S00757.sympcod +++| code which should be included on a DOCMENT run.
00758 M00S00758.sympcod +++|
00759 M00S00759.sympcod +++| The comment body consists of asterisks in columns 1-4 with
00760 M00S00760.sympcod +++| text on the rest of the first line. The comment text should
00761 M00S00761.sympcod +++| clearly indicate which is the opening bracket and which is the
00762 M00S00762.sympcod +++| closing bracket.
00763 M00S00763.sympcod +++|
00764 M00S00764.sympcod +++| 5.1.3.2 External Comments (***)
00765 M00S00765.sympcod +++|
00766 M00S00766.sympcod +++|
00767 M00S00767.sympcod +++| A comment body which is to be included in any DOCMENT run
00768 M00S00768.sympcod +++| (external or internal) has 3 asterisks in columns 1-3 of the
00769 M00S00769.sympcod +++| first line of the comment body. The 3 asterisk form is generally
00770 M00S00770.sympcod +++| used to explain the interface to a SYMPL PRGM. It is also used
00771 M00S00771.sympcod +++| in the header documentation for common decks.
00772 M00S00772.sympcod +++|
00773 M00S00773.sympcod +++| 5.1.3.3 Internal Comments (**)
00774 M00S00774.sympcod +++|
00775 M00S00775.sympcod +++|
00776 M00S00776.sympcod +++| A comment body which is to be included in a DOCMENT run
00777 M00S00777.sympcod +++| selecting internal documentation in addition to external
00778 M00S00778.sympcod +++| documentation has asterisks in columns 1 and 2 of the first line
00779 M00S00779.sympcod +++| of the comment body. This is generally used to describe the
00780 M00S00780.sympcod +++| interface for each PROC/FUNC. It may also be used to describe
00781 M00S00781.sympcod +++| other important information about a PROC/FUNC/PRGM.
00782 M00S00782.sympcod +++|
00783 M00S00783.sympcod +++|1
00784 M00S00784.sympcod +++| 5-3
00785 M00S00785.sympcod +++| NOS SYMPL CODING STANDARD
00786 M00S00786.sympcod +++| 06/01/83
00787 M00S00787.sympcod +++| -----------------------------------------------------------------
00788 M00S00788.sympcod +++| 5.0 Documentation Standards
00789 M00S00789.sympcod +++| 5.1.3.4 Module Comments (*)
00790 M00S00790.sympcod +++| -----------------------------------------------------------------
00791 M00S00791.sympcod +++|
00792 M00S00792.sympcod +++| 5.1.3.4 Module Comments (*)
00793 M00S00793.sympcod +++|
00794 M00S00794.sympcod +++|
00795 M00S00795.sympcod +++| A comment body which is not to be included in a DOCMENT run
00796 M00S00796.sympcod +++| simply has 1 asterisk on the first line of the comment body.
00797 M00S00797.sympcod +++| This type of stand alone comment is generally used to document
00798 M00S00798.sympcod +++| design information which helps one maintain or code review a
00799 M00S00799.sympcod +++| module.
00800 M00S00800.sympcod +++|
00801 M00S00801.sympcod +++| This type of comment can present design information for the
00802 M00S00802.sympcod +++| entire PROC/FUNC, or for a sequence of code. It should answer
00803 M00S00803.sympcod +++| the question: "how does this PROC/FUNC code segment work?"
00804 M00S00804.sympcod +++|
00805 M00S00805.sympcod +++|
00806 M00S00806.sympcod +++| 5.2 Program Level Documentation
00807 M00S00807.sympcod +++|
00808 M00S00808.sympcod +++|
00809 M00S00809.sympcod +++| Every PRGM must have an overview describing what it does and
00810 M00S00810.sympcod +++| external documentation describing how it is used. The overview
00811 M00S00811.sympcod +++| documentation is very general. A description of the fields is in
00812 M00S00812.sympcod +++| the NOS coding standards.
00813 M00S00813.sympcod +++|
00814 M00S00814.sympcod +++| #
00815 M00S00815.sympcod +++| *** (heading)
00816 M00S00816.sympcod +++| *
00817 M00S00817.sympcod +++| * (purpose)
00818 M00S00818.sympcod +++| *
00819 M00S00819.sympcod +++| * (command format)
00820 M00S00820.sympcod +++| *
00821 M00S00821.sympcod +++| * PRGM program name.
00822 M00S00822.sympcod +++| *
00823 M00S00823.sympcod +++| * ENTRY. .....
00824 M00S00824.sympcod +++| *
00825 M00S00825.sympcod +++| * EXIT. .....
00826 M00S00826.sympcod +++| *
00827 M00S00827.sympcod +++| * MESSAGES. .....
00828 M00S00828.sympcod +++| *
00829 M00S00829.sympcod +++| * NOTES. .....
00830 M00S00830.sympcod +++| *
Line S00831 Modification History |
M01 (Removed by) | 281l803 |
Seq # *Modification Id* Act
----------------------------+
00831 M01S00831.281l803 ---| * COPYRIGHT CONTROL DATA CORPORATION, 1983.
Line S00001 Modification History |
M01 (Added by) | 281l803 |
Seq # *Modification Id* Act
----------------------------+
00832 M01S00001.281l803 +++| * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
00833 M00S00832.sympcod +++| #
00834 M00S00833.sympcod +++|
00835 M00S00834.sympcod +++| In addition, a PRGM may have internal and module comments as
00836 M00S00835.sympcod +++| appropriate.
00837 M00S00836.sympcod +++|
00838 M00S00837.sympcod +++|1
00839 M00S00838.sympcod +++| 5-4
00840 M00S00839.sympcod +++| NOS SYMPL CODING STANDARD
00841 M00S00840.sympcod +++| 06/01/83
00842 M00S00841.sympcod +++| -----------------------------------------------------------------
00843 M00S00842.sympcod +++| 5.0 Documentation Standards
00844 M00S00843.sympcod +++| 5.3 Documentation of PROCs and FUNCs
00845 M00S00844.sympcod +++| -----------------------------------------------------------------
00846 M00S00845.sympcod +++|
00847 M00S00846.sympcod +++| 5.3 Documentation of PROCs and FUNCs
00848 M00S00847.sympcod +++|
00849 M00S00848.sympcod +++|
00850 M00S00849.sympcod +++| Every PROC/FUNC needs an internal documentation section. It
00851 M00S00850.sympcod +++| should answer the question: "how is this PROC/FUNC used?". The
00852 M00S00851.sympcod +++| description of the different fields is in the NOS Coding
00853 M00S00852.sympcod +++| Standards.
00854 M00S00853.sympcod +++|
00855 M00S00854.sympcod +++| #
00856 M00S00855.sympcod +++| ** (heading)
00857 M00S00856.sympcod +++| *
00858 M00S00857.sympcod +++| * (purpose)
00859 M00S00858.sympcod +++| *
00860 M00S00859.sympcod +++| * (PROC or FUNC statement with semicolon omitted)
00861 M00S00860.sympcod +++| *
00862 M00S00861.sympcod +++| * ENTRY .....
00863 M00S00862.sympcod +++| *
00864 M00S00863.sympcod +++| * EXIT .....
00865 M00S00864.sympcod +++| *
00866 M00S00865.sympcod +++| * MESSAGES .....
00867 M00S00866.sympcod +++| *
00868 M00S00867.sympcod +++| * NOTES .....
00869 M00S00868.sympcod +++| *
00870 M00S00869.sympcod +++| #
00871 M00S00870.sympcod +++|
00872 M00S00871.sympcod +++| If a PROC or FUNC references a based array whose pointer is in
00873 M00S00872.sympcod +++| a common block, and the PROC or FUNC assumes that the pointer for
00874 M00S00873.sympcod +++| that array is set before the PROC or FUNC is called, the entry
00875 M00S00874.sympcod +++| condition comments should state that assumption.
00876 M00S00875.sympcod +++|
00877 M00S00876.sympcod +++| In addition, a PROC/FUNC may have additional internal comments
00878 M00S00877.sympcod +++| and module comments as appropriate.
00879 M00S00878.sympcod +++|
00880 M00S00879.sympcod +++| Where a higher level of documentation is needed for a related
00881 M00S00880.sympcod +++| group of PROCs an extra PROC should be added to contain the
00882 M00S00881.sympcod +++| unifying documentation.
00883 M00S00882.sympcod +++|
00884 M00S00883.sympcod +++|
00885 M00S00884.sympcod +++| 5.4 Documentation with Embedded Comments
00886 M00S00885.sympcod +++|
00887 M00S00886.sympcod +++|
00888 M00S00887.sympcod +++| Embedded comments are of two documentation forms (i.e. data
00889 M00S00888.sympcod +++| declaraction or action code). This is the only type of a comment
00890 M00S00889.sympcod +++| that need not be a complete sentence. This type of comment
00891 M00S00890.sympcod +++| should not be continued onto another line. If absolutely
00892 M00S00891.sympcod +++| necessary, the comment may be continued on the following line.
00893 M00S00892.sympcod +++| In this case the second line must not contain code.
00894 M00S00893.sympcod +++|
00895 M00S00894.sympcod +++| THEN # comment which is too long
00896 M00S00895.sympcod +++| continuation of commment #
00897 M00S00896.sympcod +++|1
00898 M00S00897.sympcod +++| 5-5
00899 M00S00898.sympcod +++| NOS SYMPL CODING STANDARD
00900 M00S00899.sympcod +++| 06/01/83
00901 M00S00900.sympcod +++| -----------------------------------------------------------------
00902 M00S00901.sympcod +++| 5.0 Documentation Standards
00903 M00S00902.sympcod +++| 5.4.1 Data Declaration Embedded Comments
00904 M00S00903.sympcod +++| -----------------------------------------------------------------
00905 M00S00904.sympcod +++|
00906 M00S00905.sympcod +++| 5.4.1 Data Declaration Embedded Comments
00907 M00S00906.sympcod +++|
00908 M00S00907.sympcod +++|
00909 M00S00908.sympcod +++| Every array, item, status item, DEF and XREF item must be
00910 M00S00909.sympcod +++| documented with appropriate information. Each declaration should
00911 M00S00910.sympcod +++| appear on a separate line accompanied by embedded comments
00912 M00S00911.sympcod +++| describing its function (optionally, if this is an important
00913 M00S00912.sympcod +++| array, it may be bracketed by comment lines with asterisks in
00914 M00S00913.sympcod +++| columns 1 through 4 so that DOCMENT will process it.
00915 M00S00914.sympcod +++|
00916 M00S00915.sympcod +++| Presets should be commented individually to reflect the
00917 M00S00916.sympcod +++| function of the preset.
00918 M00S00917.sympcod +++|
00919 M00S00918.sympcod +++| The left delimiter of the embedded comment should be in column
00920 M00S00919.sympcod +++| 38 unless the statement extends beyond column 35, in which case
00921 M00S00920.sympcod +++| the delimiter is placed at least two spaces to the right of the
00922 M00S00921.sympcod +++| statement.
00923 M00S00922.sympcod +++|
00924 M00S00923.sympcod +++|
00925 M00S00924.sympcod +++| 5.4.2 Action Code Embedded Comments
00926 M00S00925.sympcod +++|
00927 M00S00926.sympcod +++|
00928 M00S00927.sympcod +++| For BEGIN and END statements, the embedded comments are placed
00929 M00S00928.sympcod +++| two spaces to the right of the statement. For other statements
00930 M00S00929.sympcod +++| the embedded comments begin in column 38 unless the statement
00931 M00S00930.sympcod +++| extends beyond column 35 in which case the delimiter is placed at
00932 M00S00931.sympcod +++| least two spaces to the right of the statement.
00933 M00S00932.sympcod +++|
00934 M00S00933.sympcod +++|
00935 M00S00934.sympcod +++| 5.5 General Documentation for PROCs, PRGMs or FUNCs
00936 M00S00935.sympcod +++|
00937 M00S00936.sympcod +++|
00938 M00S00937.sympcod +++| Each PRGM, PROC, FUNC statement must have a corresponding END
00939 M00S00938.sympcod +++| statement followed by the PRGM, PROC, FUNC name as a comment on
00940 M00S00939.sympcod +++| that same line. SYMPL comments containing COMPASS-like title
00941 M00S00940.sympcod +++| pseudo-ops must appear as the second line in a SYMPL PRGM, PROC
00942 M00S00941.sympcod +++| or FUNC.
00943 M00S00942.sympcod +++|
00944 M00S00943.sympcod +++| PRGM OK;
00945 M00S00944.sympcod +++| # TITLE OK - description of PRGM OK. #
00946 M00S00945.sympcod +++|
00947 M00S00946.sympcod +++| BEGIN # OK #
00948 M00S00947.sympcod +++| .
00949 M00S00948.sympcod +++| .
00950 M00S00949.sympcod +++| .
00951 M00S00950.sympcod +++| END # OK #
00952 M00S00951.sympcod +++|
00953 M00S00952.sympcod +++|1
00954 M00S00953.sympcod +++| 6-1
00955 M00S00954.sympcod +++| NOS SYMPL CODING STANDARD
00956 M00S00955.sympcod +++| 06/01/83
00957 M00S00956.sympcod +++| -----------------------------------------------------------------
00958 M00S00957.sympcod +++| 6.0 Examples
00959 M00S00958.sympcod +++| -----------------------------------------------------------------
00960 M00S00959.sympcod +++|
00961 M00S00960.sympcod +++| 6.0 Examples
00962 M00S00961.sympcod +++|
00963 M00S00962.sympcod +++|
00964 M00S00963.sympcod +++|
00965 M00S00964.sympcod +++|
00966 M00S00965.sympcod +++|
00967 M00S00966.sympcod +++| 6.1 COMDECK Examples
00968 M00S00967.sympcod +++|
00969 M00S00968.sympcod +++| 1 7 38 48 71
00970 M00S00969.sympcod +++| +-----+------------------------------+---------+----------------------+
00971 M00S00970.sympcod +++| COMASPC
00972 M00S00971.sympcod +++| COMMON
00973 M00S00972.sympcod +++|
00974 M00S00973.sympcod +++| # COMASPC - STEP POINT CONTROL. #
00975 M00S00974.sympcod +++| CONTROL NOLIST;
00976 M00S00975.sympcod +++| CONTROL IFEQ LISTCON,1;
00977 M00S00976.sympcod +++| CONTROL LIST;
00978 M00S00977.sympcod +++| CONTROL FI;
00979 M00S00978.sympcod +++| BEGIN # COMASPC #
00980 M00S00979.sympcod +++|
00981 M00S00980.sympcod +++| #
00982 M00S00981.sympcod +++| *** COMASPC - STEP POINT CONTROL.
00983 M00S00982.sympcod +++| *
00984 M00S00983.sympcod +++| * *COMASPC* CONTAINS DECLARATIONS USED FOR CONTROL OF STEP MODE.
00985 M00S00984.sympcod +++| #
00986 M00S00985.sympcod +++|
00987 M00S00986.sympcod +++|
00988 M00S00987.sympcod +++| DEF STEPCNT #4#; # NUMBER OF STEP POINTS - 1 #
00989 M00S00988.sympcod +++| DEF STEPPNT (I) #B<(I),1>STEPMASK#; # STEP POINT #
00990 M00S00989.sympcod +++|
00991 M00S00990.sympcod +++| STATUS STEPVAL # STEP POINT VALUES #
00992 M00S00991.sympcod +++| S1, # STAGING STEP POINT 1 #
00993 M00S00992.sympcod +++| S2, # STAGING STEP POINT 2 #
00994 M00S00993.sympcod +++| S3, # STAGING STEP POINT 3 #
00995 M00S00994.sympcod +++| D1, # DESTAGING STEP POINT 1 #
00996 M00S00995.sympcod +++| D2; # DESTAGING STEP POINT 2 #
00997 M00S00996.sympcod +++|
00998 M00S00997.sympcod +++| COMMOM ASPCCOM;
00999 M00S00998.sympcod +++|
01000 M00S00999.sympcod +++| BEGIN # ASPCCOM #
01001 M00S01000.sympcod +++|
01002 M00S01001.sympcod +++| ITEM HPMASK U; # HALTED PROCESS MASK #
01003 M00S01002.sympcod +++| ITEM STEPMASK U; # STEP POINT MASK #
01004 M00S01003.sympcod +++|
01005 M00S01004.sympcod +++| ARRAY HPT [0:STEPCNT] P(1); # HALTED PROCESS TABLE #
01006 M00S01005.sympcod +++| BEGIN
01007 M00S01006.sympcod +++| ITEM HPT$LINK U(00,42,18); # HALTED PROCESS CHAIN LINK #
01008 M00S01007.sympcod +++| END
01009 M00S01008.sympcod +++|
01010 M00S01009.sympcod +++| END # ASPCCOM #
01011 M00S01010.sympcod +++|
01012 M00S01011.sympcod +++| END # COMASPC #
01013 M00S01012.sympcod +++|
01014 M00S01013.sympcod +++| CONTROL LIST;
01015 M00S01014.sympcod +++|
01016 M00S01015.sympcod +++|1
01017 M00S01016.sympcod +++| 6-2
01018 M00S01017.sympcod +++| NOS SYMPL CODING STANDARD
01019 M00S01018.sympcod +++| 06/01/83
01020 M00S01019.sympcod +++| -----------------------------------------------------------------
01021 M00S01020.sympcod +++| 6.0 Examples
01022 M00S01021.sympcod +++| 6.2 PROC Example
01023 M00S01022.sympcod +++| -----------------------------------------------------------------
01024 M00S01023.sympcod +++|
01025 M00S01024.sympcod +++| 6.2 PROC Example
01026 M00S01025.sympcod +++|
01027 M00S01026.sympcod +++|
01028 M00S01027.sympcod +++| 1 7 38 48 71
01029 M00S01028.sympcod +++| +-----+------------------------------+---------+----------------------+
01030 M00S01029.sympcod +++| PROC PSFIN((NDVALUE),(SPVALUE));
01031 M00S01030.sympcod +++| # TITLE PSFIN - INITIALIZES THE CONFIGURARTION. #
01032 M00S01031.sympcod +++|
01033 M00S01032.sympcod +++| BEGIN # PSFIN #
01034 M00S01033.sympcod +++|
01035 M00S01034.sympcod +++| #
01036 M00S01035.sympcod +++| ** PSFIN - INITIALIZES THE CONFIGURATION.
01037 M00S01036.sympcod +++| *
01038 M00S01037.sympcod +++| * *PSFIN* INITIALIZES THE CONFIGURATION OF A FAMILY OF
01039 M00S01038.sympcod +++| * DEVICES.
01040 M00S01039.sympcod +++| *
01041 M00S01040.sympcod +++| * PROC PSFIN((NDVALUE),(SPVALUE))
01042 M00S01041.sympcod +++| *
01043 M00S01042.sympcod +++| * ENTRY (NDVALUE) = NUMBER OF DEVICES IN A FAMILY.
01044 M00S01043.sympcod +++| * (SPVALUE) = SPACE ASSIGNED TO EACH DEVICE.
01045 M00S01044.sympcod +++| * ARRAY HEADER = PSEUDO PFC.
01046 M00S01045.sympcod +++| *
01047 M00S01046.sympcod +++| * EXIT CONFIGURATION IS INITIALIZED.
01048 M00S01047.sympcod +++| *
01049 M00S01048.sympcod +++| * NOTES THE SPECIFIED VALUES ARE PLACED IN THE HEADER.
01050 M00S01049.sympcod +++| #
01051 M00S01050.sympcod +++|
01052 M00S01051.sympcod +++| ITEM NDVALUE U; # NUMBER OF DEVICES #
01053 M00S01052.sympcod +++| ITEM SPVALUE U; # SPACE AVAILABLE PER DEVICE #
01054 M00S01053.sympcod +++|
01055 M00S01054.sympcod +++| #
01056 M00S01055.sympcod +++| **** PROC PSFIN - XREF LIST BEGIN.
01057 M00S01056.sympcod +++| #
01058 M00S01057.sympcod +++|
01059 M00S01058.sympcod +++| XREF
01060 M00S01059.sympcod +++| BEGIN
01061 M00S01060.sympcod +++| PROC PSLOCK; # INTERLOCKS THE PSEUDO PFC #
01062 M00S01061.sympcod +++| PROC PSUNLCK; # RETURNS THE PSEUDO PFC #
01063 M00S01062.sympcod +++| END
01064 M00S01063.sympcod +++|
01065 M00S01064.sympcod +++| #
01066 M00S01065.sympcod +++| **** PROC PSFIN - XREF LIST END.
01067 M00S01066.sympcod +++| #
01068 M00S01067.sympcod +++|
01069 M00S01068.sympcod +++|1
01070 M00S01069.sympcod +++| 6-3
01071 M00S01070.sympcod +++| NOS SYMPL CODING STANDARD
01072 M00S01071.sympcod +++| 06/01/83
01073 M00S01072.sympcod +++| -----------------------------------------------------------------
01074 M00S01073.sympcod +++| 6.0 Examples
01075 M00S01074.sympcod +++| 6.2 PROC Example
01076 M00S01075.sympcod +++| -----------------------------------------------------------------
01077 M00S01076.sympcod +++|
01078 M00S01077.sympcod +++| DEF OFFSET #4#; # DEVICE ENTRY OFFSET IN PFC #
01079 M00S01078.sympcod +++|
01080 M00S01079.sympcod +++| DEF LISTCON #0#; # DO NOT LIST COMDECKS #
01081 M00S01080.sympcod +++| *CALL COMAMSS
01082 M00S01081.sympcod +++| *CALL COMZHED
01083 M00S01082.sympcod +++|
01084 M00S01083.sympcod +++| ITEM I I; # LOOP VARIABLE #
01085 M00S01084.sympcod +++| ITEM NUM U; # CALCULATED NUMBER #
01086 M00S01085.sympcod +++| CONTROL EJECT;
01087 M00S01086.sympcod +++|
01088 M00S01087.sympcod +++| PSLOCK(HEADER);
01089 M00S01088.sympcod +++|
01090 M00S01089.sympcod +++| #
01091 M00S01090.sympcod +++| * SET VALUES IN THE HEADER.
01092 M00S01091.sympcod +++| #
01093 M00S01092.sympcod +++|
01094 M00S01093.sympcod +++| HEAD$ND[0] = NDVALUE;
01095 M00S01094.sympcod +++| HEAD$SPDEV[0] = SPVALUE;
01096 M00S01095.sympcod +++| NUM = NDVALUE * SPVALUE;
01097 M00S01096.sympcod +++| HEAD$SPFAM[0] = NUM;
01098 M00S01097.sympcod +++| HEAD$SPAVF[0] = NUM;
01099 M00S01098.sympcod +++| SLOWFOR I = 1 STEP 1 UNTIL NDVALUE
01100 M00S01099.sympcod +++| DO # SET SPACE AVAILALBE #
01101 M00S01100.sympcod +++| BEGIN
01102 M00S01101.sympcod +++| HEAD$XX[I + OFFSET] = SPVALUE;
01103 M00S01102.sympcod +++| END
01104 M00S01103.sympcod +++|
01105 M00S01104.sympcod +++| PSUNLCK(HEADER);
01106 M00S01105.sympcod +++| RETURN;
01107 M00S01106.sympcod +++| END # PSFIN #
01108 M00S01107.sympcod +++|
01109 M00S01108.sympcod +++| TERM
01110 M00S01109.sympcod +++|
01111 M00S01110.sympcod +++|1
01112 M00S01111.sympcod +++| 6-4
01113 M00S01112.sympcod +++| NOS SYMPL CODING STANDARD
01114 M00S01113.sympcod +++| 06/01/83
01115 M00S01114.sympcod +++| -----------------------------------------------------------------
01116 M00S01115.sympcod +++| 6.0 Examples
01117 M00S01116.sympcod +++| 6.3 Status List/Status Switch Example
01118 M00S01117.sympcod +++| -----------------------------------------------------------------
01119 M00S01118.sympcod +++|
01120 M00S01119.sympcod +++| 6.3 Status List/Status Switch Example
01121 M00S01120.sympcod +++|
01122 M00S01121.sympcod +++|
01123 M00S01122.sympcod +++| STATUS ERSTAT # ERROR STATUS #
01124 M00S01123.sympcod +++| ERRORNO, # NO ERROR #
01125 M00S01124.sympcod +++| ERRORFE, # FILE ALREADY EXISTS #
01126 M00S01125.sympcod +++| ERRORFN, # FILE NOT FOUND #
01127 M00S01126.sympcod +++| ERRORNW, # UNABLE TO WRITE PFC #
01128 M00S01127.sympcod +++| ; # END OF *ERSTAT* #
01129 M00S01128.sympcod +++|
01130 M00S01129.sympcod +++| ITEM FLAG S:ERSTAT; # ERROR CONDITION #
01131 M00S01130.sympcod +++|
01132 M00S01131.sympcod +++| SWITCH ERRCASE:ERSTAT # ERROR LIST #
01133 M00S01132.sympcod +++| OK:ERRORNO, # NO ERROR #
01134 M00S01133.sympcod +++| PFEXISTS:ERRORFE, # FILE ALREADY EXISTS #
01135 M00S01134.sympcod +++| NOENTRY:ERRORFN, # FILE ONT FOUND #
01136 M00S01135.sympcod +++| WRITERR:ERRORNW; # UNABLE TO WRITE PFC #
01137 M00S01136.sympcod +++|
01138 M00S01137.sympcod +++| A status list may also be defined with an upper limit entry
01139 M00S01138.sympcod +++| put at the end of the list. This upper limit can be used in
01140 M00S01139.sympcod +++| the code to test that a variable is within its defined range.
01141 M00S01140.sympcod +++| In this style the upper limit entry is terminated with a
01142 M00S01141.sympcod +++| a semi-colon on the same line.
01143 M00S01142.sympcod +++|
01144 M00S01143.sympcod +++| Example:
01145 M00S01144.sympcod +++|
01146 M00S01145.sympcod +++| STATUS ERSTAT # ERROR STATUS #
01147 M00S01146.sympcod +++| ERRORNO, # NO ERROR #
01148 M00S01147.sympcod +++| ERRORFE, # FILE ALREADY EXISTS #
01149 M00S01148.sympcod +++| ERRORFN, # FILE NOT FOUND #
01150 M00S01149.sympcod +++| ERRORNW, # UNABLE TO WRITE PFC #
01151 M00S01150.sympcod +++| ERROREND; # END OF *ERSTAT* #
01152 M00S01151.sympcod +++|
01153 M00S01152.sympcod +++|1
01154 M00S01153.sympcod +++| 6-5
01155 M00S01154.sympcod +++| NOS SYMPL CODING STANDARD
01156 M00S01155.sympcod +++| 06/01/83
01157 M00S01156.sympcod +++| -----------------------------------------------------------------
01158 M00S01157.sympcod +++| 6.0 Examples
01159 M00S01158.sympcod +++| 6.3 Status List/Status Switch Example
01160 M00S01159.sympcod +++| -----------------------------------------------------------------
01161 M00S01160.sympcod +++|
01162 M00S01161.sympcod +++| #
01163 M00S01162.sympcod +++| * PROCESS THE ERROR RESPONSE.
01164 M00S01163.sympcod +++| #
01165 M00S01164.sympcod +++|
01166 M00S01165.sympcod +++| GOTO ERRCASE[FLAG];
01167 M00S01166.sympcod +++|
01168 M00S01167.sympcod +++| #
01169 M00S01168.sympcod +++| * stand alone comment here or an embedded comment on the label.
01170 M00S01169.sympcod +++| #
01171 M00S01170.sympcod +++|
01172 M00S01171.sympcod +++| PFEXISTS: # embedded comment #
01173 M00S01172.sympcod +++| -------
01174 M00S01173.sympcod +++| -------
01175 M00S01174.sympcod +++| GOTO ENDCASE;
01176 M00S01175.sympcod +++|
01177 M00S01176.sympcod +++| NOENTRY: # embedded comment #
01178 M00S01177.sympcod +++| -------
01179 M00S01178.sympcod +++| -------
01180 M00S01179.sympcod +++| GOTO ENDCASE;
01181 M00S01180.sympcod +++|
01182 M00S01181.sympcod +++| WRITERR: # embedded comment #
01183 M00S01182.sympcod +++| -------
01184 M00S01183.sympcod +++| -------
01185 M00S01184.sympcod +++| GOTO ENDCASE;
01186 M00S01185.sympcod +++|
01187 M00S01186.sympcod +++| OK: # embedded comment #
01188 M00S01187.sympcod +++| ----------
01189 M00S01188.sympcod +++| GOTO ENDCASE;
01190 M00S01189.sympcod +++|
01191 M00S01190.sympcod +++| ENDCASE:
01192 M00S01191.sympcod +++| -------
01193 M00S01192.sympcod +++|
01194 M00S01193.sympcod +++| #
01195 M00S01194.sympcod +++| * PROCESS THE ERROR RESPONSE.
01196 M00S01195.sympcod +++| #
01197 M00S01196.sympcod +++|
01198 M00S01197.sympcod +++|1
01199 M00S01198.sympcod +++| A1-1
01200 M00S01199.sympcod +++| NOS SYMPL CODING STANDARD
01201 M00S01200.sympcod +++| 06/01/83
01202 M00S01201.sympcod +++| -----------------------------------------------------------------
01203 M00S01202.sympcod +++| A1.0 Addendum for SMF Project
01204 M00S01203.sympcod +++| -----------------------------------------------------------------
01205 M00S01204.sympcod +++|
01206 M00S01205.sympcod +++| This addendum describes changes to the NOS SYMPL coding
01207 M00S01206.sympcod +++| standard for the Screen Management Facility (SMF) project.
01208 M00S01207.sympcod +++| Certain parts of this change in the standard shall be relevent
01209 M00S01208.sympcod +++| only to the Full Screen Editor and not to the screen formatter.
01210 M00S01209.sympcod +++|
01211 M00S01210.sympcod +++| 1. Structural changes
01212 M00S01211.sympcod +++|
01213 M00S01212.sympcod +++| a. Nested procedures/functions are allowable under the
01214 M00S01213.sympcod +++| following conditions. The terminology used here shall be
01215 M00S01214.sympcod +++| "compilation unit" for an outermost PRGM/PROC/FUNC, since
01216 M00S01215.sympcod +++| that is the scope of the map and cross-reference in the
01217 M00S01216.sympcod +++| listing.
01218 M00S01217.sympcod +++|
01219 M00S01218.sympcod +++| Procedures and functions may be nested. A compilation unit
01220 M00S01219.sympcod +++| may contain XDEF-ed internal routines provided that a
01221 M00S01220.sympcod +++| PROC/FUNC compilation unit is never called via the main entry
01222 M00S01221.sympcod +++| point. Any routine may contain internal routines which are
01223 M00S01222.sympcod +++| not XDEF-ed. That is, nesting of XDEF-ed PROCs is only
01224 M00S01223.sympcod +++| allowed one level deep.
01225 M00S01224.sympcod +++|
01226 M00S01225.sympcod +++| The second level of nesting is used only for routines which
01227 M00S01226.sympcod +++| perform an algorithm not expected to be of value outside of
01228 M00S01227.sympcod +++| the parent routine. Second level nested routines should be
01229 M00S01228.sympcod +++| very simple in their logical structure. The same principles
01230 M00S01229.sympcod +++| will apply for deeper level routines.
01231 M00S01230.sympcod +++|
01232 M00S01231.sympcod +++| Non-XDEF internal procedures must have the same header
01233 M00S01232.sympcod +++| documentation as any external procedure.
01234 M00S01233.sympcod +++|
01235 M00S01234.sympcod +++| b. External symbols may be more than 7 characters long. The
01236 M00S01235.sympcod +++| programmer is responsible to assure uniqueness within the
01237 M00S01236.sympcod +++| first 7 characters. These oversize external names, while
01238 M00S01237.sympcod +++| permissible, are discouraged and should be used only when the
01239 M00S01238.sympcod +++| programmer cannot reduce the routine name to a 7 character
01240 M00S01239.sympcod +++| name with sufficient clarity.
01241 M00S01240.sympcod +++|
01242 M00S01241.sympcod +++| c. COMPASS subroutines are allowed for optimization of tight
01243 M00S01242.sympcod +++| loops. Such routines should be designed to contain a minimum
01244 M00S01243.sympcod +++| of decision-making logic.
01245 M00S01244.sympcod +++|1
01246 M00S01245.sympcod +++| A1-2
01247 M00S01246.sympcod +++| NOS SYMPL CODING STANDARD
01248 M00S01247.sympcod +++| 06/01/83
01249 M00S01248.sympcod +++| -----------------------------------------------------------------
01250 M00S01249.sympcod +++| A1.0 Addendum for SMF Project
01251 M00S01250.sympcod +++| -----------------------------------------------------------------
01252 M00S01251.sympcod +++|
01253 M00S01252.sympcod +++| d. Each compilation unit in the editor shall call COMAFSE as
01254 M00S01253.sympcod +++| its first common deck. This deck contains symbol and macro
01255 M00S01254.sympcod +++| definitions which must appear early in the source code. Other
01256 M00S01255.sympcod +++| common decks may be called either in alphabetic order or in
01257 M00S01256.sympcod +++| functional order. One example of functional order would be
01258 M00S01257.sympcod +++| the storage mapping of a common block which can only be
01259 M00S01258.sympcod +++| described by using several common decks (this can arise in a
01260 M00S01259.sympcod +++| situation where nested common decks would be desired but the
01261 M00S01260.sympcod +++| product is is built via MODIFY) correct storage mapping would
01262 M00S01261.sympcod +++| thus require that the common decks be called in a particular
01263 M00S01262.sympcod +++| order for which alphabetic naming may not be reasonable.
01264 M00S01263.sympcod +++|
01265 M00S01264.sympcod +++|
01266 M00S01265.sympcod +++| 2. Statement formats
01267 M00S01266.sympcod +++|
01268 M00S01267.sympcod +++| a. The FOR keyword may be used. CONTROL FASTLOOP (FASTFOR)
01269 M00S01268.sympcod +++| is not permitted.
01270 M00S01269.sympcod +++|
01271 M00S01270.sympcod +++| b. FOR loops and simulated case statements are allowed to
01272 M00S01271.sympcod +++| terminate with a RETURN statement or the IORET macro. In the
01273 M00S01272.sympcod +++| editor, the ERRJUMP call may be used to terminate any block
01274 M00S01273.sympcod +++| of code. ERRJUMP will be a procedure which is itself allowed
01275 M00S01274.sympcod +++| to execute a jump into a procedure. ERRJUMP is used to clear
01276 M00S01275.sympcod +++| the editor into a nominal condition after encountering a
01277 M00S01276.sympcod +++| syntax error. In the editor, code may also be terminated by
01278 M00S01277.sympcod +++| a call to a fatal-error routine.
01279 M00S01278.sympcod +++|
01280 M00S01279.sympcod +++| Loops may be based on labels and GOTO-s in place of FOR only
01281 M00S01280.sympcod +++| when the programmer can defend this usage as substantially
01282 M00S01281.sympcod +++| more efficient or as being simpler to maintain than
01283 M00S01282.sympcod +++| functionally equivalent structured code.
01284 M00S01283.sympcod +++|
01285 M00S01284.sympcod +++| Simulated case statements may use a backward jump to achieve
01286 M00S01285.sympcod +++| the common exit when the case is embedded in an iterative
01287 M00S01286.sympcod +++| structure for which labels and GOTO-s are allowed.
01288 M00S01287.sympcod +++|
01289 M00S01288.sympcod +++|1
01290 M00S01289.sympcod +++| A1-3
01291 M00S01290.sympcod +++| NOS SYMPL CODING STANDARD
01292 M00S01291.sympcod +++| 06/01/83
01293 M00S01292.sympcod +++| -----------------------------------------------------------------
01294 M00S01293.sympcod +++| A1.0 Addendum for SMF Project
01295 M00S01294.sympcod +++| -----------------------------------------------------------------
01296 M00S01295.sympcod +++|
01297 M00S01296.sympcod +++| c. A PROC/FUNC/PRGM statement shall begin in column 1 for a
01298 M00S01297.sympcod +++| compilation unit and for a first-level nested PROC/FUNC.
01299 M00S01298.sympcod +++| PROC/FUNC statements nested to deeper levels shall be
01300 M00S01299.sympcod +++| indented 2 columns per level. The body of code in a routine
01301 M00S01300.sympcod +++| shall be indented 2 columns from the PROC/FUNC statement.
01302 M00S01301.sympcod +++| Code contained in a CONTROL IF bracket shall be indented 2
01303 M00S01302.sympcod +++| columns from the CONTROL statement. BEGINs and ENDs shall be
01304 M00S01303.sympcod +++| indented 2 columns, and the code within the BEGIN/END shall
01305 M00S01304.sympcod +++| be aligned with the BEGIN/END. In the editor, IOBEGIN and
01306 M00S01305.sympcod +++| IOEND macros shall be indented as though they are BEGIN/END.
01307 M00S01306.sympcod +++|
01308 M00S01307.sympcod +++|
01309 M00S01308.sympcod +++| 3. Documentation
01310 M00S01309.sympcod +++|
01311 M00S01310.sympcod +++| a. Documentaton of ENTRY/EXIT conditions and of storage
01312 M00S01311.sympcod +++| usage must include assumptions regarding manipulations of
01313 M00S01312.sympcod +++| pointer words for based arrays.
01314 M00S01313.sympcod +++|
01315 M00S01314.sympcod +++| b. For compilation units whose main entry point is uncalled,
01316 M00S01315.sympcod +++| the main entry may carry documentation considered applicable
01317 M00S01316.sympcod +++| to all embedded procedures.
01318 M00S01317.sympcod +++|
01319 M00S01318.sympcod +++| c. XREF and XDEF may be provided by lists of routine names
01320 M00S01319.sympcod +++| in common decks. Such lists of XDEF should be listed, but
01321 M00S01320.sympcod +++| such lists of XREF should not be listed except for a comment
01322 M00S01321.sympcod +++| noting the call to the common deck. DOCMENT brackets are not
01323 M00S01322.sympcod +++| required.
01324 M00S01323.sympcod +++|
01325 M00S01324.sympcod +++| d. Stand alone comments may be a single line starting with
01326 M00S01325.sympcod +++| a pound sign in column 1 and ending with a pound sign in
01327 M00S01326.sympcod +++| column 71, rather than the COMPASS style comment (asterisk in
01328 M00S01327.sympcod +++| column 1 of the comment body).
01329 M00S01328.sympcod +++|
01330 M00S01329.sympcod +++| The use of preceeding and proceeding blank lines is
01331 M00S01330.sympcod +++| negotiable between the programmer and reviewer to achieve a
01332 M00S01331.sympcod +++| mutually satisfactory visual effect. Note that this
01333 M00S01332.sympcod +++| simplified form for stand alone comments is only applicable
01334 M00S01333.sympcod +++| for comments not intended to be printed by the DOCMENT
01335 M00S01334.sympcod +++| utility.
01336 M00S01335.sympcod +++|
01337 M00S01336.sympcod +++|
01338 M00S01337.sympcod +++| 4. Pseudo-reentrancy considerations (for FSE and SMFEX only).
01339 M00S01338.sympcod +++|
01340 M00S01339.sympcod +++| a. The SMFEX Executive may contain a limited number of
01341 M00S01340.sympcod +++| labels within if or for blocks, and external labels within
01342 M00S01341.sympcod +++| procedures, as necessary to implement pseudo-reentrancy.
01343 M00S01342.sympcod +++|
01344 M00S01343.sympcod +++| b. SMFEX and FSE will contain procedures subject to reentry
01345 M00S01344.sympcod +++| under control of the SMFEX Executive. A reentrant procedure
01346 M00S01345.sympcod +++| is a procedure which calls another reentrant procedure or
01347 M00S01346.sympcod +++| uses the delay or recall statements. There cannot be
01348 M00S01347.sympcod +++| reentrant functions.
01349 M00S01348.sympcod +++|
01350 M00S01349.sympcod +++|1
01351 M00S01350.sympcod +++| A1-4
01352 M00S01351.sympcod +++| NOS SYMPL CODING STANDARD
01353 M00S01352.sympcod +++| 06/01/83
01354 M00S01353.sympcod +++| -----------------------------------------------------------------
01355 M00S01354.sympcod +++| A1.0 Addendum for SMF Project
01356 M00S01355.sympcod +++| -----------------------------------------------------------------
01357 M00S01356.sympcod +++|
01358 M00S01357.sympcod +++| c. The reentrancy technique severly restricts the usage of
01359 M00S01358.sympcod +++| local storage and of parameters. The programmer should
01360 M00S01359.sympcod +++| dedicate common block storage to the functions performed by
01361 M00S01360.sympcod +++| a reentrant routine, in preference to locals. Note that the
01362 M00S01361.sympcod +++| common block includes one general purpose variable which is
01363 M00S01362.sympcod +++| stackable, so that reentrant routines can dynamically
01364 M00S01363.sympcod +++| allocate storage on a limited scale.
01365 M00S01364.sympcod +++|
01366 M00S01365.sympcod +++| d. Reentrant procedures must minimize the use of local
01367 M00S01366.sympcod +++| storage. Any sequence of code in a reentrant procedure which
01368 M00S01367.sympcod +++| uses local storage must be preceded and followed by stand
01369 M00S01368.sympcod +++| alone comments of the form
01370 M00S01369.sympcod +++|
01371 M00S01370.sympcod +++| # LOCAL #
01372 M00S01371.sympcod +++|
01373 M00S01372.sympcod +++| # END LOCAL #
01374 M00S01373.sympcod +++|
01375 M00S01374.sympcod +++| The code within the comments cannot call any reentrant
01376 M00S01375.sympcod +++| routines.
01377 M00S01376.sympcod +++|
01378 M00S01377.sympcod +++| e. Reentrant procedures must minimize the use of parameters.
01379 M00S01378.sympcod +++| When parameters are used, it is essential that the parameters
01380 M00S01379.sympcod +++| be read-only (i.e. the subroutine does not compute a new
01381 M00S01380.sympcod +++| value), and they must be used before any reentrant procedure
01382 M00S01381.sympcod +++| is called. Use of parameters shall be followed by a stand
01383 M00S01382.sympcod +++| alone comment of the form:
01384 M00S01383.sympcod +++|
01385 M00S01384.sympcod +++| # END PARAMETERS #
01386 M00S01385.sympcod +++|
01387 M00S01386.sympcod +++| f. Reentrant routines lose control by calling DELAY or
01388 M00S01387.sympcod +++| RECALL. In the single-user version, these are COMPASS
01389 M00S01388.sympcod +++| subroutines which execute recall macros. In the multi-user
01390 M00S01389.sympcod +++| version, these are DEF-ed to be calls into certain entry
01391 M00S01390.sympcod +++| points within SMFEX to invoke the multi-tasking executive.
01392 M00S01391.sympcod +++|
01393 M00S01392.sympcod +++| g. Reentrant routines are bracketed by the IOBEGIN and IOEND
01394 M00S01393.sympcod +++| macros. In the single-user version, these are DEF-ed to
01395 M00S01394.sympcod +++| simply yield BEGIN and END. In the multi-user version, these
01396 M00S01395.sympcod +++| are DEF-ed to generate code to maintain data structures which
01397 M00S01396.sympcod +++| help the SMFEX multi-task executive supervise the reentry.
01398 M00S01397.sympcod +++| Reentrant routines cannot use the RETURN statement, but can
01399 M00S01398.sympcod +++| use the IORET macro.
01400 M00S01399.sympcod +++|
01401 M00S01400.sympcod +++|1
01402 M00S01401.sympcod +++| A1-5
01403 M00S01402.sympcod +++| NOS SYMPL CODING STANDARD
01404 M00S01403.sympcod +++| 06/01/83
01405 M00S01404.sympcod +++| -----------------------------------------------------------------
01406 M00S01405.sympcod +++| A1.0 Addendum for SMF Project
01407 M00S01406.sympcod +++| -----------------------------------------------------------------
01408 M00S01407.sympcod +++|
01409 M00S01408.sympcod +++| h. Reentrant routines must be restricted as to the type of
01410 M00S01409.sympcod +++| monitor calls they can issue either explicitly or by calling
01411 M00S01410.sympcod +++| other routines. In particular, reentrant code must use only
01412 M00S01411.sympcod +++| CIO and each CIO call must be explicit. This effectively
01413 M00S01412.sympcod +++| bans the use of the standard NOS common decks. Furthermore,
01414 M00S01413.sympcod +++| the only file which can be dealt with by reentrant code is
01415 M00S01414.sympcod +++| the editor workfile. Terminal I/O will be funneled into one
01416 M00S01415.sympcod +++| module of code, which shall conditionally compile to yield
01417 M00S01416.sympcod +++| conventional FET-s and CIO calls for FSE, and calls to the
01418 M00S01417.sympcod +++| SMFEX Executive for SMF.
01419 M00S01418.sympcod +++|
01420 M00S01419.sympcod +++| i. The only writeable storage which can be used other than
01421 M00S01420.sympcod +++| local storage as described above shall reside in a single
01422 M00S01421.sympcod +++| common block, or shall reside in based arrays whose pointer
01423 M00S01422.sympcod +++| words are in the common block. The common block shall be
01424 M00S01423.sympcod +++| organized into several sections based on the various degrees
01425 M00S01424.sympcod +++| of reentrancy services provided by the SMFEX Executive. in
01426 M00S01425.sympcod +++| the single-user editor, portions of this common block must be
01427 M00S01426.sympcod +++| compiled to map exactly the same as the multi-user version,
01428 M00S01427.sympcod +++| since that portion of the common block is tranferred verbatim
01429 M00S01428.sympcod +++| through the workfile for communication between the two
01430 M00S01429.sympcod +++| versions of the editor. All critical storage mapping must be
01431 M00S01430.sympcod +++| identified as such in documentation.
01432 M00S01431.sympcod +++|
01433 M00S01432.sympcod +++| j. Reentrant code shall minimize dynamic relocation of based
01434 M00S01433.sympcod +++| arrays. Relocation is allowed if the pointer word is treated
01435 M00S01434.sympcod +++| as non-reentrant. Relocation is possible with limited
01436 M00S01435.sympcod +++| reentrancy provided the pointer word is mapped into the
01437 M00S01436.sympcod +++| reentrant section of the common block. Note that while this
01438 M00S01437.sympcod +++| will keep a pointer value alive for the duration of disk I/O,
01439 M00S01438.sympcod +++| it is not able to keep any pointer valid across terminal I/O
01440 M00S01439.sympcod +++| unless the pointer points within reentrant common itself.
01441 M00S01440.sympcod +++| This is due to the re-mapping of array locations performed by
01442 M00S01441.sympcod +++| the SMFEX Executive upon internal swaps. For those arrays
01443 M00S01442.sympcod +++| re-mapped by SMFEX swapping, no module except SMFEX can ever
01444 M00S01443.sympcod +++| change the pointer word.
01445 M00S01444.sympcod +++|*WEOR