[TUHS] .globl directive -- is this a 35-bit constant?

segaloco via TUHS tuhs at tuhs.org
Fri Mar 29 06:59:49 AEST 2024


On Thursday, March 28th, 2024 at 12:44 PM, ron minnich <rminnich at gmail.com> wrote:

> ACPI has 4-byte identifiers (guess why!), but I just wondered, writing some assembly:is it globl, not global, or glbl, because globl would be a one-word constant on the PDP-10 (5 7-bit bytes)?
> 
> Not entirely off track, netbsd at some point (still does?) ran on the PDP-10.

Note any page references below are in reference to the linked PDF, not the original document page numbers.

Many facts folks here know better than I, but being through for completeness, as(I) derives syntactically from PAL-11R.  Section 8.2 of the May 1971 PAL-11R manual[1] describes the .GLOBL directive (p. 35).  Looking forward just a bit, .GLOBL survives into MACRO-11 in June 1972[2], described in section 6.10 (p. 89).

Looking then over the fence to MACRO-10 as of June 1972[3], I couldn't find a reference to a .GLOBL or comparably named pseudo-op, with the table being found in Appendix A(pp. 111-112).  There are plenty of pseudo-ops ranging in name lengths from two (e.g. IF) to nine (e.g. UNIVERSAL) characters, it doesn't seem there was any strong preference in character length for psuedo-ops in MACRO-10.

I found some references to a "PAL-10" online but could not locate a manual, but the references I did see indicated this may be referring to a cross-assembler for PDP-8.  Taking one more look back to the MACRO-9 assembler for PDP-9, circa November 1968[4], this assembler does have a .GLOBL pseudo-op defined in section 3.9 (pp. 38-39).  It seems .GLOBL skipped PDP-10.  I'm sure further analysis could pinpoint the earliest PDP assembler to utilize ".GLOBL" but from the looks of things it never touched the PDP-10, at least in the native assembler.

- Matt G.

P.S. As an aside, I use the cc65 toolkit for 6502 projects I tinker on, it's in some ways modeled after the UNIX cc/as/ld environment but exhibits enough differences that I sometimes wonder what they were thinking.  I don't mean too much criticism, it's a free tool I get to use all I want, and I'm grateful for that, but a relevant instance here is that there is no .globl.  Rather the pseudo-op is ".export", and there are several things like that where it could've been nice and even with how the standard UNIX commands and syntax work, but missed the mark by just that much.  I fear given that cc65 has been around for a while, any attempts I'd make to wrangle the syntax and CLI options to be closer to UNIX would be unwelcome as so much code is already extant with the differences.  On the flip side, if I produce my own fork and write my code against that fork, nobody else will be able to use my code without it :(

[1] - http://bitsavers.org/pdf/dec/pdp11/dos-batch/DEC-11-ASDB-D_PAL-11R_Assembler_Programmers_Manual_May71.pdf
[2] - http://bitsavers.org/pdf/dec/pdp11/dos-batch/DEC-11-OMACA-A-D_DOS_MACRO-11_Assembler_Programmers_Manual_Jun72.pdf
[3] - http://bitsavers.org/pdf/dec/pdp10/TOPS10/1973_Assembly_Language_Handbook/02_1973AsmRef_macro.pdf
[4] - http://bitsavers.org/pdf/dec/pdp9/DEC-9A-AMZA-D_MACRO9.pdf


More information about the TUHS mailing list