home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / sim.lha / sim.doc < prev    next >
Text File  |  1989-06-21  |  93KB  |  2,723 lines

  1.  
  2.  
  3.  
  4.  
  5. -------------------------------------------------------------------------------
  6.  
  7.         *******      ****         ******        *     *          *******
  8.          * * *      **  **          **          **   **           * * *
  9.           *****     ***             **          *** ***          *****
  10.            * *       ***            **          *******           * *
  11.             ***        ***          **          ** * **          ***
  12.              *      **  **   **     **     **   **   **   **      *
  13.               *      ****    **   ******   **   **   **   **     *
  14.  
  15.  
  16.                            System-Independent Monitor
  17.                Copyright ⌐ by Stefan Walter, ALL RIGHTS RESERVED
  18.  
  19. -------------------------------------------------------------------------------
  20.  
  21.  
  22.  
  23.               The User Manual, refering to version 1.51 of S.I.M.
  24.                       Released on the 27th of January 1991
  25.  
  26.  
  27.  
  28.  
  29.                                  --------------
  30.                                  READ IT OR DIE
  31.                                  --------------
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.                                     CONTENTS
  39.                                     ========
  40.  
  41.  
  42.  1. Introduction
  43.          1.1  Welcome to SIM
  44.          1.2  About this Documentation
  45.  
  46.  2. Getting aquainted with SIM
  47.          2.1  What is SIM?
  48.          2.2  Qualifications, Requirements and Limitations
  49.          2.3  The SIM Program
  50.  
  51.  3. Some words about...
  52.          3.1  The Display
  53.          3.2  Breakpoints
  54.          3.3  Trace
  55.          3.4  The Keyboard
  56.          3.5  Disk Access
  57.          3.6  Files
  58.          3.7  Breaking
  59.          3.8  The Actual Address
  60.          3.9  The Matchbuffer
  61.          3.10 Command History
  62.          3.11 Traps
  63.          3.12 Functionkeys
  64.          3.13 SIM and the Hardware
  65.  
  66.  4. Communication between YOU and SIM    
  67.          4.1  The SIM Environement
  68.          4.2  The Monitor
  69.          4.3  The Commands and Their Syntax
  70.          4.4  The Debuger Window
  71.          4.5  Debugger Window Shortcuts
  72.  
  73.  5. Additional Information
  74.          5.1  Assembler and Calculator Syntax
  75.          5.2  Line Forms
  76.          5.3  The Debug Server Entrance
  77.          5.4  The SIM Base
  78.          5.5  Errors
  79.  
  80.  6. Greetings, Thanks, Support and about Future Releases
  81.          6.1  Thanks
  82.          6.2  Greetings
  83.          6.3  Support
  84.          6.4  About Future Releases
  85.  
  86.  
  87.  
  88.  
  89.  
  90. *******************************************************************************
  91.  1. Introduction
  92. *******************************************************************************
  93.  
  94.  
  95.  
  96.  1.1 Welcome to SIM
  97.  ==================
  98.  
  99.  
  100.   Congratulations dear user. You have just become owner of the second release
  101.   of 'S.I.M.', the high performance monitor and debugger for the Commodore
  102.   Amiga, probably the best, the mightiest and the only of its kind.
  103.  
  104.   Version 0.50 of 'S.I.M.' was freeware. This version of 'S.I.M.' is now a
  105.   shareware program. This means that it can be used, copied and distributed
  106.   freely, provided that:
  107.  
  108.     1)   No fee is charged for copying and distribution.
  109.     2)   It is distributed ONLY in its original, unmodified state.
  110.     3)   This document is copied along with the program.
  111.  
  112.   If you don't respect these three rules I wish you all the bad things you'd
  113.   wish somebody that steals, adds to or misuses something created by yourself
  114.   in hours of hard work. So be fair! Only happy programers are good
  115.   programers.
  116.  
  117.   If you copied this version from somebody else and you like it and keep using
  118.   it, you should send me (if you did not yet) 20 SFr or 20DM or 15$ (well, 1g
  119.   gold or half a barrel of oil will also be accepted) shareware fee. This has
  120.   for you the advantage that I will send you the final version on another disk
  121.   as soon as it's finished.
  122.  
  123.  
  124.   Note: The entire risk of using SIM is to the user himself. In NO event
  125.         will the author be liable for direct or indirect damage or loss
  126.         resulting from the use of this program.
  127.  
  128.  
  129.  
  130.  1.2 About this Documentation
  131.  ============================
  132.  
  133.  
  134.   There exist two very good reasons why you must at least have a look at
  135.   this text:
  136.  
  137.   1. I do not question your qualifications and your knowledge of the Amigas
  138.      hardware. But SIM bases on a new concept that offers an universe of
  139.      possibilities but also demands a lot of the user. There are a lot of
  140.      details that will get important at a certain moment, details you'll never
  141.      find out about on your own. It is in your own interest if you read this
  142.      manual. You will then be able to use 90% of the possibilities this
  143.      program offers (sorry, the only one that knows everything about this
  144.      tool, that's me).
  145.  
  146.   2. It was fun programming SIM, but it was HELL writing this damn manual.
  147.      Writing it in german would have been hard enough, but writing it in
  148.      a foreign language made it a torture. Good old Woodbird (my former english
  149.      teacher) may forgive me all the bad mistakes I did in this text. So you
  150.      may honour my sacrifice by reading this, since I do not like to do write
  151.      manuals that no one reads.
  152.  
  153.  
  154.  
  155.  
  156.  
  157. *******************************************************************************
  158.  2. Getting aquainted with SIM
  159. *******************************************************************************
  160.  
  161.  
  162.  
  163.  2.1 What is SIM?
  164.  ================
  165.  
  166.  
  167.   A good question, isn't it? Well, it's not as easy to give a straight answer
  168.   then to ask the question. As you could read in the title, 'S.I.M.' stands
  169.   for (S)ystem (I)ndependent (M)onitor. I presume that nearly every programer
  170.   working on the AMIGA (intromakers excluded) knows what a 'monitor' is (I do
  171.   not mean the device you stare at in this moment!).
  172.  
  173.   There have been several before, like good old C-Monitor, A-Mon, RomCrack and
  174.   a lot more. During the developement of SIM they served as examples for how to
  175.   do it and how not to do it and how to do it better. I hope that does not
  176.   cause any trouble with copyrights and so on. The result of this compiling
  177.   is an unmatched variety and complexity of commands. This is only a short
  178.   selection of the more spectacular features of SIM:
  179.  
  180.         - comfortable command editing
  181.         - integrated assembler, disassembler and calculator
  182.         - very powerfull findmechanisms
  183.         - superb breakpoint and trace possibilities
  184.         - parallel printer support
  185.         - freely defineable functionkeys
  186.         - exception control
  187.         - DOS-track and sector read/write operations
  188.         - one-bitplane graphic searcher
  189.         - diskformat
  190.         - file LOAD, SAVE, DELETE and DIR operation
  191.         - copperlist finder and disassembler
  192.  
  193.   Additionally to the monitor commands, this version disposes of what I call
  194.   'Debugger Window'. People that are used to Monam2 will welcome it because
  195.   it provides a similarly easy and effective way to overview a program.
  196.  
  197.   So far nothing new. What makes SIM so powerfull is the way it interacts
  198.   with the AMIGAs hardware and system. SIM tries to be as discreete and as
  199.   independent as it is possible.
  200.  
  201.   On one hand this means that SIM will run under all circumstances. It
  202.   does not need anything, no exec, no DOS, no nothing. This capability leaves
  203.   a wide field of usages. You could use SIM as last hope to salvage data from
  204.   the memory before reset. Or for virus-secure diskoperations since SIM
  205.   does it without DOS.
  206.  
  207.   On the other hand discreetion means that S.I.M. will do as less changes in
  208.   the software environement (ram, custom registers etc.) as it can. It does
  209.   neither use blitter nor copper. This 'invisibility' of SIM makes it
  210.   possible to monitor and track a programs to unknown depthts. You can debug
  211.   directly into graphic routines, interrupt handlers, diskroutines, task
  212.   and memory handling routines without any difficulties and resulting problems.
  213.  
  214.   I have made some bonebreaking tests with SIM, but it passed them all.
  215.   There is no absolute protection from SIM, it can only be made very hard
  216.   to keep control of a program with SIM, but if you are clever enough, you
  217.   will allways find a way around the problem.
  218.  
  219.  
  220.  
  221.  2.2 Qualifications, Requirements and Limitations
  222.  ================================================
  223.  
  224.  
  225.   To use SIM efficiently, detailed knowledge of the AMIGAs hardware,
  226.   the 68000 processor and assembler language is ABSOLUTELY neccessary.
  227.   SIM is designed to be used by professionals.
  228.  
  229.   SIM will work on practically every normal machine, as long as its
  230.   processor is a Motorola 68ooo/7.14 MHz. Other processors (68010/20/30/...)
  231.   are not supported yet, I am sorry about that. These processors are much more
  232.   comlicated in their assembler language and exception handling and I do not
  233.   have one of them.
  234.  
  235.   Different memory configurations and Big/Fat Agnus do not bother SIM.
  236.   Theoretically you'd not even need a kickstart ROM/WOM to run SIM.
  237.  
  238.   I recommend a fastmem memory expansion of at least half a megabyte at $200000
  239.   or $c00000. This gets usefull when you want to debug a program that uses the
  240.   entier chip ram. You can then put SIM in fastram which you have disabled
  241.   with one of those resetting nofastmems.
  242.  
  243.  
  244.  
  245.  2.3 The SIM Program
  246.  ===================
  247.  
  248.  
  249.   SIM is not a conventional program (it has no hunkstructure, so you cannot
  250.   simply start it from the CLI or workbench) but a simple PC-relative file
  251.   that can be loaded somewhere into the memory or included in one of your
  252.   own programs.
  253.  
  254.   When you work with SIM you must change your way of thinking. The Amiga has
  255.   multitasking. Most debuggers are 'taskoriented'. This means that they debug a
  256.   certain task, and only that one. If another task crashes, they do not notice
  257.   this. SIM is a monotasking debugger. In the eyes of SIM there is only one
  258.   program running on your machine. This one program may splitt up into several
  259.   seperated programs that are 'switched' (the tasks), but it is still one whole
  260.   program. This concept enables you to debug different tasks at a time, and
  261.   even newly generated ones i.e. by createproc().
  262.  
  263.  
  264.  
  265.  
  266.  
  267. *******************************************************************************
  268.  3. Some words about...
  269. *******************************************************************************
  270.  
  271.  
  272.  
  273.  3.1 The Display
  274.  ===============
  275.  
  276.  
  277.   The display creates some of the more tricky problems for SIM and you.
  278.   As you know, you need 20480/$5000 bytes of chipmem for a medres bitplane
  279.   you want to display. SIM uses a medres bitplane for it's display. But at a
  280.   certain moment, there may be no 20480 bytes chipmem available.
  281.  
  282.   The solution is the backup. When you have an area of $5000 free chipmem
  283.   that will stay free for sure (that means it is allocated with allocmem or
  284.   will never be used), you simply set the display address to the start
  285.   of that area and the backup address to zero (this means no backup). SIM will
  286.   then concider these $5000 bytes its own and use it as display. When you enter
  287.   SIM, the data in this area are then destroyed.
  288.  
  289.   In case there is not enough free chipmem or the chipmem will be used entierly
  290.   in near future and you have enough (that means $5000 bytes) unused fastmem
  291.   that won't be used for sure (disable fastmem...), you set the backup address
  292.   to the start of a free $5000 block of fastmem and the display address just to
  293.   somewhere in the chipmem. When SIM is activated, It copies the content of the
  294.   $5000 bytes display- to the backupmem and uses the displaymem. When you leave
  295.   SIM again, it copies the $5000 bytes back from the backup- to the displaymem.
  296.   That way, the chip ram is unchanged.
  297.  
  298.   SIM does not have an memory manager that 'ghosts' the display. This means
  299.   that when you have a display at $70000 and a backup at $c50000 and you want
  300.   to change or view memory or find something at $71000, you either transfere
  301.   the display to another location in the chipmem or you have to look or edit
  302.   in the backup (at $c51000 in our example).
  303.  
  304.   Because the interrupt vectors are used, you may not specify a display below
  305.   $70 or above $7b000 when you have the normal amount of chipmem (the chipmem
  306.   is reflected at $80000, except if you have fastmem there).
  307.  
  308.   Both the display- and the backupaddress are entered in the SIM-basearea
  309.   before starting SIM or set by the 's' command while working.
  310.  
  311.  
  312.  
  313.  3.2 Breakpoints
  314.  ===============
  315.  
  316.  
  317.   A breakpoint is basically a change in the program that is monitored that
  318.   stops it and gives control to the debugger that set it. In other terms, you
  319.   can run the program at full speed until it arrives at a certain instruction.
  320.   This is a very important feature when you have to control the flow of a
  321.   program. Therefore the breakpoint system of SIM is very sophisticated. SIM
  322.   can handle three kinds of breakpoints:
  323.  
  324.         - ILLEGAL breakpoints
  325.         - JSR breakpoints
  326.         - STACK breakpoints
  327.  
  328.   Each kind is used for different problems and has its advantages and
  329.   disadvantages.
  330.  
  331.   SIM is able to handle 16 different breakpoints at a time. When you enter
  332.   SIM, it removes the breakpoints from the memory, so the memory looks like it
  333.   would look with no breakpoints set. That enables you to change instructions
  334.   that are at a breakpoint without first removing the breakpoint before
  335.   changeing and putting it back afterwards.
  336.  
  337.   A critical situation occurs when the breakpoint is overwritten by a
  338.   program (i.e. by a copyroutine). Such a breakpoint is in 'modified' state
  339.   When SIM removes the breakpoints at entry, it checks if they are still there.
  340.   Modified breakpoints are not removed and not restored, when you leave SIM
  341.   again. If you want to have the modified breakpoint set again, you must first
  342.   'forget' it (this means that SIM simply frees the place in the breakpoint
  343.   list but does not put the original opcode or words back). Then you can set
  344.   it again.
  345.  
  346.   You cannot set breakpoints everywhere. SIM tests if there is ram at the
  347.   location where you want to set a breakpoint. If there is none, this causes
  348.   an error. SIM also prohibits to set breakpoints in the SIM codesegment.
  349.  
  350.  
  351.   1. ILLEGAL breakpoints
  352.   ----------------------
  353.  
  354.   Illegal breakpoints are normally the most used ones and offer the most
  355.   possibilities. When you set an ILLEGAL breakpoint at a certain instruction,
  356.   SIM replaces the opcode word of that instruction by the ILLEGAL opcode $4afc.
  357.   When the ILLEGAL instruction is executed instead of the original instruction,
  358.   an ILLEGAL INSTRUCTION exception happens.
  359.  
  360.   Therefore it is neccessary that the ILLEGAL INSTRUCTION vector somehow jumps
  361.   to SIM, either directly, set by the 'w' command, or indirectly by the task
  362.   traphandle, set by 'SIM-BUG' or another SIM-loader. If this is not so, your
  363.   machine crashes.
  364.  
  365.   Illegal breakpoints have the advantage that they can be 'conditioned'.
  366.   This means that this breakpoint only forces entry when one or one of several
  367.   conditions are fullfilled. The follwoing criterias can decide whether or
  368.   not the breakpoint forces entry:
  369.  
  370.  
  371.     - condition term:
  372.  
  373.       You can specify a formula that is calculated each time when the program
  374.       arrives at the breakpoint. When the result of the term is zero, the
  375.       program continues, if it is nonzero, SIM is entered.
  376.  
  377.       You can use that feature to i.e. break a program at a certain point if
  378.       a register contains a certain value.
  379.  
  380.  
  381.     - counter breakpoint:
  382.  
  383.       A counter breakpoint will enter SIM if the program has passed the
  384.       breakpoint a certain number of times.
  385.  
  386.       This way you can i.e. break a subroutine after it was called a certain
  387.       number of times.
  388.  
  389.  
  390.     - button breakpoint:
  391.  
  392.       When the program arrives at a button breakpoint, SIM will look if the
  393.       left or right mousebutton or the firebutton of a joystick in port 1 is
  394.       pressed and enter SIM if one is pressed. You can specify what buttons
  395.       are concidered.
  396.  
  397.       Button breakpoints can i.e. be set in a vertical blanking interrupt.
  398.       every fiftieth/sixtieth of a second, SIM can check if you want to enter
  399.       or not.
  400.  
  401.  
  402.   Additionally you can make resident Illegal breakpoints. A nonresident
  403.   breakpoint will be removed after it caused entry. A resident breakpoint
  404.   will stay active until you remove it. A resident breakpoint can be used
  405.   in situations when you want to stop a program several times at the same
  406.   address.
  407.  
  408.   SIMs breakpoint system enables to combine all these elements, to make
  409.   resident breakpoinst that break at SEVERAL conditions. You can set a resident
  410.   breakpoint at $70000 that either breaks when d3 is 3245 or the left or right
  411.   mousebutton is pressed and that is limited to 1000 passes. The command line
  412.   to set that breakpoint would look like that: 'b 70000 * ?d3=3245 lr 1000'.
  413.  
  414.   You may ask the question how to go over a breakpoint. SIM does this in three
  415.   steps:
  416.  
  417.     - remove the Illegal opcode and put back the original one.
  418.  
  419.     - do a tracestep to execute the instruction.
  420.  
  421.     - remember the (possibly new) opcode and set the $4afc again.
  422.  
  423.   As you see, SIM uses the TRACE vector to ignore a breakpoint. This means
  424.   that you must not only set the ILLEGAL INSTRUCTION vector but also the
  425.   TRACE vector. This is neccessary as soon as you have set a conditioned or
  426.   a resident breakpoint.
  427.  
  428.  
  429.   2. JSR breakpoints
  430.   ------------------
  431.  
  432.   The second type of breakpoint is a rather a 'heavy duty' one. When you
  433.   set a JSR breakpoint, SIM remembers the 6 bytes at the breakpoint address
  434.   and puts a JSR instruction there that jumps absolutely into SIM (i.e.
  435.   'JSR $c50726'). When the breakpoint is reached, the program jumps
  436.   directly into SIM which then puts back the 6 bytes.
  437.  
  438.   This breakpoint has two advantages. The first is that you do not need any
  439.   vectors to be set. The second is that a JSR breakpoint can be transfered.
  440.   When you have an Illegal breakpoint in a routine and that routine is
  441.   transfered to another location and the breakpoint is reached in the
  442.   copied routine, SIM will not know that that illegal is a breakpoint
  443.   because it is not at any of the addresses at which a breakpoint was set,
  444.   so it will not be replaced by the original opcode.
  445.  
  446.   JSR breakpoints are recognized at their entrance, because each of the 16
  447.   possible JSR breakpoints has another entrance. That way, SIM can recognize
  448.   that breakpoint whereever it is. But be carefull, never enter SIM by
  449.   these entrances on your own. You must also see to it that after the
  450.   transfered breakpoint forced entry and was removed, the original one is
  451.   NOT reached too.
  452.  
  453.   Because of these two advantages, you can use JSR breapoints in delicate
  454.   situations, where you are not sure if the vectors are not changed.
  455.  
  456.   A disadvantage of JSR breakpoints is that they use not one but three
  457.   words. The minimum size for an instruction is a word, an Illegal
  458.   breakpoint can be set at any instruction because the instruction ILLEGAL
  459.   uses one word. A JSR breakpoint may replace three instructions. Therefore
  460.   you have to set the JSR breakpoint in a 'linearly' executed part of the
  461.   program. Here are two examples where the JSR breakpoint is not set
  462.   correctly. The breakpoint is always set at the label 'bkpt':
  463.  
  464.   1. .
  465.      .
  466.      .
  467.      bsr.s label      ;this bsr would jump in the middle of the breakpoint!
  468.     bkpt:
  469.      bra.s label2     ;JSR opcode
  470.     label:
  471.      nop              ;HIword of entrance
  472.      nop              ;LO word of entrance
  473.      .
  474.      .
  475.      .
  476.  
  477.  
  478.   2. .
  479.      .
  480.      .
  481.     bkpt:
  482.      moveq #1,d0      ;JSR opcode
  483.     label:
  484.      moveq #0,d1      ;HI word of entrance
  485.      rts              ;LO word of entrance
  486.      .
  487.      .
  488.      .
  489.      moveq #-1,d0
  490.      bra.s label      ;again in the middle...
  491.  
  492.  
  493.   3. Stack breakpoints
  494.   --------------------
  495.  
  496.   Contrarily to the Illegal and JSR breakpoint, the Stack breakpoint is
  497.   not a change in the program but a change on the Stack. When SIM sets a
  498.   Stack breakpoint, it replaces a returnaddress on the stack by the address
  499.   of an entrance of SIM. When the appropriate rts, rtr or rte that would
  500.   return to that address is reached, it returns to SIM instead. SIM sets the
  501.   pc to the returnaddress and replaces the SIM entrance address on the stack
  502.   (should now be at a7-4!) by the original address for security.
  503.  
  504.   For SIM, it does not differe, if the Stack breakpoint is set in the
  505.   supervisor or userstack (in earlier versions it did, this is no longer
  506.   so).
  507.  
  508.   Use this feature wisely! SIM cannot test if the Stack breakpoint you set
  509.   is put in a stack and is taken off stack by a rts. Its upon you to set Stack
  510.   breakpoints at the right position.
  511.  
  512.   Stack breakpoints are also used by for the nextstep and the leave
  513.   subroutine command.
  514.  
  515.  
  516.  
  517.  3.3 Trace
  518.  =========
  519.  
  520.  
  521.   Tracing is the second way of keeping a program under control. SIM can
  522.   singlestep a program. Therefore you must see that the TRACE exception caused
  523.   by that somehow ends up in SIM, either set it directly or set the
  524.   tasktraphandle. It can also let a program run step by step and stop when
  525.   one or several conditions are fullfilled, much like the illegal breakpoints:
  526.  
  527.  
  528.     - condition term:
  529.  
  530.       You can specify a formula that is calculated after each step. When the
  531.       result of the term is zero, the trace continues, if it is nonzero,
  532.       SIM is entered.
  533.  
  534.       You can use that feature to i.e. break a program as soon as a certain
  535.       register is changed.
  536.  
  537.  
  538.     - counter trace:
  539.  
  540.       You can specify a maximum number of steps to do. When that amount of steps
  541.       is done, SIM is entered.
  542.  
  543.       Counter trace is mostly use to just get back after a routine is done.
  544.  
  545.  
  546.     - button trace:
  547.  
  548.       After each step, SIM will look if the left or right mousebutton or the
  549.       firebutton of a joystick in port 1 is pressed and enter SIM if one is
  550.       pressed. You can specify what buttons are concidered.
  551.  
  552.       Button trace can i.e. be used for stoping a program by hand at any moment.
  553.  
  554.  
  555.     - trace breakpoint:
  556.  
  557.       You can define an address that is compared to the PC after each step.
  558.       If the program has arrived at that address, SIM is entered.
  559.  
  560.       This feature is used when you cannot use breakpoints for some reasons.
  561.  
  562.  
  563.     - 68020 emulation:
  564.  
  565.       This is also a condition. SIM is only entered when a change in the flow
  566.       would happen, this means that the pc points on a BRA, JMP etc.
  567.  
  568.       I do not know what this is for, but people like it.
  569.  
  570.  
  571.   SIM uses the trace flag to do single steps. What some people do not know is
  572.   that you can trace over some instructions that may clear that flag. These are
  573.  
  574.    RTE
  575.    MOVE to SR
  576.    ORI #x,SR
  577.    EORI #x,SR
  578.    ANDI #x,SR
  579.  
  580.   Additionally you can enter the TRAP #x exception routines with the trace.
  581.  
  582.   Tracing has one weak spot: if you are tracing and an interrupt happens that
  583.   somehow causes entry in SIM (i.e. by a breakpoint), SIM loses the control
  584.   over the trace. When you exit SIM again and the interrupt ends, a TRACE
  585.   exception happens. You must then start to trace again or clear the trace flag
  586.   by hand.
  587.  
  588.  
  589.  
  590.  3.4 The Keyboard
  591.  ================
  592.  
  593.  
  594.   The most difficult problems are imposed by the keyboard. The Amigas keyboard
  595.   hardware cannot tell you which keys are pressed at a certain moment, it
  596.   reports only key changes. This makes it difficult for systemindependent
  597.   programs. When you press a key under system and release it in a program
  598.   that has its own keyboardhandler, the system will never know that you
  599.   released that key, it will report repeats of that key all the time until you
  600.   press another key. To prevent this, SIM will look that all keys are in the
  601.   same state when you leave SIM as they were in when you entered SIM. When you
  602.   leave SIM and a key is not in the same state, SIM will ask you to either
  603.   press that key or to release it. Therefore, in the headline you will find the
  604.   keys rawkey number and if in the keymap there is a printable char, that char
  605.   too. You can only exit SIM if you press or release all keys that it wants
  606.   you to.
  607.  
  608.   If you leave SIM by accident (hit wrong key?) and you are requested to
  609.   press/release a key, you can do the following operation to return to the
  610.   monitor:
  611.  
  612.   - press another key that is not a qualifier (shift etc.), not 'r', 'e', 't',
  613.     'u', 'n' or one that you must press to exit (esc is a good choice).
  614.  
  615.   - release all other keys
  616.  
  617.   - type 'return'
  618.  
  619.   - release the keys you pressed for that operation
  620.  
  621.   If you are tired to press keys again and again to exit, you can use the
  622.   flush keystatefield shortcut. SIM will then clear the internal list of
  623.   keys that were pressed when SIM was activated.
  624.  
  625.   As you know, the keyboard can store upto ten rawkeys on its own if
  626.   the CPU has no time or need to get keyboard events. It is possible
  627.   that several key hits are waiting to be replied. When SIM is activated
  628.   then, it would recieve all those old keys that may invoke shortcuts or
  629.   commands that are not desired. Similar problems occur when you link SIM
  630.   in the CIA-A interrupt and it is invoked before the key is replied. The
  631.   keyboardbuffer killer is used to reply to all possibly waiting keys and
  632.   to flush the keyboard buffer. This feature can be toggled on or off.
  633.  
  634.  
  635.  
  636.  3.5 Disk Access
  637.  ===============
  638.  
  639.  
  640.   Because ram is a too transitory datacarier, SIM can read and write
  641.   DOS-tracks and sectors. It does this by directly accessing the hardware.
  642.   Unfortunately, I know only one way to find out if a drive is running or
  643.   not: To activate the drive and look if its on full speed with no delay.
  644.   This system is only working when the running drives have a disk inserted.
  645.   If no disk is in a running drive and you access disk, it will be stoped
  646.   after disk access.
  647.  
  648.   When SIM is writing or reading, the display is used as buffer. You still
  649.   see it, but it contains chaos. The top line is used to give you status
  650.   information about the track that is operated or errors occured.
  651.  
  652.   When an error occures, you can either break with CTRL, retry with SHIFT
  653.   or ignore the error with ALT (when file operation, ALT=CTRL).
  654.  
  655.   When a track is not correct, SIM tries to read it three times. Then it
  656.   reports the error but displays also which sectors were okay. It is
  657.   possible that only one sector is damaged, press SHIFT several times, SIM
  658.   may find some sectores more that are okay and simply were after the damaged
  659.   sector last time.
  660.  
  661.   SIM is tollerant concerning the integrity of the sectors. Checksums are
  662.   calculated and SIM reports an error if one is wrong, but it decodes the
  663.   sector anyway. This enables SIM to reapair partially destroyed tracks.
  664.  
  665.  
  666.  
  667.  3.6 Files
  668.  =========
  669.  
  670.  
  671.   The capabilitys of SIM to read, list and write files are some of its newest
  672.   and most usefull features. You can load any files of a DOS disk, also
  673.   from user directories to memory. You can list the files and their length
  674.   contained in any directory. And you can save any area of memory as a file
  675.   on a disk.
  676.  
  677.   The file save system is quite sophisticated. It writes files in a way
  678.   that they can be loaded and listed fast. Info- and extension blocks are
  679.   located on track 79 and higher, data blocks from 79 down to 0 and from 159
  680.   to 79. Additionally, SIM will first look if a file fits the disk before
  681.   it begins to save. The bad sideeffect of this is that saving takes some time.
  682.  
  683.   One thing you must remember is to be carefull with saving files when you
  684.   work with the normal operating system afterwards. When you save a file,
  685.   the bitmap on the disk is changed. The system keeps its own copy of the
  686.   bitmap of a disk in memory. When it accesses that disk again, it possibly
  687.   discovers a totally different bitmap. When it comes to the worst, the DOS
  688.   crashes with the guru 07000007 (bitmap corrupt). To prevent this, you
  689.   simply remove that disk from its drive and put it back again. The DOS
  690.   then rereads the bitmap and everything's okay.
  691.  
  692.  
  693.  
  694.  3.7 Breaking
  695.  ============
  696.  
  697.  
  698.   In certain situations, it may be neccessary to break an operation or to
  699.   pause it. SIM can both. You can break the dump commands, find and compare
  700.   by shortly hitting CTRL. If you press it longer, SIM only pauses and
  701.   continues when you release CTRL. When you press SHIFT-CTRL or additionaly
  702.   hit the SHIFT key when you pause, SIM locks until you release, press and
  703.   relese CTRL again. This enables you i.e. to take notes without holding
  704.   CTRL all the time.
  705.  
  706.   While locked or paused, you can press the ALT key. When you release CTRL
  707.   (if locked, press it first), SIM breaks also. This is used when you have
  708.   paused and want to stop immediately.
  709.  
  710.   ALT-CTRL is used to break command execution in general. Before SIM looks
  711.   for a new command in a command line, it tests for ALT-CTRL. If that's so,
  712.   it breaks. This enables you to break a commandline like 'P0:X' since you
  713.   cannot break the 'P' and 'X' commands.
  714.  
  715.   An exception to this rules are the disk operation and the list directory
  716.   command. These commands can only be broken. Therefore simply keep the CTRL
  717.   key pressed until SIM gets it.
  718.  
  719.  
  720.  
  721.  3.8 The Actual Address
  722.  ======================
  723.  
  724.  
  725.   The dump and edit commands share a default address variable that is used
  726.   each time, you do not give a startaddress. This address has the name '@'
  727.   for the calculator. It contains the endaddress of the last dump or edit
  728.   command or it is set by find and compare.
  729.  
  730.  
  731.  
  732.  3.9 The Matchbuffer
  733.  ===================
  734.  
  735.  
  736.   The matchbuffer is used to collect addresses. You can force the find and
  737.   compare commands to put the addresses they report into this buffer. Well,
  738.   this is nothing special. But you can also say under what conditions an
  739.   address is put in the buffer or one that is allready in buffer stays there.
  740.   There are three possible conditions:
  741.  
  742.  
  743.   - old:     If an address that was allready in buffer did not match with any
  744.              reported by the find or compare command, it only stays in the
  745.              buffer when you enable oldies.
  746.  
  747.   - match:   If an address that is reported is allready somewhere in the buffer,
  748.              it stays only when you enable matches.
  749.  
  750.   - new:     If an address is new, it is only put in the buffer when you enable
  751.              new ones.
  752.  
  753.   You can combine the three conditions in any way (there are eight possible),
  754.   some may make not much sence.
  755.  
  756.   This feature enables you to search for counters or changes.
  757.  
  758.   To show the addresses in the buffer, the 'k' command is used.
  759.  
  760.   An example: you are searching for the livecounter in a game. You have five
  761.   lives:
  762.  
  763.   1. define matchbuffer, i.e. 'k c00000 c10000'
  764.   2. search for 5, i.e. 'f 0 20000 !n 05'
  765.   3. exit and die once
  766.   4. search for 4, i.e. 'f 0 20000 !m 04'
  767.      If you are lucky, one address stays in the matchbuffer
  768.   5. list addresse(s) in matchbuffer, i.e. 'k 0'
  769.   6. if neccessary go to step 3 and search for one live less
  770.  
  771.  
  772.  
  773.  3.10 Command History
  774.  ====================
  775.  
  776.  
  777.   SIM remembers the last commands executed in the monitor. I reserved 128 bytes
  778.   for that. These 128 bytes contain the last packed command lines that fit.
  779.   If you get an old command line back by the command history shortcuts and
  780.   execute it, it is not remembered as the newest executed command.
  781.  
  782.  
  783.  
  784.  3.11 Traps
  785.  ==========
  786.  
  787.  
  788.   The traps are one of the major connections of sim to the outer world. They are
  789.   used for breakpoints and to handle crashes. You can set the ten basic
  790.   exception vectors directly. When you enter SIM, it puts back the original
  791.   vectors, so you can edit them. When exited, SIM sets the set traps again.
  792.  
  793.   Problems occure when the program that is debugged sets the traps itself.
  794.   When the program changes a vector previously set by SIM, this is handled the
  795.   same way as it is done with changed breakpoints.
  796.  
  797.   Additionally you can force SIM to set traps again if they are modified by
  798.   toggeling 'Auto Unmodify Traps' on.
  799.  
  800.  
  801.  
  802.  3.12 Functionkeys
  803.  =================
  804.  
  805.  
  806.   You can define all ten functionkeys with a text or command line. If you define
  807.   a text, it is copied at the location of the cursor. If you define a command
  808.   line, it is executed directly.
  809.  
  810.   The system used bases much on the one used by the Sharp PC-1500, thanks to
  811.   Sharp for that.
  812.  
  813.   The functionkeys share 300 bytes of 'intelligent' textbuffer with the
  814.   condition breakpoints and linkterms.
  815.  
  816.  
  817.  
  818.  3.13 SIM and the Hardware
  819.  =========================
  820.  
  821.  
  822.   SIM does only use a very limited part of the hardware registers, the ones
  823.   that are indispensable or must be set on fix values to provide security.
  824.   Some of these registers can be read, some not. The values of the readable
  825.   ones are remembered in a special part of SIM called 'SIM base' when SIM is
  826.   activated. The SIM base is located, as its name says, at the start of SIM.
  827.   In chapter 6.1 you find the structure of the base.
  828.  
  829.   These are the registers that are read out and stored in the base at entry.
  830.   When you exit SIM, it copies the remembered values back:
  831.  
  832.  
  833.   - DMACON
  834.   - INTENA
  835.   - INTREQ *)
  836.  
  837.   - Level 2 interrupt
  838.   - Level 3 interrupt
  839.  
  840.   - CIA-A: CRA
  841.   - CIA-A: CRB
  842.   - CIA-B: CRA
  843.   - CIA-B: CRB
  844.  
  845.   - CIA-A: PRA write buffer
  846.   - CIA-A: PRB write buffer
  847.   - CIA-A: DDRA
  848.   - CIA-A: DDRB
  849.  
  850.   - CIA-B: DDRA
  851.  
  852.   - CIA-A: SR write buffer
  853.  
  854.   - VPOS **)
  855.  
  856.  
  857.   All these registers are used by SIM when working. If you have to know
  858.   what vaule was in one of those, you have to look in the SIM base where SIM
  859.   remembered them.
  860.  
  861.  
  862.   *) This register is handled in a special way. While SIM is active, it leaves
  863.   the disk-DMA switched on. If it wouldn't, this would possibly destroy your
  864.   disks. Now since the disk-DMA is left on, remember that when the disk-DMA is
  865.   terminated, bit 1 in the INTREQ is set. But this may happen during SIM is
  866.   active because the DMA was still transfering when the INTREQ was read. Therefore
  867.   you will find only the interrupt requests in the backup that were waiting
  868.   when SIM was activated. If you want to know abaout the actual ones, you must
  869.   read out INTREQR using the calculator command '?[$dff09c].w'.
  870.  
  871.   When you exit and didn't edit the INTREQ backup, SIM does not restore
  872.   the bits EXTER, DSKSYN, RBF, AUDX, DSKBLK and TBE from the backup. If you
  873.   edited the backup, the bits that are changed are restored , even if they
  874.   contain some of the bits named above.
  875.  
  876.   **) This value is not written back. SIM rather waits for the rasterbeam
  877.   to be aproximately at that position that it was on when the register was
  878.   read. The register is read at a late point of time when SIM is activated,
  879.   quite some instructions have been executed then, so it is not very precise.
  880.   I hope I can improve that.
  881.  
  882.  
  883.   As I quoted, some of the custom register contain information that is lost
  884.   because SIM cannot read from these registers. For the more important
  885.   ones, SIM disposes of an editable list of 'reentry' values it puts back when
  886.   exiting. Those registers are:
  887.  
  888.  
  889.   - DIWSTRT
  890.   - DIWSTOP
  891.   - DDFSTRT
  892.   - DDFSTOP
  893.   - BPLCON0
  894.   - BPLCON1
  895.   - BPLMOD1
  896.   - COLOR00
  897.   - COLOR01
  898.  
  899.  
  900.   As you see, these registers all concern the display. In most cases, they
  901.   are reset anyway by a copperlist. If not, you have to look in the program
  902.   where it sets them for the initial value and enter it in the base or decide
  903.   on your own what value to use.
  904.  
  905.   Some of the registers are modified but do not have a reentry value,
  906.   because they are either too temporary (DSKPTX for example) or compleetely
  907.   unimportant (BPL1PTX). If it becomes neccessary, you can edit some with
  908.   the 'e' command:
  909.  
  910.  
  911.   - CLXDAT
  912.   - DSKBTR *)
  913.   - DSKPTX *)
  914.   - DSKLEN *)
  915.   - DSKSYNC *)
  916.   - BPL1PTX
  917.   - BPL1DAT
  918.   - SPRXDATA/B
  919.   - CIAA: ICR state and mask
  920.  
  921.  
  922.   *) these registers are only used and changed when you read or write from or
  923.   to disk.
  924.  
  925.  
  926.  
  927.  
  928.  
  929. *******************************************************************************
  930.  4. Communication between YOU and SIM    
  931. *******************************************************************************
  932.  
  933.  
  934.  
  935.  4.1 The SIM Environement
  936.  ========================
  937.  
  938.  
  939.   As I quoted in the chapter about the display, SIM provides its own. It is
  940.   basically used for all output SIM produces (leave alone the printer and
  941.   disk).
  942.  
  943.   You have a PAL display of 256*640 pixels or 32 lines and 80 rows. The
  944.   screens colors are green and dark blue but may be set by you to any colors
  945.   you like. The screen is devided in header, worktable/debugger window and
  946.   footer, all seperated by a line of '¡'.
  947.  
  948.   The header normally contains the title and copyrights but serves also as
  949.   statusline when accessing disk and keyboard cleanup.
  950.  
  951.   The worktable and the debugger window share 28 lines.
  952.    - In the worktable, actually the monitor, you can move the cursor around
  953.      and enter commands and get output.
  954.    - The debugger window shows you one or two views of the memory in different
  955.      forms at different addresses, read more about that feature in the
  956.      appropriate chapter.
  957.  
  958.   The footer contains the cause of SIM's entry, a status and result field
  959.   and the addresses of SIM itself, the display- and backupaddresses.
  960.  
  961.  
  962.  
  963.  4.2 The Monitor
  964.  ===============
  965.  
  966.  
  967.   On the worktable, several basic features are provided:
  968.  
  969.    - What you see on the monitor (the text) is stored in SIM, when you leave
  970.      and enter again, the display will be the same.
  971.  
  972.    - SIM has two entier keymaps for not qualified,
  973.      shifted, alternated and shifted+alternated keys, one USA and one custom.
  974.      In the original version, the custom one is Swiss.
  975.  
  976.    - Ctrl+chars with ascii values from $40-$60 will cause a char from
  977.      $0-$20 (i.e. 'J' (=$4a) => <CR> (=$a))
  978.  
  979.    - Ctrl+chars with ascii values from $60-$80 will cause a char from
  980.      $80-$a0
  981.  
  982.    - The cursor can be moved around one char by pressing the cursor keys.
  983.  
  984.    - The cursor can be moved to the extreme positions by pressing
  985.      <SHIFT>+cursor keys (i.e. <SHIFT>+cursor right => cursor in row 79)
  986.  
  987.    - <DEL> will delete the char above the cursor and shift all chars right
  988.      of the cursor one row left, inserting a space at row 79
  989.  
  990.    - <BACKSPACE> will clear the char left of the cursor and shift all chars
  991.      above and right of the cursor one row left.
  992.  
  993.    - <SHIFT>+<DEL> will insert a space at the cursor position and shift all
  994.      chars above and right of the cursor one row right.
  995.  
  996.    - <SHIFT>+<BACKSPACE> will clear the char above the cursor move the
  997.      cursor one row left
  998.  
  999.    - <ALT>+<DEL> will clear the monitor part and put the cursor in the left
  1000.      upper corner next to a point.
  1001.  
  1002.    - <ALT>+<BACKSPACE> will clear the line in which the cursor is, put a '.' in
  1003.      row 1 and the cursor in row 2.
  1004.  
  1005.    - <HELP> prints the first helppage, starting in the line below the line the
  1006.      cursor is in actually.
  1007.  
  1008.    - <SHIFT+HELP> prints the second helppage.
  1009.  
  1010.    - <F1-F10>: you can freely define the ten function keys.
  1011.  
  1012.    - <SHIFT>+<ESC> copies the last executed command in the line of the
  1013.      cursor.
  1014.  
  1015.    - <ALT>+<ESC> copies the line of the cursor in the command
  1016.      buffer. It can then be inserted anywhere by <SHIFT>+<ESC>.
  1017.  
  1018.    - <CR> will execute the commands in the actual line (the one in which
  1019.      the cursor is).
  1020.  
  1021.    - <ALT+CURSOR UP> goes one step back in command history and fill the actual
  1022.      line with the actuall command in history.
  1023.  
  1024.    - <ALT+CURSOR DOWN> goes one step forth in command history.
  1025.  
  1026.  
  1027.    You can execute commands by entering them in one line and pressing
  1028.    return. When all commands are executed, SIM looks if a point '.' is in
  1029.    row 0 of the actual line. If so, the cursor is set left of it and the
  1030.    line is not cleared. If no point is found there, SIM puts one there
  1031.    and clears the rest of the line. That way, the point signals wheather or
  1032.    not a line is a previous command line. That enables to use again the
  1033.    commands that  have been entered earlier and are still visible on the
  1034.    screen.
  1035.  
  1036.  
  1037.  4.3 The Commands and Their Syntax
  1038.  =================================
  1039.  
  1040.   As mentioned earlier, SIM understands a vast number of commands.
  1041.   While working in SIM, you can get a little overview of them in the two
  1042.   helppages:
  1043.  
  1044.     n (s)(i) :assemble    | t [s][e][t] :transfer mem | ? [n] :calculate
  1045.     e (s)(d) :edit mem    | o [s][e][d] :occupy mem   | w (x) :CPU traps
  1046.     d (s)(e) :disassemble | c (s)(e)(t) :compare mem  | v (x) :create trap
  1047.     a (s)(e) :show ascii  | f (sejd)(m) :find data    | h (n) :history
  1048.     m (s)(e) :show hex    | f (sej'i'i) :find disasm  | g [s] :go sub
  1049.     l (s)(e) :show copper | s (p)(b)(c) :set SIM-adrs | i (n) :leave out
  1050.     r (rs)   :edit regs   | F (n)(c){@} :edit F-keys  | u     :next step
  1051.     k (s)(e) :matchbuffer | z (n*n?cb)  :trace steps  | q/Q   :quit prog
  1052.     P (s)(m) :show plane  | b (s)(*n?b) :breakpoints  | x/X   :exit and go
  1053.  
  1054.   and
  1055.  
  1056.     <s [s][s](n) :read secs   | L [f][s] :load file
  1057.     >s [s][s](n) :write secs  | D (n)    :set drive
  1058.     <t [s][t](n) :read tracks | D?(n)    :find head
  1059.     >t [s][t](n) :write tracks| B [s]    :bootchksum
  1060.     >f (n)       :format disk | K [s]    :blockchksum
  1061.     S  [f][s][e] :save file   | V (path) :directory
  1062.  
  1063.    In the helppage and the explanations, the following shortenings are used for
  1064.    options:
  1065.  
  1066.   s: (start)address          e: endaddress         t: targetaddress/track
  1067.   i: assembler instructions  d: dataline           c: a text or SIM commands
  1068.   n: decimal number          x: hexadecimal number m: mask/modulo
  1069.   r: register                p: plane              b: backup/breakmode/block
  1070.   ?: condition term          f: file               j: jokers
  1071.  
  1072.   Options in '[]' are neccessary.
  1073.   Options in '()' are optional.
  1074.   Chars in '{}' serve as sign or flag.
  1075.  
  1076.   Because space in SIM is limited, these helppages tell only the basic
  1077.   syntax of a command. Here comes a short but detailed list of all commands
  1078.   and what they do:
  1079.  
  1080.  
  1081.  Dump Commands
  1082.  -------------
  1083.  
  1084.     m (s)(e) : print memory as hexdump
  1085.     a (s)(e) : print memory as asciidump
  1086.     d (s)(e) : disassemble memory
  1087.     l (s)(e) : interprete memory as copperlist
  1088.  
  1089.    Dump commands have all the same options, only the output changes:
  1090.  
  1091.      command (startaddress) (endaddress)
  1092.  
  1093.    If you give both addresses, SIM starts to dump from the startaddress and
  1094.    stops when the endaddress is reached or passed over.
  1095.  
  1096.    If you give only the startaddress, SIM starts to dump from that address
  1097.    and calculates an endaddress. That endaddress will be:
  1098.  
  1099.     for 'm': start+128
  1100.     for 'a': start+512
  1101.     for 'd': start+32
  1102.     for 'l': start+32
  1103.  
  1104.    If you do not give any address, SIM takes the actual address as
  1105.    startaddress.
  1106.  
  1107.    Do not try to dump the customregisters area.
  1108.  
  1109.    In the disassembly, the instructions BSR,JSR and TRAP #x are indented
  1110.    and after the instructions JMP, BRA, ILLEGAL, RTS, RTE, RTR and RESET a
  1111.    line of '-' is printed for seperation. Additionally, breakpoints are
  1112.    marked by an asterix.
  1113.  
  1114.  
  1115.    EXAMPLES:
  1116.  
  1117.     m 0 100
  1118.     a 100
  1119.     d
  1120.     l 51236 !+60
  1121.  
  1122.  
  1123.  Edit Commands
  1124.  -------------
  1125.  
  1126.     e (s)(d) : edit memory
  1127.     n (s)(n) : assemle
  1128.  
  1129.    You can modify the memory with these two commands.
  1130.    The edit command can write data at a location in the memory (see chapter
  1131.    'line forms' for details)
  1132.  
  1133.    The assemle command can assemble one or more instructions seperated by a
  1134.    ',' at a location in memory (see chapter 'Assembler and Calculator' for
  1135.    info)
  1136.  
  1137.    If you give both startaddress and data/instructions, SIM simply edits
  1138.    the memory.
  1139.  
  1140.    If you only give the startaddress, SIM will start to assemble or edit in
  1141.    a continuous mode where it allways prepares the next line for further data
  1142.    or instructions. To stop this simply give no instruction or data. The
  1143.    system is as clever as it recognices if in the line it prepares for a new
  1144.    data or assemble line, there is already a data or assemble line that was
  1145.    prepared for continuous mode. If that is so, it only updates the address
  1146.    but does not clear the line. That enables you to i.e. correct a program
  1147.    assembled in continuous mode and to insert instructions.
  1148.  
  1149.    If you do not give any option, SIM starts to edit/assemble in continuous
  1150.    mode at the actual address.
  1151.  
  1152.  
  1153.    EXAMPLES:
  1154.  
  1155.     e 70000
  1156.     e>00070000: 0121
  1157.     n 100 nop
  1158.  
  1159.  
  1160.  Transfer and Occupy
  1161.  -------------------
  1162.  
  1163.    t (s)(e)(t) : Transfer memory
  1164.    o (s)(e)(d) : Occupy memory
  1165.  
  1166.    Transfer:
  1167.  
  1168.    This command simply copies a part of the memory to another location smartly.
  1169.    This means that SIM uses as- or descending mode for copying, not to destroy
  1170.    the memory:
  1171.  
  1172.    - t [s][e][t] : Transfers memory from s to e at new address t
  1173.  
  1174.  
  1175.    Occpuy:
  1176.  
  1177.    Occupy is generaly used to clear the memory or to fill it with repeated data:
  1178.  
  1179.    - o [s][e][d] : Occupy memory from s to e with data d
  1180.  
  1181.  
  1182.    EXAMPLES:
  1183.  
  1184.    t 0 10000 c00000
  1185.    o 12564 !+60 nnop
  1186.  
  1187.  
  1188.  Find and Compare
  1189.  ----------------
  1190.  
  1191.    f (s)(e)(j)(d)(m) - find data
  1192.    f (s)(e)(j) i (i) - find disassembly
  1193.    c (s)(e)(t)(j)    - compare memory
  1194.    k {@}(s)(e)       - show/set matchbuffer
  1195.  
  1196.    SIM disposes of a sophisticated find and compare system. For any of the
  1197.    three you can specify some jokers:
  1198.  
  1199.    - +/-n : Sets a step, only at every nth address is searched or compared.
  1200.  
  1201.    - '*'  : To say that all addresses where nothing was found or two bytes
  1202.             are the same are reported.
  1203.  
  1204.    - '@'  : When you do not want a list of addresses but to have them reported
  1205.             one by one, set this joker. SIM will then execute F9 each time
  1206.             something is reported and put the active view of the debugger
  1207.             window at that address.
  1208.  
  1209.    - '!'  : If you want to collect and filter addresses with the matchbuffer,
  1210.             set this flag. After the '!' you can enter an 'o' to say that old
  1211.             ones stay, a 'm' to say that same addresses stay, or a 'n' to say
  1212.             that new ones stay.
  1213.  
  1214.  
  1215.    Find data:
  1216.  
  1217.    You can search in a defined area in the memory for a certain bytecombination
  1218.    with this command. Depending of how many options you enter, the command does
  1219.    different things:
  1220.  
  1221.    - f [s][e](j)[d][m] : Starts to find from s to e with the jokers j for
  1222.      the bytes d that are masked by the mask m. only the bits that are set in m
  1223.      are concidered when comparing. If the mask is shorter than the data, the
  1224.      rest of the mask will be set to $ff
  1225.  
  1226.    - f [s][e](j)[d] :Starts to search for data with all bits set in the mask.
  1227.  
  1228.    - f [s][e](j) : Starts to find for the same data with the same mask as last
  1229.      time in the area from s to e with new jokers j.
  1230.  
  1231.    - f [s][e] : Searches again in the area from s to e.
  1232.  
  1233.    - f [s] : Starts to search from s to the last e.
  1234.  
  1235.    - f : Continues to find after the last address reported.
  1236.  
  1237.  
  1238.    Find disassembly:
  1239.  
  1240.    You can find an instruction or a fragment of it in a defined are in the
  1241.    memory. Like find data, find disassembly does not need all options:
  1242.  
  1243.    - f [s][e](j) i [i] : Starts to find from s to e with jokers j for the
  1244.      instruction i.
  1245.  
  1246.    - f [s][e](j) : Starts to find for the same instruction in the area
  1247.      from s to e with new jokers j.
  1248.  
  1249.    - f [s][e] : Searches again in the area from s to e.
  1250.  
  1251.    - f [s] : Starts to search from s to the last e.
  1252.  
  1253.    - f : Continues to find after the last address reported.
  1254.  
  1255.    The instruction i can be only a fragment like '4(a6)' or an entier
  1256.    instruction like 'moveq #3,d0'. Several things must be made right:
  1257.  
  1258.    - When you have entered a space, SIM will concider what is before the
  1259.      space to be the mnemonic. Because the disassembler leaves an eight
  1260.      chars large field for the mnemonic where the rest is filled with
  1261.      spaces, SIM does tabulate your entries. 'clr.l d0' will internally
  1262.      made to 'clr.l   d0'.
  1263.  
  1264.    - The char '*' is used as joker. It says that this char is not compared.
  1265.      I.e. '(a*)' searches for all indirect accesses with any address register.
  1266.  
  1267.    - The char '_' is replaced by a space. I.e. '_d0' searches for
  1268.      all accesses on d0 as source ea.
  1269.  
  1270.    - The char '@' at the start or the end of your fragment limits the
  1271.      search on the start or end of the fragment. I.e. '@st' finds only
  1272.      'st.b d0' but not 'tst.l d3'.
  1273.  
  1274.  
  1275.    Compare:
  1276.  
  1277.    You can compare two areas in the memory. Different amount of options for
  1278.    different results:
  1279.  
  1280.    - c [s][e][t](j) : Compares area from s to e with area t to (t+(e-s)) with
  1281.      jokers j.
  1282.  
  1283.    - c [s][e][t] : Compares with no jokers.
  1284.  
  1285.    - c [s][t] : Continues to compare from s with t.
  1286.  
  1287.    - c [s] : Compares from s to last e with last t
  1288.  
  1289.    - c : Continues to compare after last address reported.
  1290.  
  1291.  
  1292.    Matchbuffer:
  1293.  
  1294.    You can read out or define the matchbuffer:
  1295.  
  1296.    - k [s][e] : Defines a new matchbuffer from s to e and clears it.
  1297.  
  1298.    - k * : Clears matchbuffer.
  1299.  
  1300.    - k ? : Shows you where the matchbuffer is.
  1301.  
  1302.    - k @ [s] : Shows all matchbuffer entries larger than s by reporting
  1303.      them one by one over F9.
  1304.  
  1305.    - k [s] : Lists all entries higher than s
  1306.  
  1307.    - k : Lists or shows next entrie(s)
  1308.  
  1309.  
  1310.    EXAMPLES:
  1311.  
  1312.     f 0 100 00
  1313.     f 10000 20000 !nm 05
  1314.     f 0 20000 @ imoveq #*,d*
  1315.     c 0 100 200 *
  1316.     k 100
  1317.     k@ 0
  1318.  
  1319.  
  1320.  Processor Commands
  1321.  ------------------
  1322.  
  1323.    r (r)(x) : set/view registers
  1324.    w (x)    : set/view traps
  1325.    v (x)    : create trap
  1326.  
  1327.    Registers:
  1328.  
  1329.    The 'r' command is used to either set a register d0-d7, a0-a7, ssp, usp, pc,
  1330.    sr, m0-m7 or to view them:
  1331.  
  1332.    - r [r][x] : Sets register r vith new value x
  1333.    - r        : Views registers
  1334.    - r?       : Views memories m0-m7
  1335.  
  1336.  
  1337.    Trapsetting:
  1338.  
  1339.    The 'w' command is used to either set or clear the ten basic CPU exception
  1340.    vectors or to view their status:
  1341.  
  1342.    - w [x] : Sets or clears Vector x
  1343.    - w     : Lists status of vectors
  1344.    - wk    : Clears all traps
  1345.  
  1346.    You can set or clear several vectors at a time by seperating the vector
  1347.    numbers by kommas. The vector numbers correspond to the exception numbers, 2
  1348.    for bus error upto $b for linef.
  1349.  
  1350.  
  1351.    Trapcreating:
  1352.  
  1353.    The 'v' command is used to simulate the occurence of an exception or to
  1354.    remove one from the stack:
  1355.  
  1356.    - v [x]  : Simulates exception x
  1357.    - v [-x] : Removes exception x from stack
  1358.    - v      : Simulates occurence of same exception that forced entry
  1359.    - v?     : Gives information about trap that forced entry
  1360.  
  1361.    SIM can simulate exceptions 2 upto $40. When you simulate an address or bus
  1362.    error, SIM takes either the ssw, ir and aa from the last bus or address
  1363.    error or zero for all when none happened yet.
  1364.  
  1365.    When you simulate an exception 2 upto $b, which is set by the 'w' command,
  1366.    SIM takes the old vector as new pc.
  1367.  
  1368.    When you simulate an interrupt, the sr will also contain the interrupt
  1369.    level.
  1370.  
  1371.    The 'v' command without options is used to put an exception back on the
  1372.    stack when i.e. you want the old vector to handle the problem. This works
  1373.    only if SIM was entered by one of the exceptions.
  1374.  
  1375.    You can only remove traps from the stack when you are in supervisor mode.
  1376.    The vector number is only used to know how much has to be taken from the
  1377.    stack (14 bytes when 2 or 3, 6 for the rest).
  1378.  
  1379.    The 'v?' command is used to know more about the exception, especially
  1380.    address and bus errors.
  1381.  
  1382.  
  1383.    EXAMPLES:
  1384.  
  1385.    r pc pc+20
  1386.    r m7 d0
  1387.    r?
  1388.    w 4,9
  1389.    wk
  1390.    v 3
  1391.    v -3
  1392.    v?
  1393.  
  1394.  
  1395.  Breakpoints and Trace
  1396.  ---------------------
  1397.  
  1398.    b (s)(j)  : set/clear breakpoints
  1399.    u         : nextstep
  1400.    z (j)     : tracestep
  1401.    i (n)     : leave out instructions
  1402.  
  1403.    Breakpoints:
  1404.  
  1405.    The 'b' command is used to handle breakpoints. Different options are
  1406.    available:
  1407.  
  1408.    - b [s][j] : Sets a breakpoint at address s with the options:
  1409.  
  1410.      - 'l' or 'r' or 'f' : button breakpoint
  1411.      - [n]               : counter breakpoint
  1412.      - '?' [n]           : condition breakpoint
  1413.      - '*'               : resident breakpoint
  1414.  
  1415.    - b [s] : Sets a simple breakpoint
  1416.  
  1417.    - b : Lists all breakpoints
  1418.  
  1419.    - bj [s] : Sets a JSR breakpoint at s
  1420.  
  1421.    - bs [s] : Sets a STACK breakpoint at s
  1422.  
  1423.    - bk : Kills all breakpoints
  1424.  
  1425.    You can seperate several breakpoints at a time by seperating the next
  1426.    address from the previous address or options by a komma.
  1427.  
  1428.  
  1429.    Trace:
  1430.  
  1431.    The 'z' command executes tracesteps. It either stops after one step or when
  1432.    a certain condition is fullfilled:
  1433.  
  1434.    - z [j] : Does trace until:
  1435.  
  1436.      - 'l' or 'r' or 'f' : trace until button pressed
  1437.      - [n]               : trace n steps
  1438.      - '?' [n]           : trace until n not zero
  1439.      - '*' [s]           : trace until pc=s
  1440.      - 'c'               : emulate 68020 trace
  1441.  
  1442.    - z : Does one tracestep
  1443.  
  1444.  
  1445.    Nextstep:
  1446.  
  1447.    The 'u' command does either one tracestep or when it is done at a JSR, BSR
  1448.    or TRAP #x, it does also a tracestep and sets a stack breakpoint at a7
  1449.    (or a7+2 when TRAP) and exits:
  1450.  
  1451.    - u : Do one nextstep
  1452.  
  1453.  
  1454.    Leave Out:
  1455.  
  1456.    This simply leaves instructions away:
  1457.  
  1458.    - i [n] : Leaves out n instructions
  1459.  
  1460.    - i : Leaves out one instruction
  1461.  
  1462.  
  1463.    EXAMPLES:
  1464.  
  1465.     b 100 *j100 ?[4]<>$c00276
  1466.     bj 100,200
  1467.     bssp
  1468.     z *pc
  1469.     z j
  1470.     n
  1471.     i 2
  1472.  
  1473.  
  1474.    Flow
  1475.    ----
  1476.  
  1477.    x     : Exit
  1478.    X     : Exit directly
  1479.    q     : Quit
  1480.    Q     : Quit directly
  1481.    g [s] : go to subroutine
  1482.    h (n) : history
  1483.  
  1484.    Exit:
  1485.  
  1486.    The 'x' or 'X' commands are used to simply continue the program at full
  1487.    speed. 'x' asks first if you are sure, 'X' simply exits:
  1488.  
  1489.    - x : Exits, but asks for confirmation first
  1490.  
  1491.    - X : Exits directly
  1492.  
  1493.  
  1494.    Quit:
  1495.  
  1496.    The 'q' or 'Q' commands are used to return control to the debug server.
  1497.    'q' asks first if you are sure, 'Q' simply returs directly:
  1498.  
  1499.    - q : Quits, but asks for confirmation first
  1500.  
  1501.    - Q : Quits directly
  1502.  
  1503.  
  1504.    Gosub:
  1505.  
  1506.    The 'g' command is used to execute a little program from SIM:
  1507.  
  1508.    - g [s]  : goes to subroutine at s
  1509.  
  1510.    - gw [s] : goes to subroutine at s but does not exit yet
  1511.  
  1512.    When SIM goes to subroutine, it first pushes the old pc on the stack and then
  1513.    the return address for the rts.
  1514.  
  1515.    The 'gw' command does only prepare the stack for the operation but does not
  1516.    exit yet. This is i.e. used to trace a subroutine.
  1517.  
  1518.  
  1519.    History:
  1520.  
  1521.    SIM remembers the last five sets of registers as they were when SIM was left
  1522.    for the last five times. The list is also updated after each step when doing
  1523.    conditioned trace:
  1524.  
  1525.    - h [n] : Print nth last history
  1526.  
  1527.    - h : Print all five histories
  1528.  
  1529.    SIM does not only remember the registers d0-a6, usp, ssp, sr and pc but
  1530.    also the instruction at the pc because of selfmodifying code.
  1531.  
  1532.  
  1533.    EXAMPLES:
  1534.  
  1535.    h 3
  1536.    X
  1537.    q
  1538.    g 100
  1539.    gw 200
  1540.  
  1541.  
  1542.    Diskoperations
  1543.    --------------
  1544.  
  1545.    D  (n)       : set drive
  1546.    <t (s)(s)(n) : read track
  1547.    >t (s)(s)(n) : write track
  1548.    <s (s)(s)(n) : read sector
  1549.    >s (s)(s)(n) : write sector
  1550.    >f (n)       : format disk
  1551.  
  1552.  
  1553.    Set Drive:
  1554.  
  1555.    The 'D' command is used to set the drive number that is used for further
  1556.    diskoperations (tracks, sectors or format, but not fot file operations!)
  1557.    or to ask for the actually used drive or to ask for the position of the
  1558.    head of a drive:
  1559.  
  1560.    - D [n] : Takes drive n (0-3) as actual drive
  1561.  
  1562.    - D : Shows actual drive
  1563.  
  1564.    - D? [n] : finds position of head of drive n
  1565.  
  1566.    - D? : finds position of head of actual drive
  1567.  
  1568.    The headposition is reported as logical track, the sideselect bit will be
  1569.    concidered when calculating the position. Well, in most cases (DOS included)
  1570.    the sideselect bit will be set directly before DMA access and put to an
  1571.    undefined state afterwards. If that is so when you use this command, you
  1572.    must find the side that is used on your own, analyze the diskroutines.
  1573.  
  1574.  
  1575.    Read Track:
  1576.  
  1577.    The '<t' command simply reads entier logical tracks (0-159) somewhere into
  1578.    memory:
  1579.  
  1580.    - <t [s][t][n] : Reads n tracks starting with t to s
  1581.  
  1582.    - <t [s][t] : Reads one track t to s
  1583.  
  1584.    Well, SIM does not test where the data is read, you simly should not
  1585.    'overread' the display or SIM.
  1586.  
  1587.  
  1588.    Write Track:
  1589.  
  1590.    The '>t' command writes an area of the memory as logical tracks on disk:
  1591.  
  1592.    - >t [s][t][n] : Writes n tracks starting with t, data start at s
  1593.  
  1594.    - >t [s][t] : Writes one track t, data start at s
  1595.  
  1596.  
  1597.    Read Sector:
  1598.  
  1599.    With the '<s' command you can now read single sectors from disk to memory:
  1600.  
  1601.    - <s [s][b][n] : reads n sectors starting with b to s
  1602.  
  1603.    - <s [s][b] : reads one sector b to s
  1604.  
  1605.  
  1606.    Write Sector:
  1607.  
  1608.    With the '>s' command you can write single sectors from disk to memory:
  1609.  
  1610.    - <s [s][b][n] : writes n sectors starting with b, data start at s
  1611.  
  1612.    - <s [s][b] : writes one sector b, data start at s
  1613.  
  1614.    The sector writeroutine is clever enough. If you only write some
  1615.    sectors of a track, it reads the rest of them from disk to complete the
  1616.    track and writes the track afterwards.
  1617.  
  1618.  
  1619.    Format Disk:
  1620.  
  1621.    Because you can now save files, you may have to make a datadisk first.
  1622.    The '>f' command is used to format and initialize a disk:
  1623.  
  1624.    - >f [n] : Formats disk in drive n
  1625.  
  1626.    - >f : Formats disk in actual drive
  1627.  
  1628.    You can't yet enter a name for the disk, it will automatically be
  1629.    'DATA-DISK'. The creation date is zeroed too. But the DOS cannot seperate
  1630.    disks with the same name and same date. So never keep two datadisks
  1631.    in two drives simultaneously, your machine would crash if you do so.
  1632.  
  1633.    If you format a disk that was previously in a drive and you return to DOS,
  1634.    remove and reinsert that disk for the DOS must know the new name and new
  1635.    bitmap.
  1636.  
  1637.  
  1638.    EXAMPLES:
  1639.  
  1640.     <t c00000 0 80
  1641.     >t c00000 0 80
  1642.     >s 70000 0 2
  1643.     <s 60000 880
  1644.     D1
  1645.     D? 2
  1646.     >f 0
  1647.  
  1648.  
  1649.    Fileoperations
  1650.    --------------
  1651.  
  1652.    L [f][s]    : Load file
  1653.    S [f][s][e] : Save file
  1654.    V (path)    : List directory
  1655.  
  1656.  
  1657.    Paths and filenames can either be given plainly or between ' or ".
  1658.    The only devices known are DF0:, DF1:, DF2: and DF3:, disknames
  1659.    are not supported.
  1660.  
  1661.  
  1662.    Load File:
  1663.  
  1664.    This command loads a file directly into memory:
  1665.  
  1666.    - L [f][s] : Loads file f to s
  1667.  
  1668.    Just make sure that you don't load files over SIM or the display.
  1669.  
  1670.  
  1671.    Save file:
  1672.  
  1673.    With this command you can save an area of the memory as file:
  1674.  
  1675.    - S [f][s][e] : Saves memory from s to e as file f
  1676.  
  1677.    This command is also used to delete files. To do so simply save a file
  1678.    with the name of the file you want to delete and the same start- and
  1679.    endaddress (filelength=0).
  1680.  
  1681.    List Directory:
  1682.  
  1683.    This command is used to list the directory of a disk or a user directory.
  1684.  
  1685.    - V [path] : Lists directory of directory specified by path.
  1686.  
  1687.    - V : Lists directory of last drive used for fileoperations.
  1688.  
  1689.    SIM reads the directory page by page because the display is used as buffer.
  1690.    If a page is full or the directory is read, it displays it. If there stays
  1691.    stuff to be displayed, SIM writed 'more' in the footer. You can then continue
  1692.    by pressing <SPACE>
  1693.  
  1694.  
  1695.    EXAMPLES:
  1696.  
  1697.     L 'df0:c/dir' 60000
  1698.     S df1:data 0 100
  1699.     V df0:c
  1700.  
  1701.  
  1702.    Miscellaneous
  1703.    -------------
  1704.  
  1705.    ? [n]{,}(n) : Calculate
  1706.    F (n)(c){@} : Define functionkeys
  1707.    P (s)(m)    : Start graphic searcher
  1708.    s (p)(b)(c) : Set display, backup and program addresses
  1709.    l*          : Show copperlist
  1710.    l? (s)(e)   : Find active copperlist
  1711.    l= [n]      : Find copperlist one or two
  1712.  
  1713.  
  1714.    Calculator:
  1715.  
  1716.    If you need to calculate something, you can do it with the '?' command.
  1717.    SIM will calculate the result of one or several terms and return the
  1718.    result(s) as hexadecimal, signed hexadecimal, decimal and binary number
  1719.    and as ascii chars:
  1720.  
  1721.    - ? [n] : calculate result of n
  1722.  
  1723.    You can calculate the result of several terms at the same time by seperating
  1724.    the terms by a komma.
  1725.  
  1726.  
  1727.    Functionkeys:
  1728.  
  1729.    The 'F' command is used to set and view the functionkeys functions:
  1730.  
  1731.    - F [n][c] @ : Occupys Fkey n with commandline c that is executed directly
  1732.    - F [n][c]   : Occupys Fkey n with text c
  1733.    - F [n]      : Clears Fkey n
  1734.    - F          : Lists Fkeys
  1735.  
  1736.    When you set a functionkey, the entier rest of the commandline will be
  1737.    taken for the command or text.
  1738.  
  1739.    When you list the functionkeys, the ones that are locked by Amiga-Fx are
  1740.    marked by an asterix, the directly executable have an '@' at the end.
  1741.  
  1742.  
  1743.    Graphic Searcher:
  1744.  
  1745.    The 'p' command starts the graphic searcher:
  1746.  
  1747.    - P [s][m] : Starts at address s with modulo m
  1748.    - P [s]    : Starts at address s with last modulo
  1749.    - P [s]    : Starts at last address with last modulo
  1750.  
  1751.    When you activated the graphic searcher, several keys are used for
  1752.    display modifications:
  1753.  
  1754.    Cursor up:         Scrolls plane one line down
  1755.  
  1756.    Cursor down:       Scrolls plane one line up
  1757.  
  1758.    Cursor left:       Scrolls plane one line right
  1759.  
  1760.    Cursor right:      Scrolls plane one line left
  1761.  
  1762.    Shift+Cursor up:   Scrolls plane one screen down
  1763.  
  1764.    Shift+Cursor down: Scrolls plane one screen up
  1765.  
  1766.    Help:              Modulo=modulo+2
  1767.  
  1768.    Del:               Modulo=modulo-2
  1769.  
  1770.    Shift+Help:        Modulo=modulo+16
  1771.  
  1772.    Shift+Del:         Modulo=modulo-16
  1773.  
  1774.    Backspace:         Modulo=0
  1775.  
  1776.    Return:            Switches between hires and lores
  1777.  
  1778.    Control:           Ends graphic searcher
  1779.  
  1780.    The graphic searcher should recognize additional chipmem at $80000
  1781.  
  1782.  
  1783.    SIM Addresses:
  1784.  
  1785.    The 's' command is used to transfer the display and backup and the SIM
  1786.    code itself:
  1787.  
  1788.    s [p][b][c] : New display at p, new backup at b and SIM copied to c
  1789.    s [p][b]    : New display at p, new backup at b and SIM stays where it is
  1790.    s [p]       : New display at p, backup and program stay where they are
  1791.    s           : Repaints the display
  1792.  
  1793.    The 's command will mostly be used to transfere the display at another
  1794.    location when you want to look at the memory where the display is.
  1795.  
  1796.    Be carefull when you transfer the SIM code. SIM does adjust breakpoint and
  1797.    traps to the new address. But a possible debug server will only know
  1798.    about the new location when you quit. The old copy of SIM will still work,
  1799.    but its breakpoint and trap system will be confused. Use it only when the
  1800.    system is dead. Also do not copy SIM below $70!
  1801.  
  1802.  
  1803.    Copperlist:
  1804.  
  1805.    The 'l' command is basically used to disassemble a copperlist. The
  1806.    following variations are used for different actions:
  1807.  
  1808.    - l*        : Shows the active copperlist
  1809.  
  1810.    - l? [s][e] : Starts to search for the copperlist from s to e
  1811.  
  1812.    - l? [s]    : Starts to search for the copperlist from s to $80000
  1813.  
  1814.    - l?        : Starts to search for the copperlist from $70 to $80000
  1815.  
  1816.    - l= [n]    : Starts to search quickly for copperlist 1 or 2
  1817.  
  1818.    To end copperlist display or searching, press <CTRL>.
  1819.  
  1820.    When you search quickly, the copperlist you are looking for will be
  1821.    activated. If this one is not the running one, search again for the other to
  1822.    set the other copperlist again.
  1823.  
  1824.  
  1825.    EXAMPLES:
  1826.  
  1827.    ? 256*5,52*56
  1828.    F10 r:dpc pc@
  1829.    F
  1830.    P 12356 52
  1831.    s 70000 c50000 c40000
  1832.    l*
  1833.    l=1
  1834.    l? 20000
  1835.  
  1836.  
  1837.  Debugger Window Support
  1838.  -----------------------
  1839.  
  1840.   A [s]    : Set new startaddress
  1841.   T [s]{@} : Set linkterm
  1842.  
  1843.  
  1844.   These two commands are used to set new startaddresses for the views of
  1845.   the debugger window.
  1846.  
  1847.  
  1848.   Startaddress:
  1849.  
  1850.   With this command you can directly set the startaddress of the active view:
  1851.  
  1852.   - A [s] : Set new startaddress of view to s
  1853.  
  1854.  
  1855.   Linkterm:
  1856.  
  1857.   To set a linkterm for a view, you use the 'T' command. SIM will calculate
  1858.   the result of this formula and use it as new startaddress each time it is
  1859.   entered:
  1860.  
  1861.   - T [s] @ : Set smart linkterm for active view
  1862.  
  1863.   - T [s] : Set simple linkterm for active view
  1864.  
  1865.   When SIM calculates a simple linkterm, it takes the result as new
  1866.   startaddress. The result of a smart linkterm is only used as new startaddress
  1867.   if it is not in the frame of the view. Normally this is only used to link
  1868.   a view to the PC.
  1869.  
  1870.  
  1871.   EXAMPLES:
  1872.  
  1873.   A a0+56
  1874.   T a0+d0
  1875.   T pc @
  1876.  
  1877.  
  1878.  
  1879.  4.4 The Debugger Window
  1880.  =======================
  1881.  
  1882.  
  1883.   This is one of the later achievements done. You can switch it on or off by
  1884.   pressing <esc>. When you do so, a part of the wortable is locked for the
  1885.   cursor and used to print out the registers and one or two different
  1886.   views of the memory in different forms (hex, ascii etc.). The window is
  1887.   updated as soon as you execute a command that may change the memory and
  1888.   at entry of SIM.
  1889.  
  1890.   The two views have two startaddresses that are stored in m0 and m1.
  1891.   m1 is unused when you did not splitt the window and use only one view.
  1892.  
  1893.   You can link the two views to two formulas, the socalled 'linkterms'.
  1894.  
  1895.  
  1896.  
  1897.  4.5 Debugger Window Shortcuts
  1898.  =============================
  1899.  
  1900.  
  1901.   If you have to deal with the window, you do this by use of shortcuts that
  1902.   are qualified by either left or right Amiga. If you splitted the window,
  1903.   you can select the view that recieves the command by pressing <TAB>.
  1904.  
  1905.  
  1906.  Window Handling
  1907.  ---------------
  1908.  
  1909.   <cursor up>     Decreases the views startaddress and scrolls the
  1910.                   content one line down. How much the startaddress is decreased
  1911.                   depends on what the window output form is:
  1912.  
  1913.                    - disassembly: the length of the instruction above the
  1914.                      startaddress.
  1915.                    - hexdump:     16 bytes.
  1916.                    - asciidump:   64 bytes.
  1917.                    - copperdump:  4 bytes.
  1918.  
  1919.   <cursor down>   Increases the views startaddress and scrolls the
  1920.                   content one line up. How much the startaddress is decreased
  1921.                   depends on what the window output form is:
  1922.  
  1923.                    - disassembly: the length of the instruction at the
  1924.                      actual startaddress.
  1925.                    - hexdump:     16 bytes.
  1926.                    - asciidump:   64 bytes.
  1927.                    - copperdump:  4 bytes.
  1928.  
  1929.   <cursor left>  Decreases the views startaddress one or two bytes:
  1930.  
  1931.                    - disassembly: two bytes.
  1932.                    - hexdump:     one byte.
  1933.                    - asciidump:   one byte.
  1934.                    - copperdump:  two bytes.
  1935.  
  1936.   <cursor right> Increases the views startaddress one or two bytes:
  1937.  
  1938.                    - disassembly: two bytes.
  1939.                    - hexdump:     one byte.
  1940.                    - asciidump:   one byte.
  1941.                    - copperdump:  two bytes.
  1942.  
  1943.   <shift cu>     Decreases the views startaddress and moves back to last
  1944.                  page, depending on the output form:
  1945.  
  1946.                    - disassembly: the sum of instruction lengths of the number
  1947.                      of instructions fitting the window back from the actual
  1948.                      startaddress.
  1949.                    - hexdump:     <number of lines>*16 bytes.
  1950.                    - asciidump:   <number of lines>*64 bytes.
  1951.                    - copperdump:  <number of lines>*4 bytes.
  1952.  
  1953.   <shift cd>     Increases the views startaddress and moves to next
  1954.                  page, depending on the output form:
  1955.  
  1956.                    - disassembly: sets startaddress to the address of the
  1957.                      instruction following the last one visible.
  1958.                    - hexdump:     <number of lines>*16 bytes.
  1959.                    - asciidump:   <number of lines>*64 bytes.
  1960.                    - copperdump:  <number of lines>*4 bytes.
  1961.  
  1962.   <alt cu>       Decreases the size of the debugger window by one line.
  1963.                  The minimum size is one line. The space that becomes free
  1964.                  for the monitor is cleared with spaces.
  1965.  
  1966.   <alt cd>       Increases the size of the debugger window by one line.
  1967.                  The maximum size is as large as there stays one line for the
  1968.                  monitor. If the cursor was in the line now belonging to the
  1969.                  debugger window, it is moved to the line below which is then
  1970.                  initialized.
  1971.  
  1972.   <shift alt cu> Works only when you splitted the window. This moves the bar
  1973.                  seperating the two views one line up, which decreases the
  1974.                  upper view and increases the lower view one line.
  1975.  
  1976.   <shift alt cu> Works only when you splitted the window. This moves the bar
  1977.                  seperating the two views one line down, which increases the
  1978.                  upper view and decreases the lower view one line.
  1979.  
  1980.   <s>            Splitts or unsplitts the window into two views. When you
  1981.                  unsplitt, the startaddress and linkterm of the active view
  1982.                  are taken as the one of the now single view, the ones of the
  1983.                  inactive view are stored and taken as the ones for the second
  1984.                  view when you splitt again.
  1985.  
  1986.   <r>            This recalculates the linkterm(s) and sets the
  1987.                  views startaddresses again.
  1988.  
  1989.  
  1990.   Output Form Selection
  1991.   ---------------------
  1992.  
  1993.   <a>            Selects asciidump for the active view.
  1994.  
  1995.   <m>            Selects hexdump for the active view.
  1996.  
  1997.   <l>            Selects copperdump for the active view.
  1998.  
  1999.   <m>            Selects disassembly for the active view.
  2000.  
  2001.  
  2002.   Breakpoints
  2003.   -----------
  2004.  
  2005.   <b>            Sets a simple Illegal breakpoint at the startaddress of
  2006.                  the active view.
  2007.  
  2008.   <v>            Sets a resident Illegal breakpoint at the startaddress of
  2009.                  the active view.
  2010.  
  2011.   <B>            Sets a JSR-breakpoint at the startaddress of the active view.
  2012.  
  2013.  
  2014.   Flow
  2015.   ----
  2016.  
  2017.   <z>            Does a tracestep.
  2018.  
  2019.   <u>            Does a nextstep that does not follow into subroutines.
  2020.  
  2021.   <i>            Leaves out one instruction/puts pc to next instruction.
  2022.  
  2023.   <x>            Exits SIM.
  2024.  
  2025.   <q>            Exits SIM and goes back to debug server.
  2026.  
  2027.   <g>            Leaves a subroutine. Therefore SIM puts a STACK-breakpoint at
  2028.                  the actual stackpointer and exits. Do not use this when the
  2029.                  subroutine has allready put more data on the stack.
  2030.  
  2031.   <j>            Sets the pc to the startaddress of the active view.
  2032.  
  2033.  
  2034.   Edit
  2035.   ----
  2036.  
  2037.   <e>            Starts to edit in loopmode at the startaddress of the
  2038.                  active view.
  2039.  
  2040.   <n>            Starts to assemble in loopmode at the startaddress of the
  2041.                  active view.
  2042.  
  2043.   <N>            Replaces the Instruction at the startaddress of the active
  2044.                  view by NOPs.
  2045.  
  2046.  
  2047.   Indirects
  2048.   ---------
  2049.  
  2050.   <[>            Goes to next higher indirectlevel and takes the longword
  2051.                  at the startaddress of the active view as the new
  2052.                  startaddress and stores the old one.
  2053.  
  2054.   <]>            Goes to last indirectlevel and takes the stored
  2055.                  startaddress as the new one.
  2056.  
  2057.   <{>            Same as <[> but the longword will be taken as BCPL and
  2058.                  multilied by four.
  2059.  
  2060.   <}>            Goes to next higher indirectlevel and takes the stored
  2061.                  address of that one as the new startaddress.
  2062.  
  2063.  
  2064.   Find
  2065.   ----
  2066.  
  2067.   <f>            Continues to search at the startaddress of the active
  2068.                  view.
  2069.  
  2070.   <c>            Continues to compare. The source address will be the
  2071.                  startaddress of the first view , the destination address
  2072.                  the  startaddress of the second view.
  2073.  
  2074.  
  2075.   Miscellaneous
  2076.   -------------
  2077.  
  2078.   <p>            Toggles the printer on/off. The printer can only be
  2079.                  activated if there is an active one connected to the parallel
  2080.                  port.
  2081.  
  2082.   <h>            Makes a hardcopy of the actual display by printing it as
  2083.                  text.
  2084.  
  2085.   <k>            Toggles between US keymap and custom keymap (originally CH)
  2086.  
  2087.   <!>            Flushes keystatefield, see chapter 'the keyboard'.
  2088.  
  2089.   <?>            Toggles keyboardbuffer killer, see chapter 'the keyboard'
  2090.  
  2091.   <\>            Toggles Auto-Unmodify Traps. When this feature is switched
  2092.                  on, all modified traps are set again when you leave SIM.
  2093.  
  2094.   <F1-F10>       Toggles availability of funktionkeys.
  2095.  
  2096.   <0-9>          Takes one of the ten position memories as the startaddress
  2097.                  of the active view.
  2098.  
  2099.   <shift 0-9>    Works only with the keypad! Stores the startaddress of the
  2100.                  active view in one of the ten position memories.
  2101.  
  2102.  
  2103.   Most of these shortcuts are only functioning when the debugger window is
  2104.   activated. Only  <h>,<p>,<!>,<?>,<F1-F10>,<k>,<z>,<u>,<i>,<q> and <x>
  2105.   are allways functioning.
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111. *******************************************************************************
  2112.  5. Additional Information
  2113. *******************************************************************************
  2114.  
  2115.  
  2116.  
  2117.  Assembler and Calculator Syntax
  2118.  ===============================
  2119.  
  2120.  
  2121.   The assembler used in SIM is entierly home-made and is fully
  2122.   motorola compatible. Anyway, some special features have been added
  2123.   to increase userfriendlyness:
  2124.  
  2125.   - You can use 'add' instead of 'addi', 'adda' and 'addx -(ax),-(ay)'
  2126.     This is also valuable for 'sub'.
  2127.  
  2128.   - 'cmpm', 'cmpi' and 'cmpa' can be replaced by 'cmp'
  2129.  
  2130.   - You can use 'eor' instead of 'eori'. This also works with 'and' and 'or'
  2131.  
  2132.   - Bcc xxxx, DBcc Dx,xxxx, xxxx(PC) and xx(PC,Rx) use absoulute addresses.
  2133.     This means that when you want to have a code like
  2134.  
  2135.             60010: bra $60000
  2136.  
  2137.    you can enter 'bra $60000'. If you want to give the offset directly,
  2138.    you have to put a '+' or a '-' in front of it:
  2139.  
  2140.             60010: bra -$12
  2141.  
  2142.     But remember: The Offset has allways to be:
  2143.  
  2144.             (targetaddress-instructionaddress+2)
  2145.  
  2146.   - If no size is given, Bcc will be short if possible.
  2147.  
  2148.   - If no size given, direct addresses are word if possible.
  2149.  
  2150.   - DC.W or DC.L can be used, but only one value is allowed.
  2151.  
  2152.   - If you do not give an instruction size, the default size is
  2153.     taken, which in most cases is WORD.
  2154.  
  2155.   - The interpreter is very tollerant, even a line like
  2156.  
  2157.         move.l    (  $75 ) (   PC  , D7.l  )  , ( $4 ).w
  2158.  
  2159.     will be accepted and assembled correctly.
  2160.  
  2161.  
  2162.  
  2163.                              -------------------
  2164.  
  2165.  
  2166.  
  2167.   The calculator used in SIM is also entierly home-made. It disposes
  2168.   of several very useful operations and value forms. The calculator is used
  2169.   when you have to enter a number. Just have an overview of the operations
  2170.   supported, sorted by their priority:
  2171.  
  2172.    -   - Prefix change: Changes a positive value to a negative and vice
  2173.          versa.
  2174.  
  2175.    ~   - Logical NOT: Changes the state of all 32 bits of the value.
  2176.          For example: ~5 is -6.
  2177.  
  2178.    .s  - Size a value: Any value will be extended to LONG from the size you
  2179.          define. For example: $89.b will then be made to $ffffff89.
  2180.  
  2181.          The size given is also important for the assembler when using direct
  2182.          long or short address.
  2183.  
  2184.    []  - A value in these brackets will be used as an address and the
  2185.          content of the memory at that address will be taken.
  2186.  
  2187.          A size directly after the closing bracket will define if
  2188.          the value will be taken as a BYTE, WORD or LONG and extended
  2189.          to LONG. For example: [4].l gets the execbase ($676 or $c00276)
  2190.          [$dff002].w reads out the actual DMACON as a WORD.
  2191.  
  2192.    *,/ - Multiply or divide long, considering if the values are positiv
  2193.          or negativ. For example: -$56*5 is fffffe52.
  2194.  
  2195.    \   - Gets the modulo of a long division. For example: 11\4 is 3.
  2196.  
  2197.    +,- - Addition or Subtraction, allways long.
  2198.  
  2199.    <<  - Shift value left: this corresponds to a multiplication with 2
  2200.          to the nth power, whereas n is the numer of bits to be shifted.
  2201.          For example: $20<<8 is $2000.
  2202.  
  2203.    >>  - Shift value right: this corresponds to a division by 2
  2204.          to the nth power, whereas n is the numer of bits to be shifted.
  2205.          For example: $2000>>8 is $20.
  2206.  
  2207.    &   - Logical AND.
  2208.  
  2209.    !   - Logical Exlusive OR
  2210.  
  2211.    |   - Logical OR
  2212.  
  2213.    <>  - Not equal: If the two values are not equal, this returns true
  2214.          (=$ffffffff), otherwise false (=0).
  2215.  
  2216.    =   - Equal: If two vales are equal, this returns true.
  2217.  
  2218.    <=  - Less or equal: Returns true, if the first value is less than
  2219.          the other or at least equal.
  2220.  
  2221.    =>  - Higher or equal: Returns true, if the first value is higher than
  2222.          the other or at least equal.
  2223.  
  2224.    >   - Higher: Returns true, if the first value is higher than the other.
  2225.  
  2226.    <   - Less: Returns true, if the first value is less than the other.
  2227.  
  2228.  
  2229.    As for the forms of values, SIM understands these:
  2230.  
  2231.  
  2232.    $x  - Hexadecimal number: A number in hexadecimal form
  2233.                              consisting of max. 8 digits 0-9 and a-f.
  2234.  
  2235.    #x  - Decimal number: A number in decimal form
  2236.                          consisting of digits 0-9.
  2237.  
  2238.    %x  - Binary number: A number in binary form
  2239.                         consisting of max. 32 digits 0 and 1.
  2240.  
  2241.    "/' - ASCII chars: A number consisting of max. 4 ASCII chars.
  2242.          f.e.: "SIM!" or '!MIS'
  2243.  
  2244.    !   - Stands for the last result. This enables you to do things
  2245.          like: m 61f35 !+39dc = "Show memory from $61f35 to $61f35
  2246.          plus 39dc".
  2247.  
  2248.    @   - Stands for the actual address. This is the address, SIM uses as
  2249.          standart workaddress for dump commands.
  2250.  
  2251.    SIM - The program and base address of SIM
  2252.  
  2253.    D0-D7,A0-A7,PC,SP,SSP,USP,SR,CCR and M0-M7 - The registers. The calculator
  2254.          can directly use the content of these registers. SSP is the supervisor
  2255.          stack pointer, USP the userstack pointer SP and A7 the actual stack
  2256.          pointer. I.E. when you are tracing a program, and you want to know,
  2257.          what is at the address  56(a0,d7.w), you can use 'm 56+a0+d7.w'.
  2258.  
  2259.  
  2260.   The end of a term is usualy set by a space, a komma, a semikolon, a
  2261.   doubble point or a <CR>. Actually, when you have opened a bracket, you
  2262.   can have spaces between operators and values, but ONLY then. Otherwise, the
  2263.   end of the term will not be there where you wanted.
  2264.  
  2265.   Not to forget: some 120 brackets are allowed, more than you will ever use.
  2266.  
  2267.   Actually the calcualtor can work in decimal or hexadecimal mode.
  2268.   In decimal mode you do not have to write the '#' before a decimal number,
  2269.   but for hexadecimal numbers, the '$' is neccessary.
  2270.   In hexadecimal mode you do not have to write the '$' before a hexadecimal
  2271.   number, but for decimal numbers, the '#' is neccessary.
  2272.  
  2273.   Hexadecimal mode is usually used to get addresses (s,e,t,b,p)
  2274.   or hexnumbers (x). For all other cases decimal mode is used, also for
  2275.   assembler.
  2276.  
  2277.  
  2278.  
  2279.  5.2 Line Forms
  2280.  ==============
  2281.  
  2282.  
  2283.   There are two types of lines you have to differe: the command line
  2284.   and the data line.
  2285.  
  2286.   - The command line is the one that contains the different commands
  2287.     you want to execute. This line has usualy that form:
  2288.  
  2289.               .<command> <options> (: <command> <options> ...)
  2290.  
  2291.     You see, you can enter several commands in one line, seperated by a
  2292.     doubble point. The doubble point is needed, except if the next char is
  2293.     the same as of the last executed command (i.e. 'mmmm' is allowed and shows
  2294.     $200 bytes at once, starting at the actual address).
  2295.  
  2296.  
  2297.   - The data line is of another kind. Whenever you have to enter datas
  2298.     directly, for edit, find, occupy etc., you enter a data line. This
  2299.     dataline can consist of this four elements, allways seperated by a komma:
  2300.  
  2301.    - Hexnumbers: Are introduced with or without '$'. They can be as long as
  2302.      you want. The hexnumber is ended by a char that is no number and
  2303.      not 'A','B','C','D','E' or 'F' (lower case letters also included)
  2304.      If you enter an odd number of digits, the last digit will be taken as
  2305.      byte, its higher nibble zeroed. Spaces are allowed between digits.
  2306.  
  2307.    - Assembler instructions: Are initiated by a 'n', then the instruction
  2308.      follows.
  2309.  
  2310.    - Calculator terms: Are initiated by a '?', then the term follows.
  2311.      The size of the result will be considered (LONG=4 bytes,WORD=2 bytes
  2312.      and BYTE=1 byte).
  2313.  
  2314.    - Ascii chars: Are either initiated by ' or " and closed with the
  2315.      same or a <CR>.
  2316.  
  2317.  
  2318.      Now an example, using all the elements from above. You enter:
  2319.  
  2320.        45,"BDH",njmp $60000,?[$fc0000].w,6666
  2321.  
  2322.      And the result are these 14 bytes:
  2323.  
  2324.        45  42 44 48  4e f9 00 06 00 00  11 11        66 66
  2325.        |-  |-------  |----------------  |----        |----
  2326.        |   |         |                  |            |
  2327.        45  "BDH"     jmp $60000         [$fc0000].w  6666
  2328.  
  2329.  
  2330.    A dataline ends at a space or an illegal char. Between the komma that
  2331.    seperates two datatypes and the next datatype there can be spaces. also
  2332.    between hexdigits (only when editing, not find and occupy).
  2333.  
  2334.  
  2335.  
  2336.  5.3 The Debug Server Entrance
  2337.  =============================
  2338.  
  2339.  
  2340.   The debug server entrance is specially concieved for the cooperation
  2341.   between SIM and another debugger or loader, i.e. SIM-BUG. It enables
  2342.   The debug server to give control over a program to SIM and SIM to return
  2343.   control to the debug server.
  2344.  
  2345.   How this is done? Well, in a part of the SIM base, there is space to store
  2346.   the registers d0-a6, USP and SSP, SR and PC of the program that is
  2347.   monitored. The debug server can fill in this table. Additionally, It can
  2348.   specifie a reentry PC, SR, USP and SSP. When it enters SIM by the debug
  2349.   server entrance, SIM takes the registers out of the table and copies them
  2350.   into the workregister buffer. SIM has now the control over the program.
  2351.  
  2352.   Now, when you are in SIM and want to give control back to the debug
  2353.   server, you can use the 'q' command (or 'Q' or AMIGA-q). SIM does then
  2354.   copy the workregisters back into the base area and takes the reentry PC, SR
  2355.   USP and SSP as the actual ones. To be sure that the debug server is still
  2356.   there, SIM looks at the address <reentrypc-4> if the longword $4f4b4159
  2357.   ("OKAY") is there. If the longword is there, it exits. That way, it returns
  2358.   to the address specified by the reentry PC with reentry stacks and a reentry
  2359.   SR. The registers do not contain sencefull information, appart a6 which
  2360.   contains the base/codeaddress of SIM. In case you transfered SIM, the
  2361.   debug server knows where you put it.
  2362.  
  2363.   The debug server can now read out the table with the registers and use
  2364.   them for itself.
  2365.  
  2366.  
  2367.  
  2368.  5.4 The SIM Base
  2369.  ================
  2370.  
  2371.  
  2372.   At the start of the SIM program, the differente entrances are located,
  2373.   the backups and reentry values and the debug server datastructure. The
  2374.   structure of this base is documented here. The offsets described won't
  2375.   be changed in higher versions, I hope, but I feel free to extend it at
  2376.   the upper end.
  2377.  
  2378.  
  2379. --------------------------------------------------------------------------------
  2380.  The S.I.M. Base Structure
  2381. --------------------------------------------------------------------------------
  2382.  
  2383. ;--- Base ---------
  2384.  
  2385.  struct toolbase       ;+0  The startadress of S.I.M. in memory
  2386.  
  2387.  
  2388. ;--- Display ------
  2389.  
  2390.  aptr  plane           ;+0  The startaddress of the $5000 bytes display ram
  2391.                             (must be chipmem!)
  2392.  aptr  backup          ;+4  The startaddress for the backup of the display.
  2393.                             When not zero, S.I.M. will copy what is in the
  2394.                             memory of the future display to this part of memory
  2395.                             when entered and copy it back when left.
  2396.  
  2397.  
  2398. ;--- Entrances ----
  2399.  
  2400.  jmp   entrance1       ;+8  Entrance for JSR. Here you can simply enter S.I.M.
  2401.                             by a 'JSR to this address.
  2402.  jmp   entrance2       ;+12 Entrance for Exec's traphandle. When you want to
  2403.                             use S.I.M. as traphandler of your task, write this
  2404.                             address to <taskstruct+50>.
  2405.  jmp   entrance3       ;+16 Debug server entrance.
  2406.  
  2407.  long  0               ;+20 *** RESERVED FOR EXPANSION ***
  2408.  
  2409.  
  2410. ;--- Our Traps ----    ;When a trap is set directly, its vector is set to
  2411.                         the corresponding entrance in here.
  2412.  
  2413.  jmp   entrance22      ;+24 Bus error
  2414.  jmp   entrance23      ;+28 Address error
  2415.  jmp   entrance24      ;+32 Illegal instruction
  2416.  jmp   entrance25      ;+36 Divide-by-zero
  2417.  jmp   entrance26      ;+40 CHK instruction
  2418.  jmp   entrance27      ;+44 TRAPV instruction
  2419.  jmp   entrance28      ;+48 Privilege violation
  2420.  jmp   entrance29      ;+52 Trace
  2421.  jmp   entrance2a      ;+56 Op Code 1010
  2422.  jmp   entrance2b      ;+60 Op Code 1111
  2423.  
  2424.  
  2425. ;--- Signal -------
  2426.  
  2427.  long  "SIM!"          ;+64 This Long signals that this is S.I.M.
  2428.  long  version         ;+68 Version of S.I.M. as 4 ASCII chars
  2429.  
  2430.  
  2431. ;--- Backups ------    ;when S.I.M. is entered it backups some customregisters
  2432.                         and vectors here.
  2433.  
  2434.  word  dmacon          ;+72 $DFF096/002
  2435.  word  intena          ;+74 $DFF09A/01C
  2436.  word  intreq          ;+76 $DFF09C/01E
  2437.  long  level2          ;+78 $68
  2438.  long  level3          ;+82 $6C
  2439.  
  2440.  byte  ciaacra         ;+86 $BFEE01
  2441.  byte  ciaacrb         ;+87 $BFEF01
  2442.  byte  ciabcra         ;+88 $BFDE00
  2443.  byte  ciabcrb         ;+89 $BFDF00
  2444.  byte  ciaapra         ;+90 $BFE001
  2445.  byte  ciaaprb         ;+91 $BFE101
  2446.  byte  ciaaddra        ;+92 $BFE201
  2447.  byte  ciaaddrb        ;+93 $BFE301
  2448.  byte  ciabddra        ;+94 $BFD200
  2449.  byte  ciaasp          ;+95 $BFEC01
  2450.  long  vpos            ;+96 $DFF004
  2451.  
  2452. ;--- Reentry ------    ;Reentry values of things that can't be saved.
  2453.                         When S.I.M. is left, it inits the registers named
  2454.                         with the values in this list.
  2455.  
  2456.  word  $2981           ;+100 DIWSTRT
  2457.  word  $29c1           ;+102 DIWSTOP
  2458.  word  $0038           ;+104 DDFSTRT
  2459.  word  $00d0           ;+106 DDFSTOP
  2460.  word  $5200           ;+108 BPLCON0
  2461.  word  $0000           ;+110 BPLCON1
  2462.  word  $0000           ;+112 BPLMOD1
  2463.  word  $0000           ;+114 COLOR00
  2464.  word  $0000           ;+116 COLOR01
  2465.  
  2466. ;--- ICR Special --    ;The ICR data and mask.
  2467.  
  2468.  byte  lasticr         ;+118 $BFED00 read
  2469.  byte  reentryicrmask  ;+119 $BFED00 write
  2470.  
  2471. ;--- Distances ----    ;Distances to internal structures.
  2472.  
  2473.  long  disasscalc-base ;+120 Distance to disasscalc module
  2474.  long  preferences-base;+124 Distance to preference structure
  2475.  
  2476. ;--- Debug --------    ;Debug server structure for entrance 3.
  2477.  
  2478.  long  0               ;+128 Offset from base to end of inited part
  2479.  long  "????"          ;+132 Sign of server
  2480.  
  2481. ;--- Program ------    ;The registers of the program that is debugged.
  2482.  
  2483.  long  0               ;+136 Register d0
  2484.  long  0               ;+140 Register d1
  2485.  long  0               ;+144 Register d2
  2486.  long  0               ;+148 Register d3
  2487.  long  0               ;+152 Register d4
  2488.  long  0               ;+156 Register d5
  2489.  long  0               ;+160 Register d6
  2490.  long  0               ;+164 Register d7
  2491.  long  0               ;+168 Register a0
  2492.  long  0               ;+172 Register a1
  2493.  long  0               ;+176 Register a2
  2494.  long  0               ;+180 Register a3
  2495.  long  0               ;+184 Register a4
  2496.  long  0               ;+188 Register a5
  2497.  long  0               ;+192 Register a6
  2498.  long  0               ;+196 User stack pointer
  2499.  long  0               ;+200 Supervisor stack pointer
  2500.  long  0               ;+204 PC of program
  2501.  word  0               ;+208 SR of program
  2502.  
  2503. ;--- Server data --
  2504.  
  2505.  long  0               ;+210 Reentry routine of server
  2506.  long  0               ;+214 Reentry usp of server
  2507.  long  0               ;+218 Reentry ssp of server
  2508.  long  0               ;+222 Reentry sr of server
  2509.  
  2510. ;--- Extension ----
  2511.  
  2512.  aptr  0               ;+224 Pointer to zero ended list of aptrs that point
  2513.                              to zero ended texts. The texts in this list are
  2514.                              printed and the pointer is cleared
  2515.  aptr  0               ;+228 Pointer to task structure, currently unused
  2516.  aptr  0               ;+232 Segmentlist, currently unused
  2517.  aptr  0               ;+236 Symbollist with labels, currently unused
  2518.  
  2519. ;--- End ----------    ;+240 This is the end of the actual structure
  2520.  
  2521. --------------------------------------------------------------------------------
  2522.  
  2523.  
  2524.  
  2525.  5.5 Errors
  2526.  ==========
  2527.  
  2528.  
  2529.  SIM is a flexible tool. Therefore the user can do many mistakes.
  2530.  In this chapter, all errors are explained. When an error occurs that
  2531.  bases on an error in the command line (which in fact is in most cases so)
  2532.  SIM prints the error text in the line of the cursor and copies the command
  2533.  line in the next line. The cursor is in the line of the copied command line
  2534.  below the char or the word that probably caused the error.
  2535.  
  2536.  
  2537.  Assembler errors:
  2538.  
  2539.    illegal instruction:
  2540.      The assembler does not know this instruction.
  2541.  
  2542.    illegal value:
  2543.      An number is higher or less than it should be.
  2544.  
  2545.    illegal ea:
  2546.      This 'effective address' is not allowed. In fact it has not allways
  2547.      to be an effective address for the assembler uses the same routine for
  2548.      all source- and destinationterms.
  2549.  
  2550.    illegal size:
  2551.      An instruction has either no size at all or does not support the
  2552.      one you have given.
  2553.  
  2554.    illegal operator:
  2555.      An operator is not just as it should be.
  2556.  
  2557.    line malformed:
  2558.      Something is undefinably wrong.
  2559.  
  2560.    too few info:
  2561.      Some part of this instruction is missing.
  2562.  
  2563.    illegal sea:
  2564.      An illegal effective address as source.
  2565.  
  2566.    illegal tea:
  2567.      An illegal effective address as destination.
  2568.  
  2569.    illegal char:
  2570.      The assembler is suprised to find that char.
  2571.  
  2572.    illegal condition:
  2573.      The condition of a Bcc, DBcc or Scc is inexistent.
  2574.  
  2575.    illegal direction:
  2576.      The direction for bitshifting is neither left nor right.
  2577.  
  2578.  
  2579.  Calculator errors:
  2580.  
  2581.    bracketerror:
  2582.      You have opened more brackets than you closed or vice versa.
  2583.  
  2584.    overflow:
  2585.      The result is larger than $ffffffff or ▒$8000000, or you
  2586.      have divided by zero or you do more than 30 operations.
  2587.  
  2588.    illegal value:
  2589.      The calculator cannot interprete that as a number.
  2590.  
  2591.    illegal operator:
  2592.      This is no operator for mathematical operations supported by the
  2593.      calculator.
  2594.  
  2595.    no value given:
  2596.      You have forgotten to give a term, or the very first value of an
  2597.      expected term is of an unknown type.
  2598.  
  2599.  
  2600.  SIM errors:
  2601.  
  2602.    too much:
  2603.      The startaddres given for a command is higher than the endaddress.
  2604.  
  2605.    breakpointerror:
  2606.      SIM has no more breakpoints free or it could not set a breakpoint there,
  2607.      either because ROM is read only or it is not possible to put breakpoints
  2608.      in the memory presently occupied by the SIM code.
  2609.  
  2610.  
  2611.  Diskaccess errors:
  2612.  
  2613.   disk error:
  2614.     Something went wrong with the diskaccess, either the track that is read
  2615.     is damaged or the disk was writeprotected. In most cases you will get a
  2616.     warning in the statusline of the diskaccess display.
  2617.  
  2618.   file not found:
  2619.     SIM could not locate the file you want to load or a directory in its path.
  2620.  
  2621.   not enough space:
  2622.     When you want to save a file, SIM first checks if the file would fit.
  2623.     If it wouldn't, this error is returned.
  2624.  
  2625.   disk full:
  2626.     That error should not occure.
  2627.  
  2628.   directory error:
  2629.     If something goes wrong in the line of the listing of the directory,
  2630.     i.e. bad hashes or disk damaged, this error is returned.
  2631.  
  2632.   illegal path:
  2633.     SIM cannot locate the directory you want to list.
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639. *******************************************************************************
  2640.  6. Greetings, Thanks, Support and about Future Releases
  2641. *******************************************************************************
  2642.  
  2643.  
  2644.  
  2645.  6.1 Thanks
  2646.  ==========
  2647.  
  2648.  
  2649.   Big thanks must go to my friend Daniel Weber for continuous testing of all
  2650.   new features I inserted, some good and some bad ideas and severe criticism
  2651.   of all the work I did.
  2652.  
  2653.   Thanks must also go to all the other people who reported me their ideas
  2654.   and gave bugreports:  Christian Schneider, AndrΘ Dietisheim, Oliver Fehrlin,
  2655.   Stefan Strasser.
  2656.  
  2657.   Also to Yello, Depeche Mode, Kitaro, Star Inc., Mike Oldfield, Guru Josh,
  2658.   Enigma, New Order, Vangelis, J.M. Jarre, Harold Faltermeyer, Art of Noise,
  2659.   Alan Parson Project, Die Toten Hosen and Megatron for cool background music.
  2660.  
  2661.  
  2662.  
  2663.  6.2 Greetings
  2664.  =============
  2665.  
  2666.  
  2667.   Greetings go to all members of my crew, to my few contacts, to the makers of
  2668.   Amiga Action Replay (especially Lord Olaf), to SCA (for the RomCrack),
  2669.   to Graftgold for converting Rainbow Islands and to all Beerbrewers (for
  2670.   beeing).
  2671.  
  2672.  
  2673.  
  2674.  6.3 Support
  2675.  ===========
  2676.  
  2677.  
  2678.   The following is a short list of products supporting SIM.
  2679.  
  2680.         - FlyMon (assembler monitor)
  2681.  
  2682.         - NOG2   (trap- and exceptionhandler)
  2683.  
  2684.         - ProAsm (integrated editor/assembler/debugger)
  2685.  
  2686.         - SIMBUG (SIM loader)
  2687.  
  2688.   You are welcome to contact me if you want detailed information about how to
  2689.   support SIM correctly in your own programs. If you code a program that will
  2690.   support SIM, you are also welcome to tell me so, not only because the list
  2691.   would become longer, but also because the tools that may dispose of SIM
  2692.   support are surely of a kind I like and will use.
  2693.  
  2694.  
  2695.  
  2696.  6.4 About Future Releases
  2697.  =========================
  2698.  
  2699.  
  2700.   Version 1.51 is definitely not the ultimate release of SIM, there is a lot
  2701.   of room for improvements and new features. My intention is to make a version
  2702.   2.00, a realy final one that will be PERFECT. Unfortunately, I will not have
  2703.   much time for that until July 1991, it may take quite some time for it to be
  2704.   released. The People who send me the money for this version, and only those,
  2705.   will get it as soon as its finished.
  2706.  
  2707.   If you have questions, bugreports, ideas for new features or complaints or
  2708.   if you simply want to contact me, write to:
  2709.  
  2710.                                Stefan Walter
  2711.                             Finsterruetistr. 57
  2712.                                8135 Langnau
  2713.                                 SWITZERLAND
  2714.  
  2715.   Or dial Switzerland/01/713 01 46, from 18.oo to 20.oo.
  2716.  
  2717.  
  2718.                                                Enjoy!
  2719.  
  2720.                                                  Stefan Walter      27.Jan.1991
  2721.  
  2722.  
  2723.