home *** CD-ROM | disk | FTP | other *** search
/ Top-Magazin 1994 December / Top_Magazin_1994_12_Kaisersoft_de_Side_B_a.atr / mae.arc / MONITOR.DOC < prev    next >
Text File  |  1993-11-19  |  13KB  |  1 lines

  1. Monitor version .8 beta.¢¢     General:¢¢Note: 24 bit support, and the full 65816 instruction set are not completed¢yet.¢¢Filenames default to the current drive number which can be changed.¢(input of 'FILE' = 'D1:FILE')  A full filespec will override the default.¢¢Non destructive prompt character (.) for ease in full screen editing.  Also,¢the prompt does not interfere with command decoding.  If the cursor is moved¢up to redo a prior command, the '.' does not need to be deleted.¢¢Upper and Lower case accepted.¢¢Continuous memory displays can be stepped one line at a time with the space¢bar.  Press 'C' to return to continuous display.  ESC, RETURN, or BREAK will¢stop the display.¢¢ALL addresses and data bytes can be entered in HEX (default), in DECIMAL with¢# (#1234), in binary with % (%10011010), in ASCII with ' ('A) or as a label¢currently defined in the MAE symbol table with .  (.LABEL).  Arithmetic¢operators +-*/&! can also be used, and will be performed left to right.  Any¢combination of these can be mixed at any time in a completely free format¢scheme, with no limits on length.  (Ex:  2000-#256+'W/100) Very little will¢be mentioned about this feature later on, but ALL numbers for ALL commands¢accept this versatile entry system.¢¢All commands use spaces as delimiters.  A '?' indicates a command error.¢Parameter uses for commands are abbreviated to:¢¢adr:  a 16 bit address.¢by:   an 8 bit byte. ('by' with numbers indicates a string of bytes.)¢bit:  a 0 or a 1.¢char: an ASCII character.¢Quantities in [brackets] are optional parameters.  Default values will be¢used if they are not entered.  All non-bracketted values must be entered.¢Any other upper case characters or symbols should be entered as stated.¢¢'Current address' refers to the last displayed or changed address, (plus¢one), and is separate from the current program counter or PC.¢¢     COMMANDS:¢¢          Display Memory.     M [adr] [adr][/]¢Displays hex and ASCII.  Displays 24 locations if only 1 parameter.  Displays¢from current adr if no parms.  '/' = to $FFFF.  The '/' can be used on all¢other commands as well.  Does not display ASCII control characters when¢output is being sent to an external device.¢¢          Peek Memory.        P adr1 [adr2..] [*]¢Special memory display that allows multiple addresses to be entered, and only¢prints one byte per address.  * causes continuous print of list of addresses.¢Push Break to abort.¢¢          Disassemble D [adr]¢Disassembles memory starting at adr, or the current adr if not entered.  If¢MAE is resident, the assembly code can be modified using normal screen¢editing.  Single line assembly can be started from scratch by typing,¢"-adr ." followed by an assembly mnuemonic.  (The '.' is necessary).  From¢the single line assembler, you may enter '*' as the first mnuemonic character¢to continue disassembly from that address forward.¢¢          Change Memory.      :adr by1 [by2..by8]¢The change memory command ':' can be entered directly, or edited from the¢display memory command.  Only 8 data bytes will be changed.¢¢          ASCII Mem Change    C adr ASCII STRING¢Stores ASCII string at adr.  Addresses for both change memory commands may¢use * for current address.  (ex.  C 1000 COMPUTER.  :* 9B.) The second¢command will put a CR after the ASCII string.¢¢          Display Registers   R¢Displays 6502 registers in this form:¢ ,A  X  Y  NV-BDIZC SP¢ ;AB 5D FA 10110001 FF 7014 LDA #$00¢¢          Change Registers    ; register bytes¢Supports screen editing of R command.  Status flags can be modified in bit¢form.  When entering values directly, a comma will skip to the next register,¢and you don't need to enter all the values.  EX:  ';55' will change the A¢register to 55.  ';,,20' will change Y to 20.¢¢          Goto                G[S] [adr] [*brkpt] [C by] [r by] [Pf bit]¢Run program at adr, or PC if not entered.  At any time during execution, the¢Break key will return to the monitor and display the current registers and¢PC.  Use the 'S' option to run code that ends in an RTS.  (Note:  When using¢the S option, the PC adr in the register display on return is an internal¢address, not the address where the actual RTS or RTI occurred.)¢¢A breakpoint will create a return point to the monitor whenever a particular¢address or condition is reached.  *brkpt will place a 00 (BRK) at the¢breakpoint address.  For this reason, breakpoints can not be used for¢programs in ROM.  A '?' will be printed in this case.  The breakpoint must¢also be set at an opcode rather than an operand location so that it will¢execute.  The rest of the parameters add conditions to the breakpoint.¢¢C + by Counts the number of times the breakpoint is reached.  Execution¢continues until the BRK is passed the specified number of times.  Breakpoints¢can also test for specific conditions by specifying (r) reg name and (by)¢byte it must contain in order to BRK.  Processor flags can also be tested by¢'P' + flag character + (bit) for condition.  Use the flag characters as in¢the register display.¢¢The breakpoint will be skipped over until the specific condition is reached.¢When both count and condition options are used, the count will apply to the¢number of times the condition is met.  Execution speed will be slightly¢slower than real time in this mode.  Actual speed will depend on how often¢the program is interrupted to check conditions.¢¢NOTE:  A peculiar bug in the ATARI hardware causes breakpoints to be¢intermittenly skipped over.  When the BRK interrupt occurs, the program¢counter+2 is pushed on the stack, but instead of jumping through the¢interrupt vector, the OS will occasionally just return to the program at¢PC+2.  This is usually a very rare occurrance, but can happen more often when¢using conditional breakpoints on very small and quick loops, thus BRK¢interrupts are occurring very rapidly.  It took many years before I was able¢to really understand what was going on, and be assured that the problem was¢indeed in the computer, and not a bug in the monitor.¢¢ADDITIONAL NOTE: This bug does not occur on the '816 processor!  Yeeeehaaa!¢(Thanks John.)¢¢     Go command examples.¢G 2000          = Run program at $2000¢G 4000 *4124    = Run at $4000, and break at $4124¢G *3100 A'Q     = Run at current PC and break at 3100 when A register¢                  equals ASCII 'Q'¢G *4200 C10 PZ1 = Run at PC and break at 4200 the 16th time the zero¢                  flag is set¢¢          Remove Breakpt      *¢Brkpts remove themselves, and replace what was there when the BRK is¢executed.  However, in case the program stops at other than the brkpt, * will¢remove it.  This can occur when the Break key is pressed, conditional or¢count values are not reached, or when the BRK is set in an operand rather¢than an opcode.  Setting a new brkpt with the G command will also remove an¢unused BRK.¢¢          Exit to DOS         X¢¢          Return to Assembler A¢¢          Fill Memory         F adr1 adr2 [by1] [by2 by3...]¢Fill memory with 0 if no data bytes.  Otherwise enter 1 byte, or a sequence¢of any number of bytes to fill with.¢¢          Transfer Mem        T adr1 adr2 adr3¢Move memory from adr1 through adr2 to adr3.  Handles overlapping moves.¢¢          Hunt for chars      H adr1 adr2 by1 [by2...][!]¢          Hunt for String     H adr1 adr2 'ASCII string [!]¢Hunt memory for ASCII string or string of hex bytes up to length of 60.  Use¢'!' for a wild card to match anything.  Realize the number entry system will¢let you search for things like "A9 'A", (as in LDA #'A), but not the reverse¢of this.  Entering "'A A9" will put the hunt into full ASCII form, and search¢for the literal string that you typed in.  The second example can actually be¢entered in the form "! 'A A9", using a wild card to avoid the initial '¢identifier.  For one more example, let's say you wanted to search for a JSR¢to a MAE defined label.  This can be entered as "20 .LABEL .>LABEL".¢¢          Change wild card    % char¢Change the wild card for the Hunt command to 'char'.  This is used in case a¢character in the search string is '%' or HEX 25.¢¢          Compare mem         K adr1 adr2 adr3¢Compare memory from adr1 to adr2 with memory starting at adr3.  Displays all¢addresses with differences.¢¢          DEC to HEX          # decimal number [no2...]¢          HEX to DEC          $ by1 [by2...]¢Displays hex values of a string of decimal numbers and vice versa.¢¢          Change Output       O [filespec]¢Send output to screen and filespec.  O by itself returns to just screen¢output.  Default drive processing is not done on this command.  Full¢filespecs must be entered for disk files.  Because of this, other devices do¢not need a ':'.  ('O P' is sufficient to send output to printer)¢¢          Re-open Editor IOCB     E¢This is useful for returning to the text screen from a graphics mode, or¢80-column display, or to reset the screen after changing RAMTOP.  The other¢IOCB's used are:  #3 disk reads, #4 disk writes, and #6 external output.¢¢          Query MAE symbol table  Q adr¢                                        (Sorry, I was running out of letters)¢Search the current symbol table for a label that matches the value entered¢for adr.  If found, the label will be printed.  This is basically the reverse¢procedure for symbol table lookup, and as such will only work well when the¢requested value has only one label associated to it.¢¢          Trace Instr         I [adr]¢Traces program an instruction at a time.  Automatically traces OS calls¢(including jumps with implied return) as one step.  Trace normally works on¢programs in ROM, except 'G' and 'R' options as noted below.  After each step,¢the monitor will wait for one of the following keypresses to control the¢tracing mode:¢¢Space - Steps one instruction at a time.¢C     - Continuous trace.¢D     - Disassemble next instructions.  Useful for previewing code that¢        you are about to step through.  The program counter will remain¢        at its current location.¢G     - Execute all instructions up to current 'D' command listing.  Use¢        to quickly execute loops or other structures.  First use 'D' to¢        find a spot past the structure, then 'G' will execute everything¢        up to that point.  This command puts a Breakpoint at the end¢        position, and therefore cannot be used if the program is in ROM.¢S     - Execute entire subroutine as one step.¢R     - Return from subroutine.  Use this command if you are already in a¢        subroutine, and wish to return to the previous level.  A BRK will¢        be placed at the instruction the subroutine returns to, and¢        therefore cannot be used for programs in ROM.¢P     - Peek the value of the operand of the current instruction.¢Q     - Perform a Q monitor command on the operand of the current instruction.¢        If the operand value is defined in the current MAE symbol table, the¢        label name will be printed.  You can use this on JMP, JSR and branch¢        intructions to get an idea where you're going, and also on any memory¢        references that have you thinking, "What the heck is *that*?"¢U     - Execute the user function.¢X     - Ignore instruction.  Skip to the next one without executing.¢ESC, RETURN, or BREAK exits trace mode.¢¢          Change Default Drv  / 1-8¢All default drive accesses change to drive number entered, including uses in¢the assembler section.  The starting default drive number will be the same as¢the current SpartaDOS drive.¢¢          Binary Load         L [@adr][-adr] filename¢Load DOS II binary file where it was saved, or at @adr if entered.  Prints a¢'?' if the file is not DOS II format.  Loads appended files, but @adr only¢works on 1st part.  -adr loads raw data with no header using a straight CIO¢transfer.  Both PC and default address are set to the load address.¢¢          Binary Save         S [-]adr1 adr2 [@adr3] [+]file¢Save DOS II binary file from adr1 to adr2.  If @adr3 is entered, it will be¢used as the header allowing the file to load in at a different address than¢where it was saved.  Use '-' for a CIO save without header.  If + is entered,¢append to existing file.¢¢          Directory           V [name or spec]  (Sorry, I *am* out of letters)¢Displays disk directory.  Default of Dn:*.*.  A filespec of D2: = D2:*.*¢¢          Sector Read         R adr sector# [ending sector]¢          Sector Write        W adr sector# [ending sector]¢Direct sector I/O to default drive.  Reads single and double density disks¢automatically including single density sectors 1-3 of a DD disk.¢¢          Hex Arithmetic      ? by1(+-*/&!)[by2..]   (no spaces)¢Prints hex and decimal values of expression evaluated left to right.¢Can also be used for ASCII convert. (?'A)¢¢          User Function       U [adr1] [adr2] [adr3]¢Accepts up to 3 parameters, which will be stored at $F0, $F2, and $F4.  $F2¢and $F4 will be 0 if not entered, while $F0 will have the current address if¢not entered.  In addition, the carry flag will be set if no parms.  Then¢jumps to the end address of the monitor-3.  ($BBFD in top of RAM version)¢User function expects an RTS return.¢