Macro Examples ************** Presented here are four examples of macros designed to better aquaint you with the features of ReSource. These macros can be found in the file "S/RS.macros" on the ReSource distribution Disk 1. If you have this file in the S: directory, it will be automatically loaded when you run ReSource. Otherwise, you will need to load the file using the "LOCAL MACROS/Load macros" function, and entering the path where this file may be found. After the macros are loaded into ReSource, you will find them in the "GLOBAL MACROS" menu. ReSource's default execution speed for macros will be too fast for you to properly see the self-documenting messages that these macros display before they scroll away. In order to see the messages, slow the macro execution speed by using the "LOCAL MACROS/Execution speed/Very slow" or "LOCAL MACROS/ Execution speed/Wait on mouse" function. If you choose "Very slow", the macros will execute approximately one function per second. If you would like even more control over macro execution, choose "Wait on mouse". ReSource will wait for you to press the left-mouse-button before executing the next macro function. In each of the example macros below, the macro functions are listed one per line. If a function takes a string argument, it will be found either on the right, or on the next line and indented. The first three macros disassemble ARP programs. In order for them to work properly, the programs MUST be from ARP release V39.1. All three programs can be found, and are assumed to be, in "ReSource:c" on the ReSource distribution Disk 1. The macros will load the programs for you; no need to load them into ReSource first. After completion of each macro, you may select the "Print file" macro if you wish a hardcopy listing of the disassembly. This macro will send its output to the PRT: device. Example Macro #1: Disassemble ARP 'Stack' ========================================= This macro will load, disassemble and comment ARP release V39.1 of the 'Stack' program. PROJECT/Open load file 'ReSource:c/Stack' OPTIONS 2/Multiple constants/Off OPTIONS 1/DCB statements/OFF LABELS/Create single/Label 'Stack' LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'OpenArp' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Execution begins here' CURSOR/Relative/Next line * 1 SYMBOLS 2/Q-R/ResidentTag LABELS/Edit single/Full-line comment 'Arp uses this word to recognize other arp programs' CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Longs LABELS/Create single/End-of-line comment 'Desired stacksize' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Desired data size' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Save cmd line parameters' CURSOR/Relative/Next line * 1 LABELS/Edit single/Symbol 'AbsExecBase' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'ArpName' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Min version for this program' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Open arp.library' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Did it open?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'OK_Go' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Branch if yes' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'DosName' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'If arp didn't open,' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'try and open dos.' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Dos always opens. Right?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label '1$' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Branch if no' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Got dos, move to base reg' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Try to get stdout' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Branch if not available' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'alibmsg' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Get msg to write' CURSOR/Relative/Next line * 2 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Length of msg' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Complain bitterly' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Clean up stack' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'and exit.' CURSOR/Relative/Next line * 5 LABELS/Create single/End-of-line comment 'Move arpbase to base reg' CURSOR/Relative/Next line * 1 LABELS/Edit single/Symbol 'AbsExecBase' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Get ptr to our task ctrl block' CURSOR/Relative/Next line * 1 SYMBOLS 2/Prf-Pz/Process structure LABELS/Create single/End-of-line comment '0=WBench, else CLI' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'FromCLI' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Stack MUST be run from the CLI' CURSOR/Relative/Next line * 2 SYMBOLS 2/Q-R/Return codes LABELS/Create single/End-of-line comment 'else, return to caller.' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Convert BCPL to LONG' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'and save for later.' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Retrieve cmd line' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'Help.msg' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'User help msg' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Get arg space from stack' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'Template' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Cmd format template' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP LABELS/Create single/End-of-line comment 'Process cmd line' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Retrieve ptr to CLI structure' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Was there a cmd line error?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'BadArg.msg' CURSOR/Absolute/Previous location LABELS/Create single/Label 'BadArgs' CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP LABELS/Create single/End-of-line comment 'Complain bitterly' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'BadExit' SYMBOLS 2/Q-R/Return codes LABELS/Create single/End-of-line comment 'Bad return code' CURSOR/Relative/Next line * 1 SYMBOLS 2/H-I/IO errors LABELS/Create single/End-of-line comment 'Invalid args' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'Exit' CURSOR/Absolute/Previous location CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'and exit.' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'NoArgs' SYMBOLS 2/C/CLI structure LABELS/Create single/End-of-line comment 'Get current stack size' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Convert BCPL to LONG' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Use stack for arg' CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'CurStack.msg' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Get format string' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP LABELS/Create single/End-of-line comment 'and print it!' CURSOR/Relative/Next line * 1 SYMBOLS 2/Q-R/Return codes LABELS/Create single/End-of-line comment 'Good exit' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'Even though ArpExit is called with a JSR, it' LABELS/Edit single/Full-line comment 'cleans up the stack internally, and does NOT return.' LABELS/Edit single/Full-line comment '; ' CURSOR/Absolute/Previous location LABELS/Create single/End-of-line comment 'Just show current size' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP LABELS/Create single/End-of-line comment 'Convert cmd line arg to LONG' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Badly formed number' CURSOR/Absolute/Forward reference LABELS/Create single/Label 'BadNum' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference SYMBOLS 1/Libraries/ARP LABELS/Create single/Label 'PutMsg' CURSOR/Absolute/Previous location CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Minimum stack size' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Arg was too low' CURSOR/Absolute/Forward reference LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'Suggested.msg' CURSOR/Absolute/Previous location LABELS/Create single/Label 'TooSmall' LABELS/Create single/End-of-line comment 'Advise user' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Convert from LONG to BCPL' CURSOR/Relative/Next line * 1 SYMBOLS 2/C/CLI structure LABELS/Create single/End-of-line comment 'Store new value' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'and exit' CURSOR/Absolute/Forward reference LABELS/Create single/Label 'GoodExit' CURSOR/Absolute/Start of file Example Macro #2: Disassemble ARP 'CD' ========================================= This macro load, will disassemble and comment ARP release V39.1 of the 'CD' program. OPTIONS 2/Multiple constants/Off PROJECT/Open load file 'resource:c/cd' LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Start executing here!' CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Code LABELS/Create single/Full-line comment 'ARP resident looks for this to recognize other ARP programs' CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Longs LABELS/Create single/End-of-line comment 'Default stack size useed by ARP "Resident"' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Store CmdPtr and CmdLen' CURSOR/Relative/Next line * 1 LABELS/Edit single/Symbol 'AbsExecBase' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Prepare to open ARP library' CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Minimum version number' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Open ARP library' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Did ARP open okay?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'branch if opened okay' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/Full-line comment 'Only executed if ARP not available' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Open DOS library' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Have we got DOS library base in D0?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Branch if not (Panic!!)' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Place DOS library base into A6 register' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Get StdOut handle' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'This will be our file handle for Write' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'If not StdOut, exit immediately' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'The message to display' CURSOR/Relative/Next line * 2 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Length of message to show' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Show "you need arp.library V39+"' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Fix up stack' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Get our of here!' CURSOR/Relative/Next line * 5 LABELS/Create single/Label 'ArpOpenedOkay' LABELS/Create single/End-of-line comment 'Put ARP library base into A6' CURSOR/Relative/Next line * 1 ELS/Edit single/Symbol 'AbsExecBase' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/Full-line comment 'Actually, this will be a ptr to our process also' CURSOR/Relative/Next line * 1 SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Branch if we were run from CLI' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Executed only if from WorkBench' CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal SYMBOLS 2/Q-R/Return codes CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Convert BPTR to APTR' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Restore CmdLen and CmdPtr' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP LABELS/Create single/End-of-line comment 'Get ARP to collect arguments' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Ptr to Command Line Interface' CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 5 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 8 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 4 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 4 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Previous line * 1 SYMBOLS 2/K-L/Lock type CURSOR/Relative/Next line * 5 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Previous line * 1 SYMBOLS 2/Q-R/Return codes CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 5 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal SYMBOLS 2/Q-R/Return codes CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP DISPLAY/Fill-in data types CURSOR/Absolute/Start of file Example Macro #3: Disassemble ARP 'Sort' ========================================= This macro will load, disassemble and comment ARP release V39.1 of the 'Sort' program. OPTIONS 2/Multiple constants/Off PROJECT/Open load file 'resource:c/sort' */DOS command 'date >ram:rste%mpfile' STRINGS/Get/File 'ram:rste%mpfile' STRINGS/Edit functions/Clip end 10 STRINGS/Edit functions/Prepend 'Disassembled ' LABELS/Create single/Full-line comment 27,27 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Execution starts here' CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Code LABELS/Create single/Full-line comment 'ARP resident looks for this to recognize other ARP programs' CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Longs LABELS/Create single/Full-line comment 'Default stack size used by ARP "Resident"' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'Store CmdPtr and CmdLen' CURSOR/Relative/Next line * 1 LABELS/Edit single/Symbol 'AbsExecBase' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Prepare to open ARP library' CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Minimum version number' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Open ARP library' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Did ARP open okay?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'branch if opened okay' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/Full-line comment 'Executed only if ARP library not available' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'Open DOS library' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Have we got DOS library base in D0?' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Branch if not (Panic!!)' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Place DOS base into A6 register' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Get StdOut handle' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'This will be our file handle for Write' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'If not StdOut, exit immediately' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'The message to display' CURSOR/Relative/Next line * 2 DISPLAY/Set Numeric base/Decimal LABELS/Create single/End-of-line comment 'Length of message to show' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Create single/End-of-line comment 'Show "you need arp.library V39+"' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Fix up stack' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Get out of here!' CURSOR/Relative/Next line * 5 LABELS/Create single/Label 'ArpOpenedOkay' LABELS/Create single/End-of-line comment 'Put ARP library base into A6' CURSOR/Relative/Next line * 1 LABELS/Create single/End-of-line comment 'Restore CmdLen and CmdPtr' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref LABELS/Create single/End-of-line comment 'Prepare args for GADS()' CURSOR/Relative/Next line * 1 DISPLAY/Set Numeric base/Decimal LABELS/Create single/Full-line comment 'Clear a table of 20 longwords for GADS to use' CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Previous line * 1 LABELS/Create single/Label 'ClearLoop' CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'HelpfulMessage' CURSOR/Absolute/Previous location CURSOR/Relative/Previous line * 5 CURSOR/Absolute/Forward reference LABELS/Create single/Label 'OurTemplate' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 6 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'ShowUsageMsg' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Previous line * 2 LABELS/Create single/Label 'EXIT' CURSOR/Relative/Previous line * 6 CURSOR/Absolute/Previous location CURSOR/Relative/Previous line * 1 SYMBOLS 2/Q-R/Return codes CURSOR/Absolute/Previous location CURSOR/Relative/Previous line * 3 LABELS/Create single/Label 'ShowUsage' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference CURSOR/Relative/Next line * 1 LABELS/Edit single/Symbol 'AbsExecBase' LABELS/Create single/End-of-line comment 'Get exec library base' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 1 SYMBOLS 1/Set field/Second SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'T.Device.Msg' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'TempFileName' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 4 LABELS/Create single/Full-line comment 'The following is a new ARP call (undocumented at time of macro creation!)' CURSOR/Relative/Next line * 3 SYMBOLS 2/E-G/File open parms CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'BadNumber' CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 CURSOR/Absolute/Forward reference LABELS/Create single/Label 'ShowError' CURSOR/Relative/Next line * 2 CURSOR/Absolute/Forward reference LABELS/Create single/Label 'ErrorExit' CURSOR/Absolute/Previous location CURSOR/Absolute/Previous location CURSOR/Relative/Previous line * 2 CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 5 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Previous line * 1 SYMBOLS 2/K-L/Lock type CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 6 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 SYMBOLS 2/E-G/FileInfoBlock CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 2/E-G/File open parms CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 6 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 4 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 8 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 7 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 7 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 2/E-G/File open parms CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 4 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 SYMBOLS 2/Q-R/Return codes CURSOR/Relative/Next line * 1 LABELS/Create single/Label '_EXIT' CURSOR/Relative/Previous line * 4 CURSOR/Relative/Next line * $14 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * $17 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 5 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * $0D LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 2 SYMBOLS 2/Prf-Pz/Process structure CURSOR/Relative/Next line * 5 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 9 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/ARP CURSOR/Relative/Previous line * 4 CURSOR/Absolute/Forward reference CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 7 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Absolute/Forward reference LABELS/Create single/Label 'CompareStringLoop' CURSOR/Absolute/Previous location CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 1 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * $0B LABELS/Create single/Label - fwd ref CURSOR/Relative/Previous line * 1 LABELS/Create single/Label 'StringEndLoop' CURSOR/Relative/Next line * 4 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 2 LABELS/Create single/Label - fwd ref CURSOR/Relative/Next line * 3 LABELS/Create single/Label - fwd ref DISPLAY/Fill-in data types CURSOR/Absolute/Start of file Example Macro #4: Disassemble BOOT sector ========================================= This macro will disassemble and comment the boot sector of the disk in drive DF0:. PROJECT/Read tracks 'df0: 0 0 2' DISPLAY/Set data type/ASCII CURSOR/Relative/Next byte * 4 DISPLAY/Set data type/Longs CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Longs CURSOR/Relative/Next line * 1 DISPLAY/Set data type/Code LABELS/Create multiple/All DISPLAY/Fill-in data types CURSOR/Absolute/Start of file LABELS/Edit single/Full-line comment 'The first longword of a DOS disk is "DOS" followed by hex 0,' LABELS/Edit single/Full-line comment 'or hex 1 if formatted using fast filesystem' CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'The second longword of a bootable boot sector is the checksum' CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'I'm not quite sure what the next longword is used for' CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'If the first longword is "DOS", followed by hex 0, and' LABELS/Edit single/Full-line comment 'the checksum is correct for the current boot sector contents,' LABELS/Edit single/Full-line comment 'when you boot on the disk, control is passed to offset $0C, HERE' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/Exec LABELS/Create single/End-of-line comment 'is DOS still around?' CURSOR/Relative/Next line * 2 LABELS/Create single/End-of-line comment 'branch if no DOS around' CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'place DOS base into A0' CURSOR/Relative/Next line * 1 SYMBOLS 1/Libraries/DOS LABELS/Edit single/Full-line comment 'We MUST place the version number of DOS into A0 if we plan to boot properly' CURSOR/Relative/Next line * 1 LABELS/Edit single/Full-line comment 'when we return to Kickstart, D0 must be zero if the disk is to be booted' CURSOR/Relative/Next line * 2 LABELS/Edit single/Full-line comment 'Something is wrong!! Don't boot on this disk!' CURSOR/Relative/Previous line * 1 CURSOR/Absolute/Start of file OPTIONS 1/DCB statements/ON OPTIONS 1/DCB statements/OFF