-*-TAGS-*-  File: Macro, Node: Top, Up: (DIR)Programming-Systems This INFO node is intended as an aid to MACRO users. Suggestions for improvement will be appreciated. * Menu: * Login procedure: (user)Login Procedure * Introduction:: * Creating and running:: * Listing Your files, * PIP:: * Sample Creation and Run:: * Instructions, * Macro Instructions: (MACFIV)Top * Input/Output Macros: (Macsix)Input/Output Macros * Pseudo Op Codes: (macsix)Directives * Error Codes: (MACFOR)  File: Macro, Node: Creating and Running, Up: top, Next: Pip There are four steps required in order to execute MACRO-11 programs. The first of these is to create the source program using the subsystem of the text editor program TECO, which is called MAKE. The second step is to assemble the source program. The third is to link the assembled object program with any other required object modules into one load module or task. The fourth and final step is to execute this task file. * Menu: * Editing Your Program: (mactec)top STEP 1 * Assembling:: STEP 2 * Linking:: STEP 3 Also called "task building" * Execution:: STEP 4 NOTE: The user must be out of TECO before running the MACRO-11 program.  File: Macro, Node: Assembling, Up: Creating and Running, Next: Linking Assembly is the translation of the source program's mnemonic instructions into the binary/machine-language instructions thatthe CPU is able to execute. If the source program is unable to be translated into binary/machine-language, an error message will be issued. To locate the errors, the user must use the RSTS/E PIP command on the user's source listing program (filename.LST) which is build in some cases of the assembling stage. When this stage is complete, the message "Ready" will be printed on the screen. then the user can continue to the next stage, if no errors have been made. IF ERRORS HAVE BEEN FOUND, you can find what they mean in the node: (MACRO)ERROR Options for the assembling stage: MAC SAMPLE.OBJ,SAMPLE.LST=SAMPLE.MAC ;Simple assembly, producing a binary object file and a source listing file. SAMPLE is the name of the MACRO-11 program filename, so the user should substitute the correct filename of the program the user wishes to run. MAC SAMPLE,SAMPLE=SAMPLE ;Same as above, but the file extensions, so they can be omitted as shown. MAC SAMPLE=SAMPLE ;Assembly with no listing file. MAC SAMPLE,SAMPLE/NL=SAMPLE ;Printing of the symbol table only MAC SAMPLE=$COMMON,[]SAMPLE ;Assembly requires macro definitions included in $COMMON source. The users account number is placed in []. MAC SAMPLE=$COMMON,@SAMPLE ;Same as above, except th ASSIGN command has been used to abbreviate the to "@". MAC SAMPLE,SAMPLE=IO:IOMAC,[]SAMPLE ;Assembly using the input/output macros.  File: Macro, Node: Linking, Up: Creating and Running, Prev: Assembling, Next: Execution Once you have assembled your program, you must link all object modules into one relocatable load module. This is done by a program called the task builder. During task building reference to global symbols (symbols defined outside of a program module) are resolved. When this stage is complete, the message "Ready" will be printed on the screen. After that the user can go to the next stage, if no errors have been made. Options for the Task Building Stage: tKB SAMPLE.TSK=SAMPLE.OBJ ;Default extensions are shown in this example. The user's filename should be substituted for the word SAMPLE. tKB SAMPLE=SAMPLE ;Same as above, without extensions. tKB SAMPLE=SAMPLE,[43,12]IOFILE ;Links the two input modules into one output module. Resolves the references in program to READ and WRITE. tKB SAMPLE=SAMPLE,IO:IO ;Links the program to the input/output macros.  File: Macro, Node: Execution, Up: Creating and Running, Prev: Linking This stage executes the task file, provided no error messages have been issued by the assembling stage or task building stage. Examples: RUN SAMPLE.TSK ;Shows the defaults extension RUN SAMPLE ;Same as above, without extension. NOTE: if any changes are made in the source file, the user must go through the three stages of assembling, linking, and executing again to produce the desired results.  File: MAcro, Node: Pip, Up: Top, Prev: Creating and Running, Next: Sample Creation and Run HOW TO USE THE PIP COMMAND PIP is a general purpose file utility program. it can be used to list programs, for file transfers, changing protection codes, file deletions, etc. For MACRO-11 users, PIP is generally used for listing programs created in TECO and for listing MACRO source listing file to check where errors have occurred. to use PIP, the system must be in the "Ready" mode. Type PIP followed by a space and then the filename followed by the extension and carriage return. This utility program will list the file specified and place the system back into the "Ready" mode. Ready PIP SAMPLE.MAC {listing of MACRO program} Ready PIP SAMPLE.LST {listing of The list file generated by MACRO} Ready Note: If PIP is typed followed by a carriage return , an asterisk (*) will appear. the utility program is asking for the filename of the program the user wants processed. Type the filename with the extension and carriage return, the utility program will list the program. To get out of the utility program type a CONTROL-Z (^Z) nex to the asterisk this will put the user back into the "Ready" mode. Ready PIP * SAMPLE.MAC {listing of MACRO program} * ^Z Ready   File: Macro, Node: Sample Creation and Run, Up: top, Prev: Pip, Note: statements in curly brackets are: {comments} - - - - - - - - - - - - - - - - Ready MAKE SAMPLE.MAC {TECO command to create program} *I .TITLE SAMPLE .CSECT .ENABL LC=. .=4+LC .WORD 6,0,12,0 START: PRINT PRINT PROMPT PROMPT PRINT MOV #472,R3 MOV #101,R2 ADD R2,R3 MOV R3,ANSWER OUTINT ANSWER PROMPT PROMPT INPINT RESULT,ERROR OUTINT RESULT MOV R4,RESULT INPUT BUFLOC,LENBUF, OUTCHR BUFLOC,LENBUF ANSWER: .BLKW 1 RESULT: .BLKW 1 ERROR: .BLKW 1 BUFLOC: .BLKB 64. LENBUF: .BLKW 1 .END START $$ {Press the Escape key twice ( do not "HIT" it or you could force a spurious "BREAK" which could lose your typing for you) } *EX$$ {Letters 'EX' followed by ESC-ESC} Ready MAC SAMPLE,SAMPLE=IO:IOMAC,[4,117]SAMPLE {Assembling Stage} Ready TKB SAMPLE=SAMPLE,IO:IO {Task building Stage} Ready RUN SAMPLE {Execution Stage} HELLO HOW ARE YOU? I'M FINE. JUST FINE. 379 ENTER AN INTEGER ?> 77 {Enter the integer 77} 77 ENTER YOUR NAME: JOHN DOE {Enter John Doe} JOE DOE ?Odd address trap 000000 000000 000101 000573 000000 000000 002002 000004 Ready PIP SAMPLE.LST {Source listing} COMMON COMMON DEFINITIONS MACRO M111 04-Jul-81 09:55 Page 22 1 2 .TITLE SAMPLE 3 000000 .CSECT 4 .ENABL 5 000000' LC=. 6 000004' .=4+LC 7 000004 000006 000000 000012 .WORD 6,0,12,0 000012 000000 8 000014 START: PRINT 9 000030 PRINT 10 000054 PROMPT 11 000074 PROMPT 12 000114 PRINT 13 000124 012703 000472 MOV #472,R3 14 000130 012702 000101 MOV #101,R2 15 000134 060203 ADD R2,R3 16 000136 010367 000146 MOV R3,ANSWER 17 000142 OUTINT ANSWER 19 000176 PROMPT 20 000206 INPINT RESULT,ERROR 21 000216 OUTINT RESULT 22 000224 010467 000062 MOV R4,RESULT 23 000230 INPUT UFLOC,LENBUF, ;line continued only by wraparound 24 000266 OUTCHR BUFLOC,LENBUF 25 000310 ANSWER: .BLKW 1 26 000312 RESULT: .BLKW 1 27 000314 ERROR: .BLKW 1 28 000316 BUFLOC: .BLKB 64. 29 000416 LENBUF: .BLKW 1 30 000014' .END START ^C {Getting out of PIP before symbol table is printed with a CONTROL-C} Ready  TAGS: :SGAT Top:15 Creating and Running:476 Assembling:1236 (MACRO)ERROR:1948 Linking:3005 Execution:4051 Pip:4589 Sample Creation and Run:6031