


-------------------------------------------------------------------------------

        *******      ****         ******        *     *          *******
         * * *      **  **          **          **   **           * * *
          *****     ***             **          *** ***          *****
           * *       ***            **          *******           * *
            ***        ***          **          ** * **          ***
             *      **  **   **     **     **   **   **   **      *
              *      ****    **   ******   **   **   **   **     *

                           System Independent Monitor

                      Copyright (c) 1990 by Stefan Walter
                              ALL RIGHTS RESERVED

-------------------------------------------------------------------------------


                           S.I.M. Short Manual
                    refering to version 0.50 of S.I.M.
                released on the 10th of September in 1990


  Welcome programmer.

    S.I.M. is a high performance monitor and debugger that works on every
    68000er AMIGA. It is totally independent of the system and will work
    perfectly well at any time you invoke it. It also tries to be as discreete
    as possible (does not change CIA, copper or blitter registers etc.)
    Therefore you may use this program as debugger for intros and games,
    to tinker with the task- and memorylist, to save important data on
    disk or as an exception handler.
 
    This short information file referes to version 0.50 of S.I.M.
    S.I.M. 0.50 can be used, copied, supported and distributed freely,
    provided that:

        1)   No fee is charged for copying and distribution.
        2)   It is distributed ONLY in its original, unmodified state.
        3)   This document is copied along with the program.

    S.I.M. v0.50 is only a much simplified prerelease of S.I.M. v1.26 (the
    latest version at this moment). If you want to get the newest version
    with lesser bugs, including sector and fileoperations, improved find-
    and tracemechanisms, history, debugger windows, graphic searcher, NTSC
    support and much, much more, along with an EXPLICIT documentary file
    and some tools (SIMBUG 1.00, Patchprogram etc.) on a 3.5 zoll disk,
    send 20SFr., 25DM or 15US$ to:


                               Stefan Walter
                            Finsterruetistr. 57
                              CH-8135 Langnau

                       Tel. Switzerland/01/713 01 46


    Bug reports, complaints, ideas for improvements, missing features, new
    ideas, questions, software etc. may also be send or addressed to the
    address above.

    If you put S.I.M. on one of your own toolcollections or PD-disks, please
    send me a copy.

                                                        enjoy!


    S.I.M. Version 0.50 Short Command Overview         
--------------------------------------------------------------------------------
    a  (s)(e)           :show memory as ascii (from s (to e))
    b                   :list all breakpoints
    bj [s]              :set 'jsr' breakpoint at s
    bs [s]              :set user stack breakpoint
    bv [s]              :set supervisor stack breakpoint
    b  [s](j)           :set illegal breakpoint at s (with jokers, see below)   
       *                :make resident breakpoint
       [n]              :make counter breakpoint
       ?[expr.]         :make condition breakpoint
       j or l or r      :make breakpoint that breaks when button pressed
    b  [s]              :kill any breakpoint at s
    c  [s][e][t](j)     :compare from s to e with t (with jokers, see below)
       + or - [n]       :compare every nth byte, as- (s<e) or descending (s>e)
       *                :report the equal bytes, not the differing ones
    c  [s][t]           :set source and target addresses new and continue
    c  [s]              :set source address new and continue
    c                   :continue compare
    d  (s)(e)           :show disassembly of memory (from s (to e))
    e  (s)[d]           :edit memory directly at s
    e  (s)              :start to edit in loopmode (at s)
    e> [s](d)           :edit in loopmode
    f  [s][e](j)(d)(m)  :find data (with jokers, same as used for compare)
                        :from s to e (with mask m)
    f  [s][e]           :find same data from s to e
    f  (s)              :continue find (at s)
    f  [s][e](j) i [i]  :find disassembly (with jokers)
    g  [s]              :go to subroutine at s
    i  (n)              :leave out (n) instructions
    l  (s)(e)           :disassemble copperlist (from s (to e))
    l*                  :activate running copperlist
    l? (s)(e)           :search for active copperlist (from s (to e))
    m  (s)(e)           :show memory as hex/ascii (from s (to e))
    n  (s)[i]           :assemble instructions directly at s
    n  (s)              :start to assemble in loopmode at s
    n> [s](i)           :assemble in loopmode
    o  [s][e][d]        :occupy memory from s to e with data d
    p                   :activate/disactivate printer
    q                   :return to debug server (confirm before quit)
    r                   :show all registers
    r  [r][x]           :set register r with value x
    s  (p)(b)           :set display (and backup)
    s                   :repaint display
    t  [s][e][t]        :transfer memory from s to e at t
    u                   :do next step (don't follow jsr and bsr)
    w                   :show state of all traps
    w  [x],(x)          :set/clear or forget state of trap x
    x                   :continue program (confirm before exit)
    z  (j)              :tracestep (with jokers, see below)
       [n]              :do n tracesteps
       *[x]             :trace till pc=x
       ?[expr.]         :trace till result of formula not zero
       j or l or r      :trace till fire, left or right button pressed
    D  (n)              :show (set) active drive for diskoperation
    F                   :list definitions of function keys
    F  [n](c){@}        :set function key n with macro c (@=execute directly)
    Q                   :return directly to debug server
    W  [x],(x)          :set/clear or reset state of trap x
    X                   :continue program directly
    ?  [expr.]          :calculate result of formula
    <  [s][t](n)        :read (n) logical tracks (starting with) t at s
    >  [s][t](n)        :write (n) logical tracks (starting with) t from s
--------------------------------------------------------------------------------

    Monitor Function Key Overview
--------------------------------------------------------------------------------
    <CURSOR>            :move cursor one step
    <SHIFT+CURSOR>      :move cursor to limit
    <DEL>               :delete char in line
    <SHIFT+DEL>         :insert space in line
    <ALT+DEL>           :clear screen
    <BACKSPACE>         :backspace
    <SHIFT+BACKSPACE>   :'real' backspace
    <ALT+BACKSPACE>     :clear line
    <SHIFT+ESC>         :put commandline in line of cursor
    <ALT+ESC>           :copy line of cursor in commandline
    <HELP>              :helppage
--------------------------------------------------------------------------------

 The S.I.M. Base Structure
--------------------------------------------------------------------------------

;--- Base ---------

 struct toolbase       ;+0  The startadress of S.I.M. in memory


;--- Display ------

 aptr  plane           ;+0  The startaddress of the $5000 bytes display ram
                            (must be chipmem!)
 aptr  backup          ;+4  The startaddress for the backup of the display.
                            When not zero, S.I.M. will copy what is in the
                            memory of the future display to this part of memory
                            when entering and copy it back when exiting.  


;--- Entrances ----

 jmp   entrance1       ;+8  Entry by JSR. Here you can simply enter S.I.M.
                            by a 'JSR to this address.
 jmp   entrance2       ;+12 Entry by Exec's traphandle. When you want to use
                            S.I.M. as traphandler of your task, write this
                            address in [taskstruct+50].
 jmp   entrance3       ;+16 Debug server entry. This will be explained in
                            the documentary file.
 ulong 0               ;+20 *** RESERVED FOR EXPANSION ***


;--- Our Traps ----    ;When entering by a specific exceptions, these entrances
                        are taken.

 jmp   entrance22      ;+24 Bus error
 jmp   entrance23      ;+28 Address error
 jmp   entrance24      ;+32 Illegal instruction
 jmp   entrance25      ;+36 Divide-by-zero
 jmp   entrance26      ;+40 CHK instruction
 jmp   entrance27      ;+44 TRAPV instruction
 jmp   entrance28      ;+48 Privilege violation
 jmp   entrance29      ;+52 Trace
 jmp   entrance2a      ;+56 Op Code 1010
 jmp   entrance2b      ;+60 Op Code 1111


;--- Signal -------

 ulong "SIM!"          ;+64 This Long signals that this is S.I.M.
 ulong version         ;+68 Version of S.I.M. as 4 ASCII chars


;--- Backups ------    ;when S.I.M. is entered it remembers some customregisters
                        and vectors here. 

 word  dmacon          ;+72 $DFF096/002
 word  intena:         ;+74 $DFF09A/01C
 word  intreq:         ;+76 $DFF09C/01E
 long  level2:         ;+78 $68
 long  level3:         ;+82 $6C

 byte  ciaacra         ;+86 $BFEE01
 byte  ciaacrb         ;+87 $BFEF01
 byte  ciabcra         ;+88 $BFDE00 
 byte  ciabcrb         ;+89 $BFDF00
 byte  ciaaddrb        ;+90 $BFE301
 byte  ciabddra        ;+91 $BFD200
 byte  ciaasp          ;+92 $BFEC01 
 byte  kludge00        ;+93 To make even and as reserve
 long  0               ;+94 *** RESERVED FOR EXPANSION ***
 word  0         0     ;+98 *** RESERVED FOR EXPANSION ***


;--- Reentry ------    ;Reentry values of things that can't be saved.
                        When S.I.M. is left, it inits these registers with this
                        values

 word  $2981           ;+100 DIWSTRT
 word  $29c1           ;+102 DIWSTOP
 word  $003c           ;+104 DDFSTRT
 word  $00d4           ;+106 DDFSTOP
 word  $a200           ;+108 BPLCON0
 word  $0000           ;+110 BPLCON1
 word  $0000           ;+112 BPLMOD1
 word  $005a           ;+114 COLOR00
 word  $0fff           ;+116 COLOR01
 word  0               ;+118 *** RESERVED FOR EXPANSION ***


