PiDP-8/I Software

Changes To A Field Guide to PDP-8 Assemblers
Log In

Changes to "A Field Guide to PDP-8 Assemblers" between 2018-01-30 10:23:59 and 2018-01-30 10:25:42

275
276
277
278
279
280
281




















282
283
284
285
286
287
288
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+








RALF generates relocatable output code in `*.RL` files rather than absolute-addressed output, which means you cannot simply load its output into core and execute it directly. You must use the OS/8 FORTRAN IV loader (`LOAD.SV`) to load one or more `*.RL` files into core memory, link them to any external libraries, convert relative addresses to fixed addresses, and write out a loader image (`*.LD`) which can then be loaded an run by the OS/8 FORTRAN IV Run Time System, `FRTS.SV`.

The compensation for this complicated scheme is that `LOAD.SV` and `FRTS.SV` provide a powerful overlay and linkage loading scheme which allows for programs up to about 300 kWords in size, nearly 10× the maximum core memory size in a standard PDP-8 family computer. It does this by loading code from disk as needed. This scheme is made possible by the relocatable output code from RALF.

(Do not confuse `LOAD.SV`, the OS/8 FORTRAN IV loader — used by both RALF and F4 — with `LOADER.SV`, the simpler "linking loader" used by the OS/8 FORTRAN II compiler (`FORT.SV`) and by [SABR](#sabr). There's a second cause for confusion: both loaders use `*.RL` as their default input file name extension, so RALF, F4, FORT, and SABR all output files with that extension.)


#### Further Improvements

RALF also has many other improvements over late-generation PAL family assemblers such as PAL8 which are not directly tied to driving the FPP or to relocatable code:

*   Expressions:
    *   Multiplication is `*` rather than `^`; this is possible because RALF offers the `ORG` pseudo-op to set the location counter, where PAL family assemblers use `*`
    *   Division is `/` rather than `%`, achieved by requiring whitespace before `/` if used to start a comment and disallowing spaces in expressions
*   Many new and changed pseudo-ops:
    *   `ADDR`: define address constant
    *   `E` and `F`: define floating-point constants
    *   `IFPOS`, `IFNEG`, `IFSW`, `IFNSW`, `IFFLAP`, and `IFRALF` conditional assembly pseudo-ops
    *   `IFREF`: replaces `IFDEF` pseudo-op, having a superset of its functionality
    *   `LISTOF`/`LISTON`: stop and start listing output rather than the PAL family's `XLIST` pseudo-op
    *   `REPEAT`: assemble the following line multiple times
    *   `COMMON`, `COMMZ`, `ENTRY`, `EXTERN`, `FIELD1`, `SECT`, and `SECT8` pseudo-ops to support FORTRAN IV code

[fpp8a]: https://archive.org/details/bitsavers_decpdp8pdpUsersManDec76_996770
[fpp12]: https://archive.org/details/bitsavers_decpdp12DE_2606247


#### Justifiable Restrictions

There are restrictions in RALF relative to late-generation PAL family assemblers that are justifiable on the grounds that they follow from the requirement that the output code be relocatable:

*   It does not understand the `PAGE` pseudo-op: the PAL form of this feature — where the page number is given as an argument to the pseudo-op — inherently goes against the nature of relocatable output. The inability to accept the argument-less version understood by [SABR](#sabr) is harder to justify.

306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
326
327
328
329
330
331
332




















333
334
335
336
337
338
339







-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-








*   Its expression syntax has no "and" operator, `&`

*   It does not support zero-page literals: `[20]`

    This restriction does not seem to have a good justification, even in relocatable assembler output, since the nature of the feature at both at the assembly and machine code levels is that the memory reference is inherently absolute. Thus, generation of a zero-page literal cannot affect the ability of the loader to relocate the generated code.


#### Further Improvements

RALF also has many other improvements over late-generation PAL family assemblers such as PAL8 which are not directly tied to driving the FPP or to relocatable code:

*   Expressions:
    *   Multiplication is `*` rather than `^`; this is possible because RALF offers the `ORG` pseudo-op to set the location counter, where PAL family assemblers use `*`
    *   Division is `/` rather than `%`, achieved by requiring whitespace before `/` if used to start a comment and disallowing spaces in expressions
*   Many new and changed pseudo-ops:
    *   `ADDR`: define address constant
    *   `E` and `F`: define floating-point constants
    *   `IFPOS`, `IFNEG`, `IFSW`, `IFNSW`, `IFFLAP`, and `IFRALF` conditional assembly pseudo-ops
    *   `IFREF`: replaces `IFDEF` pseudo-op, having a superset of its functionality
    *   `LISTOF`/`LISTON`: stop and start listing output rather than the PAL family's `XLIST` pseudo-op
    *   `REPEAT`: assemble the following line multiple times
    *   `COMMON`, `COMMZ`, `ENTRY`, `EXTERN`, `FIELD1`, `SECT`, and `SECT8` pseudo-ops to support FORTRAN IV code

[fpp8a]: https://archive.org/details/bitsavers_decpdp8pdpUsersManDec76_996770
[fpp12]: https://archive.org/details/bitsavers_decpdp12DE_2606247


### <a id="flap"></a>FLAP

[RALF](#ralf) was based on a simpler assembler called FLAP, which generates absolute-addressed code, just as PAL8 does. This section will simply describe the differences in FLAP relative to RALF. These differences aside, FLAP shares the feature set of RALF.

The primary advantage FLAP has over RALF is that, because it is difficult to ascribe meaning to the "page" concept in relocatable assembler output, RALF doesn't support the `PAGE` pseudo-op, while FLAP does. FLAP also supports the PAL family's zero-page and current-page literal syntaxes, while RALF does not.