OBJECT TO MACRO CONVERSION (ORC) Version: V01.1/3-AUG-79 1. INTRODUCTION ORC is a utility which converts PDP-11 object code to MACRO-11. Its uses include: * checking code produced by compilers * on-line debugging of code produced by a compiler which does not give an assembly listing (eg. CORAL). For ORC to produce sensible output, the object code should have data and instructions in separate program sections with D and I attributes respectively. The object code produced by the CORAL and F4P compilers satisfy this requirement. The F4P compiler produces its branch instructions after it has produced the other object code which may look a little strange, but is in fact correct MACRO-11 code. The threaded code produced by the FORTRAN compiler (FOR) is not suitable for conversion to MACRO-11. The MACRO-11 code produced by ORC can be assembled in the usual way to produce an assembly listing. 2. USING ORC When the task is initiated it issues a prompt and receives a command line of the form: ORC>*outputfilespec=inputfilespec The usual RT-11 conventions for file specifications apply. No switches are allowed in the command line. If the extension is not supplied in a file specification, it is assumed to be: .OBJ for the input file .MAC for the output file ORC converts the object code in the input file into MACRO-11 and writes it to the output file. The MACRO-11 file can then be assembled in the usual way to produce an assembly listing. During processing, ORC allocates a temporary file (ORC.TMP). If ORC is aborted, this file should be deleted. ORC uses in-core tables to store local symbols, labels, global -1- OBJECT TO MACRO CONVERSION (ORC) symbols, and program section names. These can hold up to: * LLLMAX local symbols * LABMAX local labels * GLOMAX global symbol definitions * PSEMAX program section names This should be enough for most object files, but the first three of these tables can be extended by modifying the file ORCMAC.MAC and rebuilding the program. Local labels are used when referring to locations within the same (instruction) program section. They are of the form n$ where n is the location of the label. Example: MOV R0,R1 BEQ 6$ CLR (R0) 6$: INC R1 Local symbols are used when referring to locations within other program sections, or within the same program section if it contains data. They are of the form xn, where x is a letter (A, B, C,...) defining the program section and n is the location of the symbol within the program section. Example: .PSECT DATA,D C00000: .WORD 0 C00002: .WORD C00000 ; .PSECT INSTR,I MOV #C00002,R0 In certain circumstances, ORC may reference symbols which are not defined. The positions of these symbols can be determined from their names. 3. ERROR MESSAGES ORC -- COMMAND I/O ERROR An I/O error ocurred during input of the command line, or a bad indirect command file name was specified, or indirect command files were nested. ORC -- SYNTAX ERROR A syntax error was detected in the input line. ORC -- BAD INPUT FILE SPEC ORC -- BAD OUTPUT FILE SPEC A switch was specified or 'wildcards' were used in the file specification. -2- OBJECT TO MACRO CONVERSION (ORC) ORC -- OPEN FAILURE ON xxxxxx FILE ORC -- I/O ERROR ON xxxxxx FILE ORC -- FAILED TO CLOSE xxxxxx FILE These errors may be caused for a variety of reasons, eg. device offline, device full, privilege violation, file does not exist. The message specifies whether the error ocurred on the INPUT, OUTPUT or SCRATCH file. ORC -- PSECT TABLE OVERFLOW Only PSEMAX program sections are allowed in one object file, including the absolute (. ABS.) and blank PSECTs. This number can be increased by editing ORCMAC.MAC and rebuilding ORC. ORC -- LABEL TABLE OVERFLOW Only LABMAX local labels are allowed in one object file. This number can be increased by editing ORCMAC.MAC and rebuilding ORC. ORC -- LOCAL SYMBOL TABLE OVERFLOW Only LABMAX local symbols are allowed in one object file. This number can be increased by editing ORCMAC.MAC and rebuilding ORC. ORC -- GLOBAL SYMBOL TABLE OVERFLOW Only GLOMAX global symbol definitions are allowed in one object file. This number can be increased by editing ORCMAC.MAC and rebuilding ORC. 4. GENERATING ORC The following files are contained in the distribution kit: * ORC.COM - command file for compiling and linking * ORC.DOC - user document * MACRO-11 source files The object code uses instructions (such as SOB and ASH) which are only supported on PDP-11/35 computers and upwards.