In the assembly language used in Unix on DEC machines (PDP-11, VAX), one can use numerical labels and refer to them with suffixes "b" and "f" meaning "backwards" and "forwards", e.g. (in the insructions beql
, bneq
, aoblss
, acbw
below)
#
# search the root directory
#
clrl r12 # init block pointer
dirblk:
clrl r5 # use beginning of mem as buffer
bsbw lread
bneq stask # eof, try another file
clrl r9
0:
movzwl (r9)+,r0 # empty entry?
beql 2f # yes, skip it
clrl r1
1: cmpb (r9)[r1],bootname[r1] # MicroVAX II doesn't have cmpc
bneq 2f
aoblss $DIRSIZ,r1,1b
brb diryes # the name we want
2: acbw $FSBSIZE-1,$DIRSIZ,r9,0b
incl r12 # get next block
brb dirblk
Numerical labels can be reused as the references signify the closest occurrence of the label with the given number in the given direction (and, IIRC, no further than the closest alphanumerical label in that direction). This greatly reduced the need to invent names for labels, made the assembly code quite neat, and improved readability with the relative location of the branch target explicitly specified.
Per @another-dave in the comments, the original DEC assembly language had local labels as well, with a slightly different naming convention.
Was there a similar feature in the IBM assembly language?
nn$
, where the 'nn' part had to be unique in the range between any two ordinary labels.. There was no 'f' and 'b' suffix on the reference to the label (no need). The forward-and-back convention was for the Unix PDP-11 assembler. A glance at an arbitrary online copy of the Macro-32 manual confirms my view for VAX.$DIRSIZ
you evidently mean 'literally the value DIRSIZ'. That would be written#DIRSIZ
in the DEC assembly language, and$
is just another valid character in a name.