PAL8XR V02 A PDP-8/INTERSIL 6100 cross-assembler implemented on a PDP-11 operating under RT-11 Author: B. R. Bergen (University of Massachusetts) Revised by: R. D. Beattie (C.S.I.R.O.) Revision date: 21st June 1978. CSIRO Division of Mineral Physics P.O. Box 136 North Ryde NSW, AUSTRALIA, 2113 This program is a revision of PAL8,11 (DECUS program No. 11-201). Documentation prepared using RT-11 RUNOFF (DECUS 11-314). PAL8XR X-ASSEMBLER Page 1 1. INTRODUCTION PAL8XR V02 is an assembler for a PDP-8 minicomputer or INTERSIL 6100 microprocessor, that will execute on a PDP-11 operating under RT-11. With the exceptions of the variations listed in this manual, it is compatible with the PAL III assembly language. The assembler is a revision of PAL8,11 (DECUS 11-201), and is almost identical to that program apart from the modification of the I/O routines to conform to RT-11 practices. This write-up assumes the user is familiar with the PAL III assembler and the RT-11 operating system. 2. REQUIREMENTS Any valid RT-11 system; RT-11 V02C or later. The program requires 4.5k words of free memory, plus additional space for non-resident device handlers. The symbol table has space for 512. symbols. If the table overflows or if there is insufficient memory to run the program, the symbol table allocation can be changed by altering the value of TOPROG on Page 1 of PAL8XR.MAC and re-assembling the file. 3. DOCUMENTATION The distribution medium contains the .MAC,.SAV,.LST,.RNO and .DOC files for the program PAL8XR. The .LST file is a cross referenced assembler listing of the program. The .RNO and .DOC files are input and output files respectively for the documentation program PDP-11 RUNOFF (DECUS No. 11-314). PAL8XR X-ASSEMBLER Page 2 4. PAL8XR ASSEMBLY DIRECTIVES The following assembly directives are available in PAL8XR: DECIMA(L) - changes the assembly radix to decimal. OCTAL - changes the assembly radix to octal. The radix is initially set to octal. FIELD x - used by the extended memory loader. Causes a field setting 'x' to be output on the binary output. The assembler origin is reset to 0200. 'x' must be between 0 and 7 inclusive. PAUSE - indicates an end of file (EOF) condition. The assembler continues the assembly from the next open input file. Z x - causes the assembler to reserve 'x' words of zeroes, starting at the word indicated by the current location counter. I - sets the indirect bit (bit #3) in the assembled word PAGE - terminates current memory page and advances the assembly location counter to the next page in memory. FIXMRI x=y - defines 'x' as a memory reference instruction with a value of 'y'. Must immediately follow an EXPUNGE before any other symbols are defined. EXPUNG(E) - expunge the entire symbol table apart from the pseudo-instructions. FIXTAB - fix the symbol table. Adds the preceding symbol definitions to the assembler's permanent symbol table. Symbols that have been fixed will not be printed in the symbol table listing at the end of PASS 3. Single character operators: $ - end of pass (i.e. program) * - origin setting + - addition - - subtraction , - direct assignment . - current location counter / - enter comment field = - parameter assignment ; - treat as PAL8XR X-ASSEMBLER Page 3 5. COMPATIBILITY WITH PAL III The program is compatible with PAL III with the following exceptions: a) Multiple assignment statements may go beyond 2 levels. e.g: BOB=A=PDQ-LOOP=3776 is a line and all symbols will receive the value 3776. b) The PAGE pseudo-op will advance the current location counter to the beginning of the next page in memory. It may not be followed by an argument. c) The PAUSE pseudo-op causes the assembler to take input from the next open input file. d) A fatal error exit will occur when there is symbol table overflow. A message is printed as in PAL III. e) The FIELD pseudo-op will reset the location counter to 200. f) Input can be from any RT-11 supported mass-storage device. There can be up to 5 input files, with the last file being terminated by a '$' and the preceding files being either unterminated or terminated with PAUSE statements. Output can be to any RT-11 supported output device. Input and output file specifications are input via the RT-11 Command String Interpreter (CSI) (see Section 5). g) A symbol table listing can be obtained on PASS 3 by means of the /S CSI switch. (See Section 5). In the symbol table listing, numbers come alphanumerically before letters. Symbols are printed four to a line instead of one to a line. h) Symbol capacity is 5 user defined symbols. i) The character set is the same with the following exceptions: TAB(11) is expanded to an 8 space tab stop on output. FORM-FEED (14) advances the PASS 3 output to the beginning of the next page and causes the page header to be printed. 's are simulated by 4 's if the /F switch option is specified in the CSI command string. Pages are 66 lines long, including 2 lines of page header and 4 lines of simulation PAL8XR X-ASSEMBLER Page 4 6. OPERATING PROCEDURES a) Ensure that the cross assembler file PAL8XR.SAV is resident in the system. b) Start the assembler by typing R PAL8XR if PAL8XR.SAV is on the system disk, or RUN DEV:PAL8XR if it is on a device other than the system disk. The program will respond with an '*'. c) Enter the input and output file specifications by typing the following command string: BINOUTSPEC,LISTOUTSPEC=INFLSPEC1,INFLSPEC2,..../S/F The default file extensions are : Binary output .BI8 Listing output .LS8 Input files .PD8 The file extensions must be included in the command string if they differ from these values. There can be up to 5 input files. If either, or both of the output files are not required, simply omit that file specification from the command string. e.g. if you type: =INFLSPEC1,INFLSPEC2,..... the assembler will only execute PASS 1, which includes a listing of any undefined addresses, illegal instructions etc. The inclusion of the /S option causes the assembler to output a symbol table listing at the end of PASS 3 (if an assembly listing was also requested). The /F option causes 's in the listing file to be simulated by 4 's. d) The assembler will execute the desired passes, and on completion will respond with another '*', at which stage it is ready to accept another command string. e) It will be necessary to re-format the binary output file if it is to be used for PROM programming. Consult the relevant PROM Programmer manual to get the correct format. PAL8XR X-ASSEMBLER Page 5 7. ASSEMBLER OPERATION During PASS 1, the assembler reads the source files and defines all symbols used. All illegal characters read will cause a diagnostic to be printed. If any symbols remain undefined, the undefined address diagnostic is printed with the address of the first occurrence of the symbol. During PASS 2, the assembler reads the source files and generates the binary code using the symbol table defined during PASS 1. The binary file consists of leader, an initial origin setting of 200, datawords, origins and field settings generated from the source files, and is terminated by a checksum and trailer. This file may be punched on paper tape etc, for loading using the PDP-8 Binary Loader. An illegal reference may be diagnosed during PASS 2. If the ASR-33 is being used for binary output, the diagnostic will be both printed and punched but will be preceded and followed by a . The Binary Loader will ignore everything on the files between the rubouts. During PASS 3, the assembler reads the source files and generates the code from the source statements. Each line of the listing file contains the current location counter, the generated code in octal and the source statement. The symbol table is printed at the end of the pass, if requested. PAL8XR X-ASSEMBLER Page 6 8. ERROR MESSAGES a) I/O error messages CSI-F-Device full -- No room on output device, consult the RT-11 System User's Guide for the appropriate corrective action. (e.g. 'squeeze' the existing files on the device, select another device etc). CSI-F-File not found ) Check command for syntax and CSI-F-Illegal command ) spelling errors. If OK, take CSI-F-Illegal device ) appropriate action. CSI - F - INVALID SWITCH OPT -- A switch other than /S or /F was used. Re-enter the command string. READ ERR CHAN # -- Hard error occurred on input. (Input files are assigned to channels 3 to 8 in the order of their occurrence in the CSI command string). Fatal error. WRITE FAILED CHAN # -- Hard error occurred on output. Binary file is assigned to channel 0 and the listing to channel 1. Fatal error. NO PROG TERMINATOR -- All the input data was read without encountering a program terminator ('$'), or no input files were specified in the CSI command string. Fatal error. b) Assembly error messages The assembly errors have the following form: XX YYYY(YY) AT ZZZZ Where XX is the error type YYYY(YY) is the octal code or ASCII label in error, and ZZZZ the location in the user's program where the error occurred. The following error types can occur: ST - Symbol Table overflow. More symbols have been defined than there is room in core for. The YYYY value is meaningless with this printout. No recovery is possible from this error. The user program must be re-written or the cross-assembler re-assembled with a larger symbol table. IC - Illegal character used as a delimeter. The YYYY value is the octal value of the bad character. IR - Illegal reference. An indirect reference was made to a symbol that is not on the current page. A link could not be generated for this word because the indirect bit has already been set. PAL8XR X-ASSEMBLER Page 7 RD - Redefinition of a permanent symbol. A permanent symbol is being redefined using an equate (parameter) assignment. The ZZZZ value is the new value of the symbol. DT - Duplicate Tag. the same symbol is being defined again using a direct assignment. The new value is ignored. UA - Undefined Address (symbol). Reported after PASS 1. The symbol is automatically redefined to a 7402 (HLT). The assembler errors are generally printed during PASS 1, but an 'IR' will be reported during PASS 2. 9. PDP-11 REGISTER USAGE R0 - temporary storage for the character to be output; used for argument transmission during calls to the PDP-11 MACRO library. R1 - pointer to next character to be fetched from input buffer R2 - temporary storage for an ASCII character fetched from the input buffer; used as linkage to one subroutine. R3 - R4 - general register. R5 - general register, and used for subroutine linkage. R6 - stack pointer. R7 - program counter.