-.pp
-There has been no experience with foreign programs using
-the binary symbolic intermediate form.
-.bp
-.SH 1 "Appendix 1: Binary Symbolic Intermediate Format"
-.pp
-The binary symbolic (\c
-.i bs
-for short) intermediate
-form for assembly language
-closely follows the syntax of
-.q human
-symbolic assembly language.
-However,
-some of the expressive flexibility allowed in the
-human symbolic assembly language is not allowed in the
-.i bs
-form,
-to simplify the
-.i bs
-form as much as possible.
-In addition,
-concessions to the internals
-of the assembler are made in the
-.i bs
-form.
-This implementation decision
-simplifies the assembler's internal buffering and
-necessitates only one internal form.
-.pp
-.i Bs
-is structured as a prefix linearized forest of description trees.
-Each node in the description tree
-is represented by a byte code.
-The nodes may have up to six children.
-Some of the nodes have semantic attributes;
-some semantic attributes are of concern only to the assembler,
-but must be in the
-.i bs
-form as place holders.
-The semantic attributes immediately follow the byte code.
-.SH 2 "Binary Symbolic Node Definitions"
-.pp
-Table 1
-defines the symbolic names for the description nodes,
-the type of the node,
-the number of children to the node,
-the restrictions on the kind of children,
-and the mapping of the description node,
-including its children,
-to the human assembly format.
-Table 2 defines the semantic attributes required for
-all attributed nodes.
-.pp
-The restrictions on the children are encoded in the mapping string.
-In addition,
-the prefix left to right order of a node's children is identical
-to the left to right enumeration of the children in the mapping string.
-The restrictions are encoded in the mapping string as
-.i printf
-like escapes.
-.(b
-.TS
-center;
-l l.
-escape child requirement
-_
-%a address mode node, ADDR
-%b Bignum (large scalar or floating)
-%e expression mode node, EXPR
-%c comma node for operands, CMTR
-%n name, BS\*(USNAME
-%r register, BS\*(USREG
-%r register expression, BS\*(USREGOP
-%s string, BS\*(USSTRING
-%% % sign
-
-%I print an integer constant
-%N print a name
-%S print a string
-%R print a register
-%B print a big number
-%O print an instruction
-.TE
-.)b
-.pp
-These are the node types used in Table 1:
-.(b
-.TS
-center;
-c l.
-node type description
-_
-ROOT the node can only appear at the root of a tree
-CMTR the node is the only argument to an instruction
-ADDR an addressing mode
-EXPR an expression
-VADDR an illegal addressing mode
-.TE
-.)b
-.bp
-.ce 1
-Table 1: Binary Symbolic Node Definitions
-.ce 0
-.sp 1
-.TS
-center;
-l l n l l
-l l n lb l.
-node type arity key arguments
-=
-Root
-_
- BS\*(USNL ROOT 0 \en
- BS\*(USPARSEEOF ROOT 0 <EOF>
- BS\*(USLABEL ROOT 1 %n:
-=
-Directives
-_
- BS\*(USABORT ROOT 0 .ABORT;
- BS\*(USFILE ROOT 1 .file %s;
- BS\*(USLINENO ROOT 1 .line %e;
-_
- BS\*(USDATA ROOT 1 .data %e;
- BS\*(USTEXT ROOT 1 .text %e;
-_
- BS\*(USORG ROOT 2 .org %e,%e;
- BS\*(USALIGN ROOT 2 .align %e,%e;
- BS\*(USSPACE ROOT 2 .space %e,%e;
- BS\*(USFILL ROOT 3 .fill %e,%e,%e;
-_
- BS\*(USBYTE ROOT 1 .byte %e;
- BS\*(USWORD ROOT 1 .word %e;
- BS\*(USLONG ROOT 1 .long %e;
- BS\*(USQUAD ROOT 1 .quad %b;
- BS\*(USOCTA ROOT 1 .octa %b;
- BS\*(USFFLOAT ROOT 1 .ffloat %b;
- BS\*(USDFLOAT ROOT 1 .dfloat %b;
- BS\*(USGFLOAT ROOT 1 .gfloat %b;
- BS\*(USHFLOAT ROOT 1 .hfloat %b;
- BS\*(USASCII ROOT 1 .ascii %s;
-_
- BS\*(USCOMM ROOT 2 .com %n,%e;
- BS\*(USLCOMM ROOT 2 .lcomm %n,%e;
- BS\*(USGLOBAL ROOT 1 .global %n;
- BS\*(USSET ROOT 2 .set %n,%e;
- BS\*(USLSYM ROOT 2 .lsym %n,%e;
-_
- BS\*(USSTABN ROOT 4 .stabn %e,%e,%e,%e;
- BS\*(USSTABS ROOT 5 .stabs %s,%e,%e,%e,%e;
- BS\*(USSTABD ROOT 3 .stabd %e,%e,%e;
-=
-Leaves
-_
- BS\*(USICON EXPR 0 \& <integer, in decimal>
- BS\*(USNAME EXPR 0 \& <name>
- BS\*(USSTRING EXPR 0 \& <quoted string>
- BS\*(USREG EXPR 0 \& r<integer>
-_
- BS\*(USBNQ EXPR 0 <quad scalar, in hex>
- BS\*(USBNO EXPR 0 \& <octal scalar, in hex>
- BS\*(USBNF EXPR 0 \& <F float, in hex>
- BS\*(USBND EXPR 0 \& <D float, in hex>
- BS\*(USBNG EXPR 0 \& <G float, in hex>
- BS\*(USBNH EXPR 0 \& <H float, in hex>
-.bp
-=
-Operators
-_
- BS\*(USREGOP EXPR 1 \& %%%e
-_
- BS\*(USPLUS EXPR 2 \& (%e + %e)
- BS\*(USMINUS EXPR 2 \& (%e - %e)
- BS\*(USMUL EXPR 2 \& (%e * %e)
- BS\*(USDIV EXPR 2 \& (%e / %e)
- BS\*(USMOD EXPR 2 \& (%e %% %e)
-_
- BS\*(USLSH EXPR 2 \& (%e < %e)
- BS\*(USRSH EXPR 2 \& (%e > %e)
-_
- BS\*(USXOR EXPR 2 \& (%e ^ %e)
- BS\*(USIOR EXPR 2 \& (%e | %e)
- BS\*(USAND EXPR 2 \& (%e & %e)
- BS\*(USORNOT EXPR 2 \& (%e ! %e)
-=
-Instructions
-_
- BS\*(USINST ROOT 1 %O %c;
- BS\*(USJXXX ROOT 1 %O %c;
-_
- BS\*(USCM0 CMTR 0 \&
- BS\*(USCM1 CMTR 1 \& %a
- BS\*(USCM2 CMTR 2 \& %a,%a
- BS\*(USCM3 CMTR 3 \& %a,%a,%a
- BS\*(USCM4 CMTR 4 \& %a,%a,%a,%a
- BS\*(USCM5 CMTR 5 \& %a,%a,%a,%a,%a
- BS\*(USCM6 CMTR 6 \& %a,%a,%a,%a,%a,%a
-.bp
-=
-Address modes
-_
- AM\*(USIMM ADDR 1 \& \*(DL%e
- AMD(AM\*(USIMM) VADDR 1 \& snark
- AMI(AM\*(USIMM) VADDR 1 \& snark
- AMDD(AM\*(USIMM) VADDR 1 \& snark
-_
- AM\*(USREG ADDR 1 \& %r
- AMD(AM\*(USREG) ADDR 1 \& (%r)
- AMI(AM\*(USREG) VADDR 1 \& snark
- AMDI(AM\*(USREG) ADDR 2 \& (%r)[%r]
-_
- AM\*(USINCR ADDR 1 \& (%r)+
- AMD(AM\*(USINCR) ADDR 1 \& *(%r)+
- AMI(AM\*(USINCR) ADDR 2 \& (%r)+[%r]
- AMDI(AM\*(USINCR) ADDR 2 \& *(%r)+[%r]
-_
- AM\*(USEXPR ADDR 1 \& %e
- AMD(AM\*(USEXPR) ADDR 1 \& *%e
- AMI(AM\*(USEXPR) ADDR 2 \& %e[%r]
- AMDI(AM\*(USEXPR) ADDR 2 \& *%e[%r]
-_
- AM\*(USDECR ADDR 1 \& -(%r)
- AMD(AM\*(USDECR) VADDR 1 \& snark
- AMI(AM\*(USDECR) ADDR 2 \& -(%r)[%r]
- AMDI(AM\*(USDECR) VADDR 2 \& snark
-_
- AM\*(USDISPA ADDR 2 \& %e(%r)
- AMD(AM\*(USDISPA) ADDR 2 \& *%e(%r)
- AMI(AM\*(USDISPA) ADDR 3 \& %e(%r)[%r]
- AMDI(AM\*(USDISPA) ADDR 3 \& *%e(%r)[%r]
-_
- AM\*(USDISP1 ADDR 2 \& b\`%e(%r)
- AMD(AM\*(USDISP1) ADDR 2 \& *b\`%e(%r)
- AMI(AM\*(USDISP1) ADDR 3 \& b\`%e(%r)[%r]
- AMDI(AM\*(USDISP1) ADDR 3 \& *b\`%e(%r)[%r]
-_
- AM\*(USDISP2 ADDR 2 \& w\`%e(%r)
- AMD(AM\*(USDISP2) ADDR 2 \& *w\`%e(%r)
- AMI(AM\*(USDISP2) ADDR 3 \& w\`%e(%r)[%r]
- AMDI(AM\*(USDISP2) ADDR 3 \& *w\`%e(%r)[%r]
-_
- AM\*(USDISP4 ADDR 2 \& l\`%e(%r)
- AMD(AM\*(USDISP4) ADDR 2 \& *l\`%e(%r)
- AMI(AM\*(USDISP4) ADDR 3 \& l\`%e(%r)[%r]
- AMDI(AM\*(USDISP4) ADDR 3 \& *l\`%e(%r)[%r]
-.TE