home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / develop / here / simbug / docs / sim.doc < prev    next >
Text File  |  1995-02-27  |  115KB  |  3,565 lines

  1.  
  2. -----------------------------------------------------------------------------
  3.  
  4.                                    S.I.M.
  5.  
  6.                          System-Independent Monitor
  7.                                 Version 1.72
  8.  
  9.                  Copyright © 1990/1991/1992 by Stefan Walter
  10.                              ALL RIGHTS RESERVED
  11.  
  12. -----------------------------------------------------------------------------
  13.  
  14.  
  15.  
  16.              The User Manual, refering to version 1.72 of S.I.M.
  17.  
  18.  
  19.  
  20.  
  21.                                    WARNING
  22.                                    =======
  23.  
  24.  
  25.           This  version  of  SIM  is  not really official.  It was
  26.           released  because  some  developers  and programers have
  27.           requested   it  and  because  it  currently  serves  for
  28.           debugging  Amiga  Mach.   It  is  beta test ware and not
  29.           complete  by  any means.  A completely rewritten version
  30.           is halveway finished and will be out soon.
  31.  
  32.           SIM  will  now  work on all existing Amigas running with
  33.           MC60000   or   MC68020/30/40,   on   later   with   some
  34.           limitations.  It works now on both PAL and NTSC machines
  35.           with OCS/ECS/AGA.
  36.  
  37.           This   program  is  still  shareware,  only  Amiga  Mach
  38.           developers  and  owners  of  NOG2  automatically  become
  39.           registered  users.   No  warranty  for  functionality is
  40.           given.
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.                                  CONTENTS
  50.                                  ========
  51.  
  52.  
  53. 1.      Introduction
  54. --------------------
  55.  
  56.         1.1     Welcome to SIM
  57.         1.3     Disclaimer
  58.         1.2     About this Documentation
  59.  
  60.  
  61. 2.      Getting used to SIM
  62. ---------------------------
  63.  
  64.         2.1     What Is SIM?
  65.         2.2     Who Can Use It
  66.         2.3     Qualifications, Requirements and Limitations
  67.         2.4     The 68020+ Version
  68.         2.5     Configuring SIM
  69.         2.6     The SIM Program
  70.  
  71.  
  72. 3.      Some words about...
  73. ---------------------------
  74.  
  75.         3.1     The Display
  76.         3.2     Breakpoints
  77.         3.3     Trace
  78.         3.4     The Keyboard
  79.         3.5     Disk Access
  80.         3.6     Files
  81.         3.7     Breaking
  82.         3.8     The Actual Address
  83.         3.9     The matchbuffer
  84.         3.10    Command History
  85.         3.11    Traps
  86.         3.12    Function Keys
  87.         3.13    SIM and the Hardware
  88.         3.14    The Colors Red and Yellow
  89.         3.15    Printer Support
  90.         3.16    Memory Managing
  91.         3.17    Screen Blanker
  92.         3.18    Effective Address Calculation
  93.         3.19    Symbols
  94.         3.20    PAL/NTSC
  95.         3.21    Interrupt Lockup
  96.  
  97.  
  98. 4.      Communication between YOU and SIM
  99. -----------------------------------------
  100.  
  101.          4.1    The SIM Environement
  102.          4.2    The Monitor
  103.          4.3    The Commands and their Syntax
  104.          4.4    The Debugger Window
  105.          4.5    Debugger Window Shortcuts
  106.  
  107.  
  108. 5.      Additional Information
  109. ------------------------------
  110.  
  111.          5.1    Assembler Usage
  112.          5.2    Calculator Usage
  113.          5.3    Data Line
  114.          5.4    The Debug Server Entrance
  115.          5.5    The SIM Base
  116.          5.6    Errors
  117.          5.7    Footer Messages
  118.  
  119.  
  120. 6.      Appendix
  121. ----------------
  122.  
  123.         6.1     Acknowledgements
  124.         6.2     Registered Users
  125.         6.3     Contacting Me
  126.  
  127.  
  128.  
  129.  
  130. *****************************************************************************
  131.         1.      Introduction
  132. *****************************************************************************
  133.  
  134.  
  135.  
  136.  
  137. 1.1     Welcome to SIM
  138. ======================
  139.  
  140.  
  141. Congratulations  dear  user.   You  have  just  obtained the third release of
  142. 'S.I.M.', a high performance monitor and debugger for the Commodore Amiga.
  143.  
  144. 'S.I.M.'  is a shareware product.  This means that it can be used, copied and
  145. distributed freely, provided that:
  146.  
  147.   1)   No fee is charged for copying and distribution.
  148.   2)   It is distributed ONLY in its original, unmodified state.
  149.   3)   This document is copied along with the program.
  150.  
  151. If  you copied this program from somebody else and you like it and keep using
  152. it,  you  are  asked to send a little contribution of 15 US$ to the author in
  153. order to get registered and to obtain support and the final version when it's
  154. finished.
  155.  
  156.  
  157.  
  158. 1.2     Disclaimer
  159. ==================
  160.  
  161.  
  162. This  program  is  provided "as is" without warranty of any kind.  The entier
  163. risk  of using it is to the user himself.  In no event I (the author) will be
  164. liable  for  direct or indirect damage, loss of data or criminal actions done
  165. due  to  the use of this program.  If you do not agree with this, you may not
  166. use SIM.
  167.  
  168.  
  169.  
  170. 1.3     About this Documentation
  171. ================================
  172.  
  173.  
  174. You  should carefully skim this documentation if you are not used to SIM yet.
  175. SIM  bases on a concept that especially programers lacking detailed knowledge
  176. of assembly language or C will first need to get used to.
  177.  
  178.  
  179.  
  180.  
  181. *****************************************************************************
  182.         2.      Getting used to SIM
  183. *****************************************************************************
  184.  
  185.  
  186.  
  187.  
  188. 2.1     What Is SIM?
  189. ====================
  190.  
  191.  
  192. SIM  is  a very powerful debugger and monitor.  It was designed to work under
  193. all  circumstances and especially to supervise rather unconventional programs
  194. which  do  not make much use of the operating system or do completely disable
  195. it for more or less long time.
  196.  
  197. SIM  works  below  the operating system and does not interact with any of its
  198. facilities  or  routines.   It  disposes  of  ways  to  enable you relatively
  199. comfortable  debugging  of  any piece of machine language.  Be it a task list
  200. manipulating  routine,  an  interrupt  or direct access on hardware like disk
  201. drives  or  the  blitter,  routines you can't monitor with an ordinary system
  202. based  debugger.  There are practically no limits.  You can invoke SIM at any
  203. moment and it will pop up and work properly.
  204.  
  205. SIM  will  do  as  less changes to the software and hardware (ram, custom/cia
  206. registers) as it can.  When you exit SIM, it will try to leave everything the
  207. way  it was when SIM was started.  SIM does neiter use blitter nor copper, so
  208. any  'interrupted'  program can continue to run with no defects due to a call
  209. to SIM, no matter when it was stopped.
  210.  
  211.  
  212.  
  213. 2.2     Who Can Use It
  214. ======================
  215.  
  216.  
  217. SIM  was  written  to  be  used  by both serious programers of nice and clean
  218. applications,  who  follow  the  guide  lines of Commodore, as well as by the
  219. socalled  'democoders' who write programms which directly access the hardware
  220. and  disable  multitasking  (and  who lately have become deprived to do so by
  221. Commodore  :).   It  was originally mainly intended for the later, but it has
  222. proven to be very useful for debugging applications too.
  223.  
  224. It  is  distributed  with the neccessary utilities to apply it on any kind of
  225. program  that  need  to  be  debugged  at  a  given  time.   They are not too
  226. comfortable yet, intuition based 'V36+ only' versions are planned.
  227.  
  228. SIM  will  be  very  useful  for  you  if  you  need  to debug programs which
  229. temporarily  disable  multitasking.   If  you  only  need to debug 'ordinary'
  230. programs  with no critical or nonmultitasking routines, you are better served
  231. with a full system debugger.  There are plenty of good debuggers of that kind
  232. available, also in the Public Domain.
  233.  
  234.  
  235.  
  236. 2.3     Qualifications, Requirements and Limitations
  237. ====================================================
  238.  
  239.  
  240. To  use SIM efficiently, detailed knowledge of the Amigas hardware, the 680x0
  241. processors  and assembly language is ABSOLUTELY neccessary.  If you lack this
  242. knowledge,  get  Commodores  'Amiga Technical Reference Series' and Motorolas
  243. documentations of the 68000 family.
  244.  
  245. SIM  is  completely independent of the OS the Amiga uses.  There is a certain
  246. support for the normal OS, but no dependancy.
  247.  
  248. SIM  does  several  things by directly accessing the hardware, especially the
  249. part  that  deals  with  the  display.   This however is no longer allowed by
  250. Commodore  and  will  probably  cause  SIM  not to work on Amigas of the next
  251. generation(s).  If an incompatibility occurs, an update will be released.
  252.  
  253. You  should  not invoke SIM while doing any kind of timed access to hardware,
  254. i.e.  serial transfer.  Because SIM shuts down everything, data transfer will
  255. be  interrupted.   You  should  also  not  invoke  SIM  from within a level 2
  256. interrupt  before  it  has  dealt  with keyboard events or keystrokes will be
  257. lost.
  258.  
  259.  
  260.  
  261. 2.4     The 68020+ Version
  262. ==========================
  263.  
  264.  
  265. The  68020+  version  is only an 68000 version with the neccessary changes to
  266. get  it  working  on  better  CPUs.   Special  features  of  these processors
  267. (additional   exception  vectors,  instructions,  registers,  etc.)  are  not
  268. supported yet if not absolutely neccessary.
  269.  
  270. There  is  currently  no  version  working  on 68010 Amigas because I have no
  271. access  on  any  machine to try out any adaption to this CPU.  If anybody out
  272. there feels she/he needs a version of SIM for 68010 and is willing to do some
  273. beta testing, I will write a 68010 version.
  274.  
  275. The 68020+ version however works only with some limitations:
  276.  
  277.       - VBR  must be at a known position.  Default location $0, if vectorbase
  278.         is  not  at  0,  the  real location must be stored in the base of SIM
  279.         (offset 264).  The tools supplied with SIM do this before they invoke
  280.         SIM.
  281.  
  282.       - The  'v'  command  can  only  push  stackframes  back,  not  generate
  283.         artificial ones.
  284.  
  285.       - The  disassembler and assembler do not support any instructions added
  286.         in the 68010+ processors, except Bcc.B/W/L and EXT.B.
  287.  
  288.       - MMU  activities  are  not dealt with yet.  SIM deactivates the MMU by
  289.         default.   You  can  activate  the MMU again, SIM will then install a
  290.         primitive  bus error handler which prevents craches in case of a tree
  291.         containing illegal descriptors.
  292.  
  293.  
  294.  
  295. 2.5     Configuring SIM
  296. =======================
  297.  
  298.  
  299. You  can't  use  SIM  right  away, you need to configure a copy to your Amiga
  300. first,  that  is for the CPU and the memory configuration it uses.  Therefore
  301. you  have to use 'SIMConfig'.  This program configurates SIM for your machine
  302. and your personal needs.
  303.  
  304. The  program  is  selfexplaining  except  when  it comes to define the memory
  305. pages.   Here  you  shall make no mistake or the copy generated will not work
  306. properly.  First think about what must be viewable.  That is:
  307.  
  308.       - All memory
  309.       - Kickstart image
  310.  
  311. Get  all  start-  and end addresses and sort them from lowest to highest.  If
  312. neccessary  use  some  system  information  tool  to  get  the  start and end
  313. addresses of all your memory blocks.
  314.  
  315. If  you  can  merge  pages  then  do so for same memory types.  Do not define
  316. overlapping  pages.   Pages  must  also start and end at even addresses.  The
  317. program 'SIMConfig' does not check for correctness of what you enter.  If you
  318. define  incorrect  pages,  SIM  may crash later.  In case you do not want any
  319. memory  managing  enter  $1000000  as  first  page  end address for the 68000
  320. version, $80000000 for the 68020+ version.
  321.  
  322. You can exit this program anytime by entering 'exit'.
  323.  
  324.  
  325.  
  326. 2.6     The SIM Program
  327. =======================
  328.  
  329.  
  330. SIM is not an executable (it has no hunkstructure, so you cannot simply start
  331. it  from  the  CLI  or  workbench)  but a simple PC-relative file that can be
  332. loaded somewhere into the memory or included in one of your own programs.
  333.  
  334. SIM  is  a  nonmultitasking  debugger.  When it is activated, Multitasking is
  335. immediately stopped, much like by Disable().
  336.  
  337.  
  338.  
  339.  
  340. *****************************************************************************
  341.         3.      Some words about...
  342. *****************************************************************************
  343.  
  344.  
  345.  
  346.  
  347. 3.1     The Display
  348. ===================
  349.  
  350.  
  351. The  display  creates  some  of  the  more  tricky  problems for SIM and you.
  352. 20480/$5000  bytes  of graphic memory are needed for a 640*256 bitplane.  But
  353. at a certain moment, there may be no 20480 bytes graphic memory available.
  354.  
  355. The  solution  is  the  backup.   When you have an area of $5000 free graphic
  356. memory  that  will  stay  free  for  sure  (that  means  it is allocated with
  357. AllocMem()  or will never be used), you simply set the display address to the
  358. start  of  that  area  and the backup address to zero (this means no backup).
  359. SIM will then concider these $5000 bytes its own and use it as display.  When
  360. you enter SIM, the data in this area are then destroyed.
  361.  
  362. In  case  there is not enough free graphic memory or it will be used entierly
  363. in  near future and you have enough (that is $5000 bytes) unused other memory
  364. that  won't  be  used  for sure, you set the backup address to the start of a
  365. free  $5000  bytes  block  of  other  memory  and the display address just to
  366. somewhere  in  the  graphic  memory.   When  SIM  is activated, It copies the
  367. content of the $5000 bytes display- to the backup memory and uses the display
  368. memory.   When  you  leave SIM again, it copies the $5000 bytes back from the
  369. backup- to the display memory.  That way, the graphic memory is unchanged.
  370.  
  371. The memory manager claimed to be missing in earlier versions
  372. is now integrated in several functions. If you have defined a backup area
  373. the memory manager automatically fades it in at the location of the display.
  374.  
  375. Because  the  interrupt vectors are used, you may not specify a display below
  376. $70 or above the end of the graphics memory minus $5000.
  377.  
  378. Both  the  display-  and  the  backup address are entered in the SIM basearea
  379. before starting SIM or set by the 's' command while working.
  380.  
  381. NTSC  users  please note that although a 640*200 plane only uses 16000 bytes,
  382. you  too  need $5000 display memory because it is also used as MFM buffer for
  383. all disk operations.
  384.  
  385.  
  386.  
  387. 3.2     Breakpoints
  388. ===================
  389.  
  390.  
  391. A  breakpoint  is  basically  a change in the program that is monitored which
  392. stops  it and gives control to the debugger that set it.  In other terms, you
  393. can  run  the  program at full speed until it executes a certain instruction.
  394. This  is  a  very  important  feature  when you have to control the flow of a
  395. program.   Therefore the breakpoint system of SIM is very sophisticated.  SIM
  396. can handle three kinds of breakpoints:
  397.  
  398.       - ILLEGAL breakpoints
  399.       - JSR breakpoints
  400.       - STACK breakpoints
  401.  
  402. Each  kind  is  used  for  different  problems  and  has  its  advantages and
  403. disadvantages.
  404.  
  405. SIM  is  able  to  handle 16 different breakpoints at a time.  When you enter
  406. SIM,  it removes the breakpoints from the memory, so the memory looks like it
  407. would  look with no breakpoints set.  That enables you to change instructions
  408. that  are  at  a  breakpoint  without  first  removing  the breakpoint before
  409. changeing and putting it back afterwards.
  410.  
  411. A  critical  situation occurs when the breakpoint is overwritten by a program
  412. (i.e.   by a copyroutine).  Such a breakpoint is in 'modified' state When SIM
  413. removes  the  breakpoints  at  entry,  it  checks  if  they  are still there.
  414. Modified  breakpoints  are  not  removed and not restored, when you leave SIM
  415. again.  If you want to have the modified breakpoint set again, you must first
  416. remove it (SIM simply frees the place in the breakpoint list but does not put
  417. the original opcode or words back).  Then you can set it again.
  418.  
  419. You  cannot  set  breakpoints  everywhere.   SIM tests if there is ram at the
  420. location  where  you want to set a breakpoint.  If there is none, this causes
  421. an error.  SIM also prohibits to set breakpoints in the SIM codesegment.
  422.  
  423.  
  424. 1. ILLEGAL breakpoints
  425. ----------------------
  426.  
  427. Illegal  breakpoints  are  normally  the  most  used  ones and offer the most
  428. possibilities.   When you set an ILLEGAL breakpoint at a certain instruction,
  429. SIM replaces the opcode word of that instruction by the ILLEGAL opcode $4afc.
  430. When the ILLEGAL instruction is executed instead of the original instruction,
  431. an ILLEGAL INSTRUCTION exception happens.
  432.  
  433. Therefore  it is neccessary that the ILLEGAL INSTRUCTION vector somehow jumps
  434. to  SIM,  either directly, set by the 'w' command, or indirectly via the task
  435. traphandle,  set  by 'SIMBug' or another SIM-loader.  If this is not so, your
  436. machine crashes.
  437.  
  438. Illegal  breakpoints have the advantage that they can be 'conditioned'.  This
  439. means  that  this  breakpoint  only  forces  entry when one or one of several
  440. conditions are fullfilled.  The following criterias can decide whether or not
  441. the breakpoint forces entry:
  442.  
  443.  
  444.       - condition term:
  445.  
  446.         You  can specify a term that is calculated each time when the program
  447.         arrives  at the breakpoint.  When the result of the term is zero, the
  448.         program continues, if it is nonzero, SIM is entered.
  449.  
  450.         You  can use that feature to i.e.  break a program at a certain point
  451.         if a register contains a certain value.
  452.  
  453.         The use of SEA, TEA, SX and TX is allowed,  but you must first toggle
  454.         on EA calculation using the AMIGA-Z shortcut.
  455.  
  456.  
  457.       - counter breakpoint:
  458.  
  459.         A  counter  breakpoint  will  enter SIM if the program has passed the
  460.         breakpoint a certain number of times.
  461.  
  462.         This  way  you  can  i.e.   break  a subroutine after it was called a
  463.         certain number of times.
  464.  
  465.  
  466.       - button breakpoint:
  467.  
  468.         When the program arrives at a button breakpoint, SIM will look if the
  469.         left  or  right mousebutton or the firebutton of a joystick in port 1
  470.         is  pressed  and  enter  SIM if one is pressed.  You can specify what
  471.         buttons are concidered.
  472.  
  473.         Button breakpoints can i.e.  be set in a vertical blanking interrupt.
  474.         every  fiftieth/sixtieth  of  a  second, SIM can check if you want to
  475.         enter or not.
  476.  
  477.  
  478. Additionally  you  can  make  resident  illegal  breakpoints.   A nonresident
  479. breakpoint will be removed after it caused entry.  A resident breakpoint will
  480. stay  active  until  it  is  removed.   A  resident breakpoint can be used in
  481. situations when you want to stop a program several times at the same address.
  482.  
  483. SIMs  breakpoint  system  enables  to  combine  all  these  elements, to make
  484. resident  breakpoinst  that  break  at  SEVERAL  conditions.   You  can set a
  485. resident  breakpoint at $70000 that either breaks when d3 is 3245 or the left
  486. or  right  mousebutton  is  pressed  and that is limited to 1000 passes.  The
  487. command  line  to  set  that  breakpoint  would  look  like that:  'b 70000 *
  488. ?d3=3245 lr 1000'.
  489.  
  490. SIM  uses the TRACE vector to skip a resident or conditioned breakpoint if it
  491. has  not  caused  entry  into SIM.  This means that you must not only set the
  492. ILLEGAL  INSTRUCTION vector but also the TRACE vector.  This is neccessary as
  493. soon as you have set a conditioned or a resident breakpoint.
  494.  
  495.  
  496. 2. JSR breakpoints
  497. ------------------
  498.  
  499. The second type of breakpoint is a rather a 'heavy duty' one.  When you set a
  500. JSR  breakpoint, SIM remembers the 6 bytes at the breakpoint address and puts
  501. a JSR instruction there that jumps absolutely into SIM (i.e.  'JSR $c50726').
  502. When  the  breakpoint  is  reached, the program jumps directly into SIM which
  503. then puts back the 6 bytes.
  504.  
  505. This  breakpoint  has  two advantages.  The first is that you do not need any
  506. vectors  to  be  set.  The second is that a JSR breakpoint can be transfered.
  507. When  you  have  an  illegal  breakpoint  in  a  routine  and that routine is
  508. transfered  to  another  location and the breakpoint is reached in the copied
  509. routine,  SIM  will  not know that that illegal is a breakpoint because it is
  510. not  at any of the addresses at which a breakpoint was set, so it will not be
  511. replaced  by  the  original  opcode.  JSR breakpoints are recognized at their
  512. entrance,  because  each  of  the  16  possible  JSR  breakpoints has another
  513. entrance.   That way, SIM can recognize that breakpoint whereever it is.  But
  514. be  carefull,  never enter SIM by these entrances on your own.  You must also
  515. see  to it that after the transfered breakpoint forced entry and was removed,
  516. the original one is NOT reached too.
  517.  
  518. Because  of  these  two  advantages,  you can use JSR breakpoints in delicate
  519. situations,  where  you are not sure if the vectors are not changed, i.e.  in
  520. routines  accessed  by  multiple  tasks or places where the illegal vector or
  521. task traphandle is changed.
  522.  
  523. A  disadvantage  of JSR breakpoints is that they use not one but three words.
  524. The  minimum  size for an instruction is a word, an illegal breakpoint can be
  525. set  at any instruction because the instruction ILLEGAL uses one word.  A JSR
  526. breakpoint may replace three instructions.  Therefore you have to set the JSR
  527. breakpoint  in  a  'linearly'  executed  part  of  the program.  Here are two
  528. examples  where  the  JSR breakpoint is not set correctly.  The breakpoint is
  529. always set at the label 'bkpt':
  530.  
  531.   1.            .
  532.                 .
  533.                 .
  534.                 bsr.s label      ;this will cause problems!
  535.         bkpt:
  536.                 bra.s label2     ;JSR opcode
  537.         label:
  538.                 nop              ;HIword of entrance
  539.                 nop              ;LO word of entrance
  540.                 .
  541.                 .
  542.                 .
  543.  
  544.  
  545.   2.            .
  546.                 .
  547.                 .
  548.         bkpt:
  549.                 moveq #1,d0      ;JSR opcode
  550.         label:
  551.                 moveq #0,d1      ;HI word of entrance
  552.                 rts              ;LO word of entrance
  553.                 .
  554.                 .
  555.                 .
  556.                 moveq #-1,d0
  557.                 bra.s label      ;again in the middle...
  558.  
  559.  
  560. 3. Stack breakpoints
  561. --------------------
  562.  
  563. Contrarily  to  the illegal and JSR breakpoint, the Stack breakpoint is not a
  564. change  in  the  program  but  a  change on the stack.  When SIM sets a Stack
  565. breakpoint,  it  replaces  a  returnaddress on the stack by the address of an
  566. entrance  of  SIM.  When the appropriate rts, rtr or rte that would return to
  567. that  address  is reached, it returns to SIM instead.  SIM sets the pc to the
  568. returnaddress  and replaces the SIM entrance address on the stack (should now
  569. be at a7-4 for rts!) by the original address for security.
  570.  
  571. For  SIM,  it  does  not  differe,  if  the  Stack  breakpoint  is set in the
  572. supervisor or userstack (in earlier versions it did, this is no longer so).
  573.  
  574. Use  this feature wisely!  SIM cannot test if the Stack breakpoint you set is
  575. put  in  a  stack  and is taken off stack by a 'Return From ...' instruction.
  576. Its upon you to set Stack breakpoints at the right position.
  577.  
  578. Stack  breakpoints are also used by for the nextstep and the leave subroutine
  579. command.
  580.  
  581.  
  582.  
  583. 3.3     Trace
  584. =============
  585.  
  586.  
  587. Tracing  is  the  second  way  of  keeping  a program under control.  SIM can
  588. singlestep a program.  Therefore you must see that the TRACE exception caused
  589. by  that  somehow  ends  up  in  SIM,  either  set  it  directly  or  set the
  590. tasktraphandle.  It can also let a program run step by step and stop when one
  591. or several conditions are fullfilled, much like the illegal breakpoints:
  592.  
  593.  
  594.       - condition term:
  595.  
  596.         You  can specify a term that is calculated after each step.  When the
  597.         result  of  the  term is zero, the trace continues, if it is nonzero,
  598.         SIM is entered.
  599.  
  600.         You  can  use  that  feature  to  i.e.   break a program as soon as a
  601.         certain register is changed.
  602.  
  603.         The use of SEA, TEA, SX and TX is allowed,  but you must first toggle
  604.         on EA calculation using the AMIGA-Z shortcut.
  605.  
  606.  
  607.       - counter trace:
  608.  
  609.         You can specify a maximum number of steps to do.  When that amount of
  610.         steps is done, SIM is entered.
  611.  
  612.         Counter trace is mostly use to just get back after a routine is done.
  613.  
  614.  
  615.       - button trace:
  616.  
  617.         After  each  step,  SIM will look if the left or right mousebutton or
  618.         the  firebutton  of  a joystick in port 1 is pressed and enter SIM if
  619.         one is pressed.  You can specify what buttons are concidered.
  620.  
  621.         Button  trace  can i.e.  be used for stoping a program by hand at any
  622.         moment.
  623.  
  624.  
  625.       - trace breakpoint:
  626.  
  627.         You can define an address that is compared to the PC after each step.
  628.         If the program has arrived at that address, SIM is entered.
  629.  
  630.         This  feature  is  used  when  you  cannot  use  breakpoints for some
  631.         reasons.
  632.  
  633.  
  634.       - 68020 emulation:
  635.  
  636.         This  is  also a condition.  SIM is only entered when a change in the
  637.         flow would happen, this means that the pc points on a BRA, JMP etc.
  638.  
  639.  
  640. SIM  uses the trace flag to do single steps.  What some people do not know is
  641. that  you  can  trace over some instructions that may clear that flag.  These
  642. are
  643.  
  644.         RTE
  645.         MOVE to SR
  646.         ORI #x,SR
  647.         EORI #x,SR
  648.         ANDI #x,SR
  649.  
  650. Additionally you can enter the TRAP #x exception routines with the trace.
  651.  
  652. Tracing  has one weak spot:  if you are tracing and an interrupt happens that
  653. somehow  causes  entry  in SIM (i.e.  by a breakpoint), SIM loses the control
  654. over  the  trace.   When  you  exit SIM again and the interrupt ends, a TRACE
  655. exception  happens.   You  must  then start to trace again or clear the trace
  656. flag by hand.
  657.  
  658. Some  words about the speed:  It is clear that the more conditions you allow,
  659. the  slower  the  program  runs.   Additionally  some conditions cause longer
  660. delays  than  others.  Condition trace is slower than button trace because it
  661. has to call the calculator which is relatively complex and slow.
  662.  
  663.  
  664.  
  665. 3.4     The Keyboard
  666. ====================
  667.  
  668.  
  669. The most difficult problems are imposed by the keyboard.  The Amigas keyboard
  670. hardware  cannot  tell  you  which  keys  are pressed at a certain moment, it
  671. reports  only  key  changes.   This  makes it difficult for systemindependent
  672. programs.  When you press a key under system and release it in a program that
  673. has  its  own  keyboardhandler,  the system will never know that you released
  674. that  key,  it  will  report repeats of that key all the time until you press
  675. another  key.   To  prevent this, SIM will look that all keys are in the same
  676. state  when  you  leave  SIM  as they were in when you entered SIM.  When you
  677. leave  SIM  and  a  key  is not in the same state, SIM will ask you to either
  678. press  that  key  or to release it.  Therefore, in the headline you will find
  679. the  keys  rawkey number and if in the keymap there is a printable character,
  680. that  character  too.  You can only exit SIM if you press or release all keys
  681. that it wants you to.
  682.  
  683. If  you  leave  SIM  by  accident  (hit  wrong key?) and you are requested to
  684. press/release  a  key,  you  can  do the following operation to return to the
  685. monitor:
  686.  
  687.  
  688.       - Press another key that is not a qualifier (SHIFT etc.), not 'r', 'e',
  689.         't',  'u',  'n'  or  one  that  you must press to exit (esc is a good
  690.         choice).
  691.  
  692.       - Release all other keys.
  693.  
  694.       - Type 'return'.
  695.  
  696.       - Release the keys you pressed for that operation.
  697.  
  698.  
  699. If you are tired to press keys again and again to exit, you can use the flush
  700. keystatefield  shortcut.   SIM will then clear the internal list of keys that
  701. were pressed when SIM was activated.
  702.  
  703. The  keyboard can store upto ten rawkeys on its own if the CPU has no time or
  704. need  to  get  keyboard  events.   It  is  possible that several key hits are
  705. waiting  to  be  replied.   When  SIM is activated then, it would recieve all
  706. those  old  keys  that may invoke shortcuts or commands that are not desired.
  707. Similar  problems  occur  when  you link SIM in the CIA-A interrupt and it is
  708. invoked  before  the  key  is  replied.  The keyboardbuffer killer is used to
  709. reply  to  all  possibly waiting keys and to flush the keyboard buffer.  This
  710. feature can be toggled on or off and is off by default.
  711.  
  712.  
  713.  
  714. 3.5     Disk Access
  715. ===================
  716.  
  717.  
  718. Because ram is a too transitory datacarier, SIM can read and write DOS-tracks
  719. and  sectors.   It  does this by directly accessing the hardware.  If you are
  720. using  disk  commands, make sure a disk is always inserted or the drive motor
  721. will  be  stoped after the command has completed although it was on.  This is
  722. because  SIM  needs a disk to be inserted in a drive to find out if its motor
  723. is turning.
  724.  
  725. When SIM is writing or reading, the display is used as buffer.  You still see
  726. it,  but  it  contains  chaos.   The  top  line  is  used  to give you status
  727. information about the track that is operated or errors occured.
  728.  
  729. When  an  error  occures, you can either break with CTRL, retry with SHIFT or
  730. ignore the error with ALT (when file operation, ALT=CTRL).
  731.  
  732. When  a  track  is  not  correct,  SIM tries to read it three times.  Then it
  733. reports  the error but displays also which sectors were okay.  It is possible
  734. that only one sector is damaged, press SHIFT several times, SIM may find some
  735. sectors  more  that  are  okay  and simply were after the damaged sector last
  736. time.
  737.  
  738. SIM  is  tollerant  concerning  the  integrity of the sectors.  Checksums are
  739. calculated  and  SIM  reports  an  error  if one is wrong, but it decodes the
  740. sector anyway.  This enables SIM to repair partially destroyed tracks.
  741.  
  742. 5 1/4" and HD drives as used in the A4000 are not supported yet.
  743.  
  744.  
  745.  
  746. 3.6     Files
  747. =============
  748.  
  749.  
  750. You  can load any files of an OFS DOS disk to memory.  You can list the files
  751. and  their  length  contained in any directory.  And you can save any area of
  752. memory as a file on a disk.
  753.  
  754. The  file  save system is quite sophisticated.  It writes files in a way that
  755. they  can  be loaded and listed fast.  Info- and extension blocks are located
  756. on  track  79  and  higher, data blocks from 79 down to 0 and from 159 to 79.
  757. Additionally, SIM will first look if a file fits the disk before it begins to
  758. save.  The bad sideeffect of this is that saving takes some time.
  759.  
  760. One thing you must remember is to be carefull with saving files when you work
  761. with  the  normal  operating  system  afterwards.   When you save a file, the
  762. bitmap  on  the disk is changed.  The system keeps its own copy of the bitmap
  763. of a disk in memory.  When it accesses that disk again, it possibly discovers
  764. a totally different bitmap.  When it comes to the worst, the DOS crashes with
  765. the  guru 07000007 (bitmap corrupt).  To prevent this, you simply remove that
  766. disk  from  its drive and put it back again.  The DOS then rereads the bitmap
  767. and everything's okay.
  768.  
  769.  
  770.  
  771. 3.7     Breaking
  772. ================
  773.  
  774.  
  775. In  certain  situations,  it may be neccessary to break a command or to pause
  776. it.   SIM  can do both.  You can break the dump commands, find and compare by
  777. shortly  hitting CTRL.  If you press it longer, SIM only pauses and continues
  778. when  you  release  CTRL.   When  you press SHIFT-CTRL or additionaly hit the
  779. SHIFT  key when you pause, SIM locks until you release, press and relese CTRL
  780. again.   This  enables  you  i.e.  to make notes without holding CTRL all the
  781. time.
  782.  
  783. While locked or paused, you can press the ALT key.  When you release CTRL (if
  784. locked,  press it first), SIM breaks th command execution also.  This is used
  785. when you have paused and want to stop immediately.
  786.  
  787. ALT-CTRL is used to break command execution in general.  Before SIM looks for
  788. a  new  command  in  a command line, it tests for ALT-CTRL.  If that's so, it
  789. breaks.   This  enables  you  to  break  a command line like 'P0:X' since you
  790. cannot break the 'P' and 'X' commands.
  791.  
  792. An  exception  to  this  rules  are the disk operation and the list directory
  793. command.   These commands can only be broken.  Therefore simply keep the CTRL
  794. key pressed.
  795.  
  796.  
  797.  
  798. 3.8     The Actual Address
  799. ==========================
  800.  
  801.  
  802. The dump and edit commands share a default address variable that is used each
  803. time, you do not give a start address.  This address has the name '@' for the
  804. calculator.   It contains the end address of the last dump or edit command or
  805. it is set by find and compare.
  806.  
  807.  
  808.  
  809. 3.9     The matchbuffer
  810. =======================
  811.  
  812.  
  813. The  matchbuffer  is  used  to collect addresses.  You can force the find and
  814. compare commands to send addresses to this buffer.  You can also also specify
  815. under  what conditions an address is put in the buffer or one that is already
  816. in buffer stays there.  There are three possible conditions:
  817.  
  818.  
  819.       - old:
  820.  
  821.         If  an  address  that  was  already  in buffer did not match with any
  822.         reported  by the find or compare command, it only stays in the buffer
  823.         when you enable old ones.
  824.  
  825.       - match:
  826.  
  827.         If an address that is reported is already somewhere in the buffer, it
  828.         stays only when you enable matches.
  829.  
  830.       - new:
  831.  
  832.         If  an  address  is new, it is only put in the buffer when you enable
  833.         new ones.
  834.  
  835.  
  836. You  can  combine the three conditions in any way (there are eight possible),
  837. some may make not much sence.
  838.  
  839. This feature is mainly integrated to search for counters.
  840.  
  841. To show the addresses in the buffer, the 'k' command is used.
  842.  
  843. An example: You are searching for the address of a counter. You know that
  844. the counter is currently 10:
  845.  
  846.  
  847.         1. Define matchbuffer, i.e. 'k c00000 c10000'
  848.  
  849.         2. Search for 10, i.e. 'f 0 20000 !n 0a'
  850.  
  851.         3. Exit,  perform any neccessary  operation to  change the counter to
  852.            another known value, i.e.  15
  853.  
  854.         4. Search for 15, i.e. 'f 0 20000 !m 0f'
  855.  
  856.         5. List  addresse(s)  in  matchbuffer, i.e.  'k 0' if more  than one
  857.            address  stays in the buffer,  go to step 3 and search again until
  858.            one address stays.
  859.  
  860.  
  861.  
  862. 3.10    Command History
  863. =======================
  864.  
  865.  
  866. SIM  remembers  the  last  commands  executed  in the monitor.  128 bytes are
  867. reserved  for  that.  These 128 bytes contain the last command lines.  If you
  868. get an old command line back by the command history shortcuts and execute it,
  869. it is not remembered as the newest executed command.
  870.  
  871.  
  872.  
  873. 3.11    Traps
  874. =============
  875.  
  876.  
  877. The  traps  are  one of the major connections between SIM to the outer world.
  878. They  are  used  for  breakpoints and to handle crashes.  You can set the ten
  879. basic  exception  vectors  directly.   When  you  enter SIM, it puts back the
  880. original  vectors, so you can edit them.  When exited, SIM sets the set traps
  881. again.
  882.  
  883. Problems occur when the program that is debugged sets the traps itself.  When
  884. the  program changes a vector previously set by SIM, this is handled the same
  885. way as it is done with changed breakpoints.
  886.  
  887. Additionally  you  can  force  SIM to set traps again if they are modified by
  888. toggeling  'Auto  Unmodify  Traps'  on.  If traps set by SIM are changed, the
  889. display color of SIM turns yellow in order to inform you of this.
  890.  
  891. While  working  under  operating  system,  it  is  not  recomended to set the
  892. exception  vectors  directly  to  SIM, except if it becomes neccessary due to
  893. breakpoints in library vectors or other places where multiple tasks access.
  894.  
  895.  
  896.  
  897. 3.12    Function Keys
  898. =====================
  899.  
  900.  
  901. The  ten  function  keys  can  be loaded with a text or command line.  If you
  902. define  a text, it is copied at the location of the cursor when you press the
  903. function key.  If you define a command line, it is executed directly.
  904.  
  905. The  ten  function  keys  are  partially allready defined in the original SIM
  906. version.  These are the definitions:
  907.  
  908.  
  909.         F1:  z@         For easy tracing.
  910.  
  911.         F2:  u@          " "
  912.  
  913.         F3:  i@          " "
  914.  
  915.         F4:  f@         For repeated finding.
  916.  
  917.         F5:  c@         For repeated comparing.
  918.  
  919.         F8:  v:X@       When an  exception vector is set  and an exception of
  920.                         that kind  happens  and has  to be dealt with  by the
  921.                         original vector.
  922.  
  923.         F9:  dm0 m0@    For finding  disassembly  without using  the debugger
  924.                         window.  Initially deselected:
  925.  
  926.         F10: r:dpc pc@  For  tracing   without  using  the  debugger  window.
  927.                         Initially deselected.
  928.  
  929.  
  930.  
  931. 3.13    SIM and the Hardware
  932. ============================
  933.  
  934.  
  935. SIM  does  only  use  a very limited part of the hardware registers, the ones
  936. that  are  indispensable  or  must  be set on fix values to provide security.
  937. Some  of  these  registers can be read, some not.  The values of the readable
  938. ones  are  remembered  in a special part of SIM called 'SIM base' when SIM is
  939. activated.   The  SIM base is located, as its name says, at the start of SIM.
  940. In chapter 6.1 you find the structure of the base.
  941.  
  942. These  are  the  registers that are read out and stored in the base at entry.
  943. When you exit SIM, it copies the remembered values back:
  944.  
  945.  
  946.         DMACON
  947.         INTENA
  948.         INTREQ *)
  949.  
  950.         CIA-A: CRA
  951.         CIA-A: CRB
  952.         CIA-B: CRA
  953.         CIA-B: CRB
  954.  
  955.         CIA-A: PRA write buffer
  956.         CIA-A: PRB write buffer
  957.         CIA-A: DDRA
  958.         CIA-A: DDRB
  959.  
  960.         CIA-B: DDRA
  961.  
  962.         CIA-A: SR write buffer
  963.  
  964.         VPOS **)
  965.  
  966.  
  967. *) This register is handled in a special way.  While SIM is active, it leaves
  968. the  disk-DMA  switched on.  If it wouldn't, this would possibly destroy your
  969. disks.   Since  the  disk-DMA  is left on, remember that when the disk-DMA is
  970. terminated, bit 1 in the INTREQ is set.  This may happen during SIM is active
  971. because  the  DMA  was still transfering when the INTREQ was read.  Therefore
  972. you  will  find  only  the interrupt requests in the backup that were waiting
  973. when  SIM  was activated.  If you want to know about the actual contents, you
  974. must read out INTREQ using the calculator command '?[$dff09c].w'.
  975.  
  976. When  you  exit  and  didn't edit the INTREQ backup, SIM does not restore the
  977. bits EXTER, DSKSYN, RBF, AUDX, DSKBLK and TBE from the backup.  If you edited
  978. the  backup,  the  bits  that are changed are restored , even if they contain
  979. some of the bits named above.
  980.  
  981. **)  This  value is not written back.  SIM rather waits for the rasterbeam to
  982. be  aproximately  at that position that it was on when the register was read.
  983. The  register  is  read  at a late point of time when SIM is activated, quite
  984. some  instructions  have  been  executed  then,  so  it  is not very precise.
  985. hopefully this can be improved.
  986.  
  987.  
  988. All  these  registers are used by SIM when working.  If you have to know what
  989. vaule  was  in  one  of  those,  you  have  to look in the SIM base where SIM
  990. remembered  them.   If  you  need  to change one of them, you must change the
  991. value stored in the base.
  992.  
  993. As  quoted,  some  of  the  custom  register contain information that is lost
  994. because  SIM  cannot read from these registers.  For the more important ones,
  995. SIM  disposes of an editable list of 'reentry' values which are put back when
  996. SIM exits.  Those registers are:
  997.  
  998.  
  999.         DIWSTRT
  1000.         DIWSTOP
  1001.         DDFSTRT
  1002.         DDFSTOP
  1003.         BPLCON0
  1004.         BPLCON1
  1005.         BPLMOD1
  1006.         COLOR00
  1007.         COLOR01
  1008.         BEAMCON0*)
  1009.  
  1010.  
  1011. *)  The  BEAMCON0 register is only accessed under ECS or AGA.  Unter OS, this
  1012. register  is only updated at calls to LoadView(), not in the copperlist.  You
  1013. may need to concider that if you are using an advanced resolution (i.e.  VGA)
  1014. on  your  Workbench  screen  and don't access SIM via SIMBug or PostSIM which
  1015. both update the BEAMCON0 reentry value to the value used by the OS.
  1016.  
  1017.  
  1018. These registers all concern the display. In most cases, they
  1019. are reset anyway by a copperlist. If not, you have to look in the program
  1020. where it sets them for the initial value and enter it in the base or decide
  1021. on your own what value to use.
  1022.  
  1023. Some  of  the registers are modified but do not have a reentry value, because
  1024. they  are either too temporary (DSKPTX for example) or completely unimportant
  1025. (BPL1PTX).  If it becomes neccessary, you can edit some with the 'e' command:
  1026.  
  1027.  
  1028.         CLXDAT
  1029.         DSKBTR *)
  1030.         DSKPTX *)
  1031.         DSKLEN *)
  1032.         DSKSYNC *)
  1033.         BPL1PTX
  1034.         BPL1DAT
  1035.         SPRXDATA/B
  1036.         CIAA: ICR state and mask
  1037.  
  1038.  
  1039. *)  These  registers are only used and changed when you read or write from or
  1040. to disk.
  1041.  
  1042. If AGA is present, SIM also writes directly to some undocumented registers to
  1043. build up its display:
  1044.  
  1045.  
  1046.         $DFF106:        $0c40
  1047.         $DFF1E4:        $0000
  1048.         $DFF1FC:        $0000
  1049.  
  1050.  
  1051.  
  1052. 3.14    The Colors Red and Yellow
  1053. =================================
  1054.  
  1055.  
  1056. When  you  start  to  use  SIM quite often and in critical situations, it may
  1057. happen  that the text color of SIM, which normally is green, turns red.  This
  1058. means  that  the  SIM  code  has  been  partially  changed.  SIM calculates a
  1059. checksum  over  its  main code segment and looks if it is the same each time.
  1060. If not, it changes the color to red.
  1061.  
  1062. When the color is red you must be rather carefull.  SIM seems to run well but
  1063. it may crash when you execute a certain command or do something else.  If you
  1064. can, load a new copy and don't keep using the destroyed one.
  1065.  
  1066. A  yellow  text  color  means  that  one  or  more of the traps set have been
  1067. modified  and  overwritten.  In that case you should either reset the vectors
  1068. that have been changed or remove then.
  1069.  
  1070.  
  1071.  
  1072. 3.15    Printer Support
  1073. =======================
  1074.  
  1075.  
  1076. SIM  allows  you to send all output on the monitor to the printer.  Therefore
  1077. it  simply  sends  the text as ASCII codes to the parallel port.  This should
  1078. allow  you  to use practically any parallel printer.  If you want to send ESC
  1079. codes (to select NLQ, reset etc.), you can do this by entering CTRL-[ and the
  1080. rest  of  the  ESC  code  as a command and press return.  Remember to use the
  1081. printer specific codes and not the AMIGA specific ones.
  1082.  
  1083. Printer  support  does  not  work quite right with laser printers and certain
  1084. other  non-matrix  printers  which  need a FF before printing or which demand
  1085. both LF and CR.
  1086.  
  1087.  
  1088.  
  1089. 3.16    Memory Managing
  1090. =======================
  1091.  
  1092.  
  1093. SIM  now  disposes  of  the  memory  manager  that  was missing in v1.51.  It
  1094. controls  memory  access  by  certain  commands  and  forbids  read and write
  1095. accesses to addresses where no memory is located:
  1096.  
  1097.  
  1098.       - It fades in the backup of the display at the location of the display.
  1099.         If there is no backup the display is zeroed.
  1100.  
  1101.       - At  VBR+$68  and VBR+$6c it inserts the level 2 and level 3 interrupt
  1102.         vectors.
  1103.  
  1104.       - It  handles  five  pages  of  memory that can be read and written to.
  1105.         Other areas are zeroed.
  1106.  
  1107.  
  1108. The  memory  manager  is  currently not supported by all functions.  Only the
  1109. 'm',  'a',  'd',  'p' and 'l' commands (and the corresponding debugger window
  1110. output  forms),  'c', 't', 'o', 'P', 'H', 'L', 'S', 'e', 'n' and 'q' commands
  1111. use it, the rest still doesn't.
  1112.  
  1113.  
  1114.  
  1115. 3.17    Screen Blanker
  1116. ======================
  1117.  
  1118.  
  1119. When  you  do  not  press  any key during 10 minutes and SIM is not doing any
  1120. operation,  it automatically darkens the monitor.  To continue to work, press
  1121. any key, best would be a qualifier.
  1122.  
  1123.  
  1124.  
  1125. 3.18    Effective Address Calculation
  1126. =====================================
  1127.  
  1128.  
  1129. SIM  can  calculate effective addresses.  The source EA of the command at the
  1130. PC is displayed below A6 of the small register list, the destination EA below
  1131. A7.   In  the large register list, the last line contains a 6 byte hexdump of
  1132. both the asource and destination EA.
  1133.  
  1134. EAs  can  be  used  in  calculator  terms.  The source EA is named 'SEA', the
  1135. destination EA is 'TEA'.  For both exists also a register 'SX' and 'TX' which
  1136. is  0 if the corresponding EA is not used by the instruction at the PC, and 1
  1137. if it is used.
  1138.  
  1139.  
  1140.  
  1141. 3.19    Symbols
  1142. ===============
  1143.  
  1144.  
  1145. SIM now supports a symbol list generated by an external program.  The symbols
  1146. can't  be  edited  yet or new ones added.  Symbols are used in the calculator
  1147. and the disassembler.  The shortcut AMIGA-SHIFT-d toggles use of the symbols.
  1148.  
  1149.  
  1150.  
  1151. 3.20    PAL/NTSC
  1152. ================
  1153.  
  1154.  
  1155. When SIM is invoked on any PAL/NTSC machine for the first time, it adapts its
  1156. display  to  the machine type.  If ECS (or AGA) chipset is available, you are
  1157. allowed to toggle between PAL/NTSC.  NTSC users also can use an NTSC overscan
  1158. display with 28 lines.  The shortcuts used to toggle is is AMIGA-L.
  1159.  
  1160.  
  1161.  
  1162. 3.21    Interrupt Lockup
  1163. ========================
  1164.  
  1165.  
  1166. SIM  uses  the  VB interrupt for its display setup and the PORTS interrupt to
  1167. handle  the  keyboard.   The  concept  of  the  Amiga allows external devices
  1168. connected  to  the  expansion  port  or the Zorro bus to generate interrupts.
  1169. Most  harddisk  controlers  use  this  feature  and  generate  Level  2 and 3
  1170. interrupts.   The basic problem for SIM is that if such a device generates an
  1171. interrupt,  it  does  not neccessarily clear the request by clearing a bit in
  1172. the INTREQ register.  Many devices have their own interrupt request register,
  1173. located  somewhere  in  the  Zorro address space.  Only the interrupt handler
  1174. that  is installed when the device is mounted knows about the address of that
  1175. register.  Therefore SIM cannot cancel such an interrupt and the result would
  1176. be that the machine either locks up or that the device fails.
  1177.  
  1178. To prevent this, SIM will detect if a level 2 or 3 interrupt was generated by
  1179. an  external  device.   If  it  is,  SIM will automatically exit, execute the
  1180. interrupt  routine  for  the  pending  interrupt  and  return through the JSR
  1181. entrance.
  1182.  
  1183.  
  1184.  
  1185.  
  1186. *****************************************************************************
  1187.  4. Communication between YOU and SIM
  1188. *****************************************************************************
  1189.  
  1190.  
  1191.  
  1192. 4.1     The SIM Environement
  1193. ============================
  1194.  
  1195.  
  1196. SIM  provides  a  display  of 200|224|256*640 pixels or 25|28|32 lines and 80
  1197. rows,  depending on the resolution you use.  The screens colors are green and
  1198. dark  blue.   The  screen is devided in header, worktable/debugger window and
  1199. footer, all separated by a bar of '­' chars.
  1200.  
  1201. The  header  normally contains the title and copyright notice but serves also
  1202. as statusline when accessing disk and at keyboard cleanup.
  1203.  
  1204. The  worktable  and  the  debugger  window  share  21|24|28  lines.   In  the
  1205. worktable,  actually  the  monitor,  you can move the cursor around and enter
  1206. commands.   Output  of commands is also displayed in this part.  The debugger
  1207. window  shows  you  one  or  two  views  of  the memory in different forms at
  1208. different addresses, read more about that feature in the appropriate chapter.
  1209. The  contents  of the part of the worktable covered by the debugger window is
  1210. remembered and restored if the window is removed.
  1211.  
  1212. The  footer  contains the cause of SIM's entry, a status and result field and
  1213. the addresses of SIM itself, the display- and backup address.
  1214.  
  1215.  
  1216.  
  1217. 4.2     The Monitor
  1218. ===================
  1219.  
  1220.  
  1221. On the worktable, several basic features are provided:
  1222.  
  1223.  
  1224.       - What  you  see  on  the  monitor (the text) is stored in SIM when you
  1225.         leave.   it  is  available  again if you enter SIM again, the display
  1226.         will be the same.
  1227.  
  1228.       - SIM has two entier keymaps for not qualified, shifted, alternated and
  1229.         shifted+alternated keys, one one custom and one USA.
  1230.  
  1231.       - CTRL-keys  with  assigned  chars  with ascii values from $40-$5f will
  1232.         result  in  a  char  with  the  ascii value from $0-$1f (i.e.  CTRL-J
  1233.         (=$4a) => <CR> (=$a))
  1234.  
  1235.       - CTRL-keys  with  assigned  chars  with ascii values from $60-$7f will
  1236.         result  in  a  char  with  the  ascii value from $0-$1f.
  1237.  
  1238.       - Cursor keys move the cursor by one step.
  1239.  
  1240.       - SHIFT-Cursors key moves the cursor in the extreme positions.
  1241.  
  1242.       - DEL  will  delete the char above the cursor and shift all chars right
  1243.         of the cursor one row left, inserting a space at row 79.
  1244.  
  1245.       - BACKSPACE  will clear the char left of the cursor and shift all chars
  1246.         above and right of the cursor one row left.
  1247.  
  1248.       - SHIFT-DEL  will  insert  a space at the cursor position and shift all
  1249.         chars above and right of the cursor one row right.
  1250.  
  1251.       - SHIFT-BACKSPACE  will clear the char above the cursor move the cursor
  1252.         one row left.
  1253.  
  1254.       - ALT-DEL  will  clear  the visible worktable and put the cursor in the
  1255.         left upper corner next to a period.
  1256.  
  1257.       - ALT-BACKSPACE  will  clear the line in which the cursor is, put a '.'
  1258.         in row 1 and the cursor in row 2.
  1259.  
  1260.       - HELP  prints the first help page, starting in the line below the line
  1261.         the cursor is in actually.
  1262.  
  1263.       - SHIFT-HELP prints the second help page.
  1264.  
  1265.       - F1  to  F10  either execute the command line stored or print the text
  1266.         stored.
  1267.  
  1268.       - SHIFT-ESC copies the last executed command in the line of the cursor.
  1269.  
  1270.       - ALT-ESC  copies the line of the cursor in the command buffer.  It can
  1271.         then be inserted anywhere with SHIFT-ESC.
  1272.  
  1273.       - CR will execute the commands in the line where the cursor is.
  1274.  
  1275.       - ALT-CURSOR  UP  goes  one  step  back in command history and fill the
  1276.         actual line with the actual command in history.
  1277.  
  1278.       - ALT-CURSOR DOWN goes one step forth in command history.
  1279.  
  1280.  
  1281.  
  1282. 4.3     The Commands and their Syntax
  1283. =====================================
  1284.  
  1285.  
  1286. The command line contains the different commands to be executed.  Its form is
  1287. as follows:
  1288.  
  1289.  
  1290.         .<command> <options> (: <command> <options> ...)
  1291.  
  1292.  
  1293. You  can enter several commands in one line, separated by a colon.  The colon
  1294. is  needed,  except  if  the  next  char  is the same as of the last executed
  1295. command  (i.e.   'mmmm'  is allowed and shows $200 bytes at once, starting at
  1296. the actual address).
  1297.  
  1298. While  working  with  SIM, you can get a little list of all commands with the
  1299. two help pages by pressing HELP or SHIFT-HELP:
  1300.  
  1301.  
  1302.      n (s)(i) :assemble    | t [s][e][t] :transfer mem | A (s) :set viewstart
  1303.      e (s)(d) :edit mem    | o [s][e][d] :occupy mem   | w (x) :CPU traps
  1304.      d (s)(e) :disassemble | c (s)(e)(t) :compare mem  | v     :recreate trap
  1305.      a (s)(e) :show ascii  | f (sejd)(m) :find data    | h (n) :history
  1306.      m (s)(e) :show hex    | f (sej'i'i) :find disasm  | g [s] :go sub
  1307.      l (s)(e) :show copper | s (p)(b)(c) :set SIM-adrs | i (n) :leave out
  1308.      p (s)(e) :show text   | F (n)(c){@} :edit F-keys  | u     :next step
  1309.      k (s)(e) :matchbuffer | z (n*n?cb)  :trace steps  | r (rs):edit regs
  1310.      P (s)(m) :show plane  | b (s)(*n?b) :breakpoints  | q/Q   :quit prog
  1311.      ? (expr) :calculate   | T (expr){@} :set linkterm | x/X   :exit and go
  1312.  
  1313.  
  1314.      >f(n)    :format disk | <s [s][s](n) :read secs
  1315.      D (n)    :set drive   | >s [s][s](n) :write secs
  1316.      D?(n)    :find head   | <t [s][t](n) :read tracks
  1317.      B [s]    :bootchksum  | >t [s][t](n) :write tracks
  1318.      K [s]    :blockchksum | L  [fs](n)(s):load file
  1319.      V (path) :directory   | S  [f][s][e] :save file
  1320.      R [s]    :set range   | H  [s][e](p) :hear memory
  1321.  
  1322.  
  1323. In the help page and the explanations, the following shortenings are used for
  1324. options:
  1325.  
  1326.  
  1327.         s: start address|seek value             e: end address
  1328.         i: assembly instructions                d: data line
  1329.         n: decimal number                       x: hexadecimal number
  1330.         r: register                             p: plane address
  1331.         ?: condition term                       f: file name
  1332.         t: destination address|track number     c: text|command line
  1333.         m: mask|modulo                          b: backup/breakmode/block
  1334.         j: options|flags
  1335.  
  1336.  
  1337.         Options in '[]' are neccessary.
  1338.         Options in '()' are optional.
  1339.         Chars in '{}' are optional flags.
  1340.  
  1341.  
  1342. Because  space in SIM is limited, these help pages tell only the basic syntax
  1343. of  a  command.   In  the  rest  of  this chapter all commands with all their
  1344. possibilities and what you can do with them are listed.
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353. Dump Commands
  1354. -------------
  1355.  
  1356.  
  1357.         m (s)(e)        Print memory as hexdump
  1358.         a (s)(e)        Print memory as asciidump
  1359.         d (s)(e)        Disassemble memory
  1360.         l (s)(e)        Disassemble memory as copperlist
  1361.         p (s)(e)        Print memory as text
  1362.  
  1363.  
  1364. Dump commands have all the same options, only the output form changes:
  1365.  
  1366.         command (start address) (end address)
  1367.  
  1368. If  you  give  both  addresses, SIM starts to dump from the start address and
  1369. stops when the end address is reached or passed over.
  1370.  
  1371. If  you give only the start address, SIM starts to dump from that address and
  1372. displays eight lines.
  1373.  
  1374. If you do not give any address, SIM takes the actual address as start address
  1375. and displays eight lines.
  1376.  
  1377. Adress spaces which are not defined are read zero.
  1378.  
  1379. In  disassembly,  the instructions BSR,JSR and TRAP #x are indented and after
  1380. the instructions JMP, BRA, ILLEGAL, RTS, RTE, RTR and RESET a separating line
  1381. of  '-'  is  printed.   Additionally,  resident  breakpoints are marked by an
  1382. asterix, JSR breakpoints with a plus sign amd normal breakoints with a cross.
  1383.  
  1384.  
  1385.  
  1386. EXAMPLES:
  1387.  
  1388.         m 0 100
  1389.         a 100
  1390.         d
  1391.         l 51236 !+60
  1392.         p $25364
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401. Edit Commands
  1402. -------------
  1403.  
  1404.  
  1405.         e (s)(d)        Edit memory
  1406.         n (s)(n)        Assemle
  1407.  
  1408.  
  1409. You  can  modify  the  memory  with these two commands.  They both ignore the
  1410. memory manager and write directly to memory.  The edit command can write data
  1411. to  memory  (see  chapter  'Data  Line'  for details) The assemle command can
  1412. assemble  one  or  several  instructions  separated  by  a ',' to memory (see
  1413. chapter 'Assembler Usage' for info)
  1414.  
  1415. If  you  give  both  start  address  and  data/instructions,  SIM  writes the
  1416. data/instructions to memory.
  1417.  
  1418. If  you  only give the start address, SIM will start to assemble or edit in a
  1419. continuous  mode  where  it always prepares the next line for further data or
  1420. instructions.   To  stop this simply give no instruction or data.  The system
  1421. is  as  clever  as it recognices if in the line it prepares for a new data or
  1422. assemble line, there is already a data or assembly line that was prepared for
  1423. continuous  mode.   If  that  is so, it only updates the address but does not
  1424. clear  the  line.   That  enables you to i.e.  correct a program assembled in
  1425. continuous mode and to insert instructions.
  1426.  
  1427. If you do not give any option, SIM starts to edit/assemble in continuous mode
  1428. at the actual address.
  1429.  
  1430.  
  1431.  
  1432. EXAMPLES:
  1433.  
  1434.         e 70000
  1435.         e>00070000: 0121
  1436.         e>00070000:
  1437.         n 100 nop
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445. Transfer and Occupy
  1446. -------------------
  1447.  
  1448.  
  1449.         t (s)(e)(t)     Transfer memory
  1450.         o (s)(e)(d)     Occupy memory
  1451.  
  1452.  
  1453. Transfer:
  1454.  
  1455. This  command simply copies a part of the memory to another location smartly.
  1456. This means that SIM uses as- or descending mode for copying.  Memory managing
  1457. is used, undefined memory is read zero and not written to.
  1458.  
  1459.         t [s][e][t]     Transfers memory from s to e to new address t.
  1460.  
  1461.  
  1462.  
  1463.  
  1464. Occupy:
  1465.  
  1466. The 'o' command will fill a defined area of memory with a byte pattern.
  1467.  
  1468.         o [s][e][d]     Occupy memory from s to e with data d.
  1469.  
  1470.  
  1471.  
  1472.  
  1473. EXAMPLES:
  1474.  
  1475.         t 0 10000 00c00000
  1476.         o 12564 !+60 nnop
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484. Find and Compare
  1485. ----------------
  1486.  
  1487.  
  1488.         f (s)(e)(j)(d)(m)       Find data
  1489.         f (s)(e)(j) i (i)       Find disassembly
  1490.         c (s)(e)(t)(j)          Compare memory
  1491.         k {@}(s)(e)             Show/set matchbuffer
  1492.  
  1493.  
  1494. SIM  disposes  of sophisticated data search and compare commands.  For any of
  1495. the  find or compare commands you can specify the following options after the
  1496. end address:
  1497.  
  1498.  
  1499.       - +/-n    Sets  the  step  rate.  Only at every nth address is the data
  1500.                 are compared.
  1501.  
  1502.       - '*'     Specifies that addresses where nothing was found or two bytes
  1503.                 are the same are reported.
  1504.  
  1505.       - '@'     When  you  do  not  want a list of addresses but to have them
  1506.                 reported one by one, set this options.  SIM will then execute
  1507.                 F9  each  time something is reported and put the start of the
  1508.                 active view of the debugger window to that address.
  1509.  
  1510.       - '!'     If  you  want  to  collect  and  filter  addresses  with  the
  1511.                 matchbuffer,  set this flag.  After the '!', an 'o' specifies
  1512.                 that  old ones stay, a 'm' that same addresses stay, or a 'n'
  1513.                 that new ones stay.  Combinations are allowed.
  1514.  
  1515.  
  1516.  
  1517.  
  1518. Find data:
  1519.  
  1520. You  can  search  in  a defined area in the memory for a certain byte pattern
  1521. with this command.  Depending of how many options you enter, the command does
  1522. different things:
  1523.  
  1524.  
  1525.         f  [s][e](j)[d][m]      Starts to find from s to e with the options j
  1526.                         for  the byte pattern d that is masked by the mask m.
  1527.                         Only  the  bits that are set in m are concidered when
  1528.                         comparing.  If the mask is shorter than the data, the
  1529.                         rest of the mask will be set to $ff.
  1530.  
  1531.         f  [s][e](j)[d] Starts  to search for data  with all  bits set in the
  1532.                         mask.
  1533.  
  1534.         f [s][e](j)     Starts  to  find for the same data with the same mask
  1535.                         as last time in the area from s to e with new options
  1536.                         j.
  1537.  
  1538.         f [s][e]        Searches again in the area from s to e.
  1539.  
  1540.         f [s]           Starts to search from s.
  1541.  
  1542.         f               Continues to search after the last address reported.
  1543.  
  1544.  
  1545.  
  1546.  
  1547. Find disassembly:
  1548.  
  1549. This command searches an instruction or a fragment of it in a defined area of
  1550. the  memory.   Like the 'find data' command, 'find disassembly' does not need
  1551. all options:
  1552.  
  1553.         f [s][e](j) i [i]       Starts to find from s to e with options j for
  1554.                         the instruction i.
  1555.  
  1556.         f [s][e](j)     Starts  to  find for the same instruction in the area
  1557.                         from s to e with new options j.
  1558.  
  1559.         f [s][e]        Searches again in the area from s to e.
  1560.  
  1561.         f [s]           Starts to search from s.
  1562.  
  1563.         f               Continues to search after the last address reported.
  1564.  
  1565.  
  1566. The  instruction i can be only a fragment like '4(a6)' or '@su*' or an entier
  1567. instruction  like  'moveq  #3,d0'.   Because  the disassembler calculates the
  1568. addresses  of  PC relative addressing modes, this command can also be used to
  1569. track  down  accesses  to  addresses.   Several rules must be concidered when
  1570. designing the search text:
  1571.  
  1572.  
  1573.       - If  there  is  a space in your text, SIM will concider what is before
  1574.         the  space  to  be  the mnemonic.  Because the disassembler leaves an
  1575.         eight  chars  large  field  for the mnemonic where the rest is filled
  1576.         with   spaces,  SIM  does  tabulate  your  entries.   'clr.l d0' will
  1577.         internally made to 'clr.l   d0'.
  1578.  
  1579.       - The  char  '*'  is  used  as  wildcard.   It replaces one char.  I.e.
  1580.         '(a*)' searches for all indirect accesses with any address register.
  1581.  
  1582.       - The  char  '_'  is replaced by a space.  I.e.  '_d0' searches for all
  1583.         accesses on d0 as source ea.
  1584.  
  1585.       - The  char  '@'  at  the  start or the end of your fragment limits the
  1586.         search  on  the start or end of the fragment.  I.e.  '@st' finds only
  1587.         'st.b d0' but not 'tst.l d3'.
  1588.  
  1589.  
  1590.  
  1591.  
  1592. Compare:
  1593.  
  1594. This  command  will  compare  two  areas of memory and report addresses where
  1595. bytes differe or are the same:
  1596.  
  1597.  
  1598.         c [s][e][t](j)  Compares  area  from  s to e with area t to (t+(e-s))
  1599.                         with options j.
  1600.  
  1601.         c [s][e][t]     Compares with no options.
  1602.  
  1603.         c [s][t]        Continues to compare from s and t.
  1604.  
  1605.         c [s]           Compares from s.
  1606.  
  1607.         c :             Continues to compare after last address reported.
  1608.  
  1609.  
  1610.  
  1611.  
  1612. Matchbuffer:
  1613.  
  1614. This  command  allows  you to manipulate and view the matchbuffer.  Refere to
  1615. the chapter 'The Matchbuffer' for further information.
  1616.  
  1617.         k [s][e]        Locates the matchbuffer from s to e and clears it.
  1618.  
  1619.         k *             Clears matchbuffer.
  1620.  
  1621.         k ?             Shows the location and number of entries.
  1622.  
  1623.         k @ [s]         Shows  all  matchbuffer  entries  larger  than  s  by
  1624.                         reporting  them one  by one using F9 and the debugger
  1625.                         windows active view.
  1626.  
  1627.         k [s]           Lists all entries higher than s
  1628.  
  1629.         k               Lists or shows next entries.
  1630.  
  1631.  
  1632.  
  1633.  
  1634. EXAMPLES:
  1635.  
  1636.         f 0 100 00
  1637.         f 10000 20000 !nm 05
  1638.         f 0 20000 @ imoveq #*
  1639.         c 0 100 200 *
  1640.         k 100
  1641.         k@ 0
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650. Processor Commands
  1651. ------------------
  1652.  
  1653.  
  1654.         r (r)(x)        Set/view registers
  1655.         w (x)           Set/view traps
  1656.         v (x)           Create trap
  1657.  
  1658.  
  1659. Registers:
  1660.  
  1661. The  'r' command is used to either set a register d0-d7, a0-a7, ssp, usp, pc,
  1662. sr, m0-m7 and isp/msp or vbr (68020+ only) or to view them:
  1663.  
  1664.  
  1665.         r [r][x]        Sets register r vith new value x.
  1666.  
  1667.         r               Views registers.
  1668.  
  1669.         r?              Views memories m0-m7.
  1670.  
  1671.  
  1672.  
  1673.  
  1674. Traps:
  1675.  
  1676. The  'w'  command  is used to either set or clear the ten basic CPU exception
  1677. vectors or to view their status:
  1678.  
  1679.  
  1680.         w [x]           Sets or clears vector x.
  1681.  
  1682.         w               Lists status of all ten vectors.
  1683.  
  1684.         wk              Clears all traps.
  1685.  
  1686.  
  1687. You  can  set  or  clear  several  vectors at a time by separating the vector
  1688. numbers by kommas.  The vector numbers correspond to the exception numbers, 2
  1689. for bus error upto $b for linef.
  1690.  
  1691. Refere to the chapter 'Traps' for further information.
  1692.  
  1693.  
  1694.  
  1695.  
  1696. Create Traps:
  1697.  
  1698. The  'v'  command  is  used  to  simulate the occurence of an exception or to
  1699. remove one from the stack:
  1700.  
  1701.  
  1702.         v [x]           Simulates exception x.
  1703.  
  1704.         v [-x]          Removes exception x from stack.
  1705.  
  1706.         v               Simulates occurence exception that forced entry.
  1707.  
  1708.         v?              Gives information about the trap that forced entry.
  1709.  
  1710.  
  1711. SIM  can simulate exceptions 2 upto $40.  When you simulate an address or bus
  1712. error, SIM takes either the ssw, ir and aa from the last bus or address error
  1713. or zero for all when none happened yet.
  1714.  
  1715. When  you  simulate  an exception 2 upto $b, which is set by the 'w' command,
  1716. SIM takes the old vector as new pc.
  1717.  
  1718. When you simulate an interrupt, the sr will also contain the interrupt level.
  1719.  
  1720. The 'v' command without options is used to put an exception back on the stack
  1721. when i.e.  you want the old vector to handle the problem.  This works only if
  1722. SIM was entered due to an exception.
  1723.  
  1724. You  can  only  remove  traps from the stack when you are in supervisor mode.
  1725. The  vector  number  is  only  used to know how much has to be taken from the
  1726. stack (14 bytes when 2 or 3, 6 for the rest).
  1727.  
  1728. The 'v?' command is used to know more about the exception, especially address
  1729. and bus errors.
  1730.  
  1731. In the 68020+ version, the 'v' command can only be called without options and
  1732. puts the old stackframe back.
  1733.  
  1734.  
  1735.  
  1736.  
  1737. EXAMPLES:
  1738.  
  1739.         r pc pc+20
  1740.         r m7 d0
  1741.         r?
  1742.         w 4,9
  1743.         wk
  1744.         v 3
  1745.         v -3
  1746.         v?
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754. Breakpoint and Trace
  1755. --------------------
  1756.  
  1757.  
  1758.         b (s)(j)        Set/clear and view breakpoints
  1759.         u               next step
  1760.         z (j)           trace step
  1761.         i (n)           leave out instructions
  1762.  
  1763.  
  1764. Breakpoints:
  1765.  
  1766. The  'b'  command  is  used  to  handle breakpoints.  When you set an illegal
  1767. breakpoint,  you  can  specify the trigger conditions after the address.  The
  1768. following conditions are accepted:
  1769.  
  1770.  
  1771.       - 'l', 'r', 'j'   Breaks when left, right or joystick button pressed.
  1772.  
  1773.       - [n]             Breaks after breakpoint is reached n times.
  1774.  
  1775.       - '?'[n]          Breaks when term n is true (<>0).
  1776.  
  1777.       - *               Breakpoint is resident.
  1778.  
  1779.  
  1780. Refere to the chapter 'Breakpoints' for more information.
  1781.  
  1782.  
  1783.         b [s][j]        Sets a breakpoint at address s with the options j.
  1784.  
  1785.         b [s]           Sets a simple breakpoint at s or clears one.
  1786.  
  1787.         b               Lists all breakpoints.
  1788.  
  1789.         bj [s]          Sets a JSR breakpoint at s.
  1790.  
  1791.         bs [s]          Sets a STACK breakpoint at s.
  1792.  
  1793.         bk              Kills all breakpoints.
  1794.  
  1795.  
  1796. You  can  set  or remove several breakpoints at a time by separating the next
  1797. address from the previous address or options by a komma.
  1798.  
  1799.  
  1800.  
  1801.  
  1802. Trace Step:
  1803.  
  1804. The 'z' command executes trace steps. It either stops after one step or when
  1805. a certain condition is fullfilled:
  1806.  
  1807.       - 'l', 'r' or 'j' Traces until button pressed.
  1808.  
  1809.       - [n]             Traces n steps.
  1810.  
  1811.       - '?' [n]         Traces until term n is true (<>0).
  1812.  
  1813.       - '*' [s]         Traces until pc=s.
  1814.  
  1815.       - 'c'             Emulates 68020 trace steps.
  1816.  
  1817.  
  1818. Refere to the chapter 'Trace' for more information.
  1819.  
  1820.         z [j]           Traces until a condition j is fullfilled.
  1821.  
  1822.         z               Does one trace step.
  1823.  
  1824.  
  1825.  
  1826.  
  1827. Next Step:
  1828.  
  1829. The  'u' command does either one trace step or when the instruction at the PC
  1830. is  a  JSR,  BSR  or  TRAP  #x,  it  does  a trace step and then sets a stack
  1831. breakpoint at a7 (or a7+2 when the instruction was TRAP #x) and exits:
  1832.  
  1833.  
  1834.         u               Do one step.
  1835.  
  1836.  
  1837. Leave Out Instruction:
  1838.  
  1839. This command simply sets the PC one or n instructions further:
  1840.  
  1841.  
  1842.         i [n]           Leaves out n instructions.
  1843.  
  1844.         i               Leaves out one instruction.
  1845.  
  1846.  
  1847.  
  1848.  
  1849. EXAMPLES:
  1850.  
  1851.         b 100 *j100 ?[4]<>$c00276
  1852.         bj 100,200
  1853.         bssp
  1854.         z *pc
  1855.         z j
  1856.         n
  1857.         i 2
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866. Flow
  1867. ----
  1868.  
  1869.  
  1870.         x               Exit
  1871.         X               Exit directly
  1872.         q               Quit
  1873.         Q               Quit directly
  1874.         g [s]           Go to subroutine
  1875.         h (n)           History
  1876.  
  1877.  
  1878. Exit:
  1879.  
  1880. The  'x'  or  'X'  commands  are  used to simply continue the program at full
  1881. speed.   'x'  asks  first if you are sure, reply with 'y' or 'n'.  'X' simply
  1882. exits:
  1883.  
  1884.         x               Exits, but asks for confirmation first.
  1885.  
  1886.         X               Exits directly.
  1887.  
  1888.  
  1889.  
  1890.  
  1891. Quit:
  1892.  
  1893. The  'q'  or  'Q' commands are used to return control over the program to the
  1894. debug server.  'q' asks first if you are sure, 'Q' simply returs directly:
  1895.  
  1896.  
  1897.         q               Quits, but asks for confirmation first.
  1898.  
  1899.         Q               Quits directly.
  1900.  
  1901.  
  1902. Note  the difference between the exit and the quit command.  The exit command
  1903. lets  the program continue.  The quit command calls the debug server and lets
  1904. it  deal  with  the  situation.  The program is not continued.  Refere to the
  1905. chapter 'The Debug Server Entrance' for more information.
  1906.  
  1907.  
  1908.  
  1909.  
  1910. Go Subroutine:
  1911.  
  1912. The 'g' command is used to execute a little subroutine from within SIM:
  1913.  
  1914.  
  1915.         g [s]           Call subroutine at s.
  1916.  
  1917.         gw [s]          Prepare stack for subroutine call but do not exit.
  1918.  
  1919.  
  1920. When SIM calls a subroutine, it first pushes the old pc on the stack and then
  1921. the  return  address  for  the  rts.   If the subroutine completes with a RTS
  1922. instruction, SIM is invoked again.
  1923.  
  1924. The  'gw'  command  does only prepare the stack for the operation, that is it
  1925. pushes  the  return  address  and the old PC value on the stack, but does not
  1926. exit yet.  This is i.e.  used to trace a subroutine.
  1927.  
  1928.  
  1929.  
  1930.  
  1931. History:
  1932.  
  1933. SIM  remembers the last five sets of registers as they were when SIM was left
  1934. for the last five times.  The list is also updated after each step when doing
  1935. conditioned trace and each time a conditioned breakpoint is reached:
  1936.  
  1937.  
  1938.         h [n]           Display nth last history.
  1939.  
  1940.         h               Display all five history entries.
  1941.  
  1942.  
  1943. SIM does not only remember the registers d0-a6, usp, ssp (isp/msp), sr and pc
  1944. but also the instruction at the pc because of selfmodifying code.
  1945.  
  1946.  
  1947.  
  1948.  
  1949. EXAMPLES:
  1950.  
  1951.         h 3
  1952.         X
  1953.         q
  1954.         g 100
  1955.         gw 200
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964. Diskoperations
  1965. --------------
  1966.  
  1967.  
  1968.         D  (n)          Set drive for disk operations
  1969.         <t (s)(s)(n)    Read tracks
  1970.         >t (s)(s)(n)    Write tracks
  1971.         <s (s)(s)(n)    Read sectors
  1972.         >s (s)(s)(n)    Write sector
  1973.         >f (n)          Format disk
  1974.         B  (s)          Calculate bootblock checksum
  1975.         K  (s)          Calculate block checksum
  1976.  
  1977.  
  1978. Set Drive:
  1979.  
  1980. The  'D'  command  is  used  to set the drive number that is used for further
  1981. diskoperations  (tracks,  sectors or format, but not for file operations!) or
  1982. to  ask for the actually used drive or to ask for the position of the head of
  1983. a drive:
  1984.  
  1985.  
  1986.         D [n]           Uses drive n (0-3) as actual drive.
  1987.  
  1988.         D               Shows actual drive.
  1989.  
  1990.         D? [n]          Finds position of head of drive n.
  1991.  
  1992.         D?              Finds position of head of actual drive.
  1993.  
  1994.  
  1995. The  headposition  is  reported  as logical track, the sideselect bit will be
  1996. concidered  when  calculating the position.  In most cases (DOS included) the
  1997. sideselect bit will be set directly before DMA access and put to an undefined
  1998. state afterwards.  If that is so when you use this command, you must find the
  1999. side that is used on your own.
  2000.  
  2001.  
  2002.  
  2003.  
  2004. Read Track:
  2005.  
  2006. The '<t' command simply reads entier logical tracks (0-159) into memory:
  2007.  
  2008.  
  2009.         <t [s][t][n]    Reads n tracks starting with t to s.
  2010.  
  2011.         <t [s][t]       Reads one track t to s.
  2012.  
  2013.  
  2014. SIM  does  not  test  where  the data is read to, you should not overread the
  2015. display or SIM.  Memory managing is not yet supported in this function.
  2016.  
  2017.  
  2018.  
  2019.  
  2020. Write Track:
  2021.  
  2022. The '>t' command writes an area of the memory as logical tracks on disk:
  2023.  
  2024.         >t [s][t][n]    Writes n tracks starting with t, data start at s.
  2025.  
  2026.         >t [s][t]       Writes one track t, data start at s.
  2027.  
  2028.  
  2029. This command does not support memory managing yet.
  2030.  
  2031.  
  2032.  
  2033.  
  2034. Read Sector:
  2035.  
  2036. With the '<s' command you can read single sectors from disk to memory:
  2037.  
  2038.  
  2039.         <s [s][b][n]    Reads n sectors starting with b to s.
  2040.  
  2041.         <s [s][b]       Reads one sector b to s.
  2042.  
  2043.  
  2044. This command does not support memory managing yet.
  2045.  
  2046.  
  2047.  
  2048.  
  2049. Write Sector:
  2050.  
  2051. With the '>s' command you can write single sectors from disk to memory:
  2052.  
  2053.  
  2054.         <s [s][b][n]    Writes n sectors starting with b, data start at s
  2055.  
  2056.         <s [s][b]       Writes one sector b, data start at s.
  2057.  
  2058.  
  2059. This command does not support memory managing yet.
  2060.  
  2061.  
  2062.  
  2063.  
  2064. Format Disk:
  2065.  
  2066. The '>f' command is used to format and initialize a disk with OFS:
  2067.  
  2068.  
  2069.         >f [n]          Formats disk in drive n.
  2070.  
  2071.         >f              Formats disk in actual drive.
  2072.  
  2073.  
  2074. You  can't  yet  enter  a  name  for  the  disk,  it  will  automatically  be
  2075. 'DATA-DISK'.   The  creation  date  is  zeroed too.  AmigaDOS cannot separate
  2076. disks  with  the same name and same date.  So never keep two datadisks in two
  2077. drives simultaneously, or DOS will get into troubble.
  2078.  
  2079. If  you  format  a disk that was previously in a drive and you return to DOS,
  2080. remove and reinsert that disk for DOS must know the new name and new bitmap.
  2081.  
  2082.  
  2083.  
  2084.  
  2085. Bootchecksum:
  2086.  
  2087. When  you  want  to  save  a  bootblock to a disk, you may have to update the
  2088. checksum with this command:
  2089.  
  2090.  
  2091.         B [s]           Sets new checksum of bootblock that starts at s.
  2092.  
  2093.  
  2094.  
  2095.  
  2096. Blockchecksum:
  2097.  
  2098. When  you  want to save an edited datablock on a disk, you may have to update
  2099. the checksum with this command:
  2100.  
  2101.  
  2102.         K [s]           Sets new checksum of block that starts at s.
  2103.  
  2104.  
  2105.  
  2106.  
  2107. EXAMPLES:
  2108.  
  2109.         <t c00000 0 80
  2110.         >t c00000 0 80
  2111.         >s 70000 0 2
  2112.         <s 60000 880
  2113.         D1
  2114.         D? 2
  2115.         >f 0
  2116.         B 60000
  2117.         K 70000
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126. Fileoperations
  2127. --------------
  2128.  
  2129.         L [f][s](n)(s)          Load file
  2130.         S [f][s][e]             Save file
  2131.         V (path)                List directory
  2132.  
  2133.  
  2134. Paths  and filenames can either be given plainly or between ' or ".  The only
  2135. devices  known  are  DF0:, DF1:, DF2:  and DF3:, disknames are not supported.
  2136. Refere to chapter 'Files' for more information.
  2137.  
  2138.  
  2139. Load File:
  2140.  
  2141. This command loads a file directly into memory:
  2142.  
  2143.  
  2144.         L [f][s]        Loads file f to s.
  2145.  
  2146.         L [f][s](n)     Loads n bytes from file f to s.
  2147.  
  2148.         L [f][s](n)(o)  Loads n  bytes  from  file f to s,  o bytes from  the
  2149.                         start of the file.
  2150.  
  2151.  
  2152. Memory managing is supported.  You still should not load data over SIM.
  2153.  
  2154.  
  2155.  
  2156.  
  2157. Save File:
  2158.  
  2159. With this command you can save an area of memory as file to disk:
  2160.  
  2161.  
  2162.         S [f][s][e]     Saves memory from s to e as file f
  2163.  
  2164.  
  2165. This  command is also used to delete files.  To do so simply save a file with
  2166. the  name  of the file you want to delete and the same start- and end address
  2167. (filelength=0).
  2168.  
  2169. Memory managing is supported.
  2170.  
  2171.  
  2172.  
  2173.  
  2174. List Directory:
  2175.  
  2176. This command is used to list the directory of the root directory of a disk or
  2177. a user directory:
  2178.  
  2179.  
  2180.         V [path]        Lists directory of directory specified by path.
  2181.  
  2182.         V               Lists directory of drive used last.
  2183.  
  2184.  
  2185. SIM  reads  the directory page by page because the display is used as buffer.
  2186. If a page is full or the directory is read, it displays it.  If there is more
  2187. to  be displayed, SIM writes 'more' in the footer.  You can continue and view
  2188. the next part by pressing <SPACE>.
  2189.  
  2190.  
  2191.  
  2192.  
  2193. EXAMPLES:
  2194.  
  2195.         L 'df0:c/dir' 60000
  2196.         S df1:data 0 100
  2197.         V df0:c
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206. Miscellaneous
  2207. -------------
  2208.  
  2209.  
  2210.         ? [n]{,}(n)     Calculate
  2211.         F (n)(c){@}     Define function keys
  2212.         P (s)(m)        Start graphic searcher
  2213.         H [s][e](p)     Hear sound
  2214.         s (p)(b)(c)     Set display, backup and program addresses
  2215.         l*              Show copperlist
  2216.         l? (s)(e)       Find active copperlist
  2217.         l= [n]          Find copperlist one or two
  2218.         R [s]           Set range for access scan
  2219.  
  2220.  
  2221. Calculate:
  2222.  
  2223. If  you need to calculate something, you can do it with the '?' command.  SIM
  2224. will calculate the result of one or several terms and return the result(s) as
  2225. hexadecimal,  signed  hexadecimal,  decimal  and  binary  number and as ascii
  2226. chars:
  2227.  
  2228.  
  2229.         ? [n]           Calculate result of n.
  2230.  
  2231.  
  2232. You  can calculate the result of several terms at the same time by separating
  2233. the terms by a komma.
  2234.  
  2235.  
  2236.  
  2237.  
  2238. Function Keys:
  2239.  
  2240. The 'F' command is used to set and view the function key definitions:
  2241.  
  2242.  
  2243.         F [n][c] @      Defines key n  with command  line c that  is executed
  2244.                         directly.
  2245.  
  2246.         F [n][c]        Occupies key n with text c.
  2247.  
  2248.         F [n]           Clears key n.
  2249.  
  2250.         F               Lists key definitions.
  2251.  
  2252.  
  2253. When  you  set  a  function  key, the entier rest of the command line will be
  2254. taken for the command or text.
  2255.  
  2256. When  you  list  the  function keys, the ones that are locked by Amiga-Fx are
  2257. marked by an asterix, the directly executables have an '@' at the end.
  2258.  
  2259.  
  2260.  
  2261.  
  2262. Graphic Searcher:
  2263.  
  2264. The 'P' command starts the one plane graphic searcher:
  2265.  
  2266.  
  2267.         P [s][m]        Starts at address s with modulo m.
  2268.  
  2269.         P [s]           Starts at address s with last modulo.
  2270.  
  2271.         P               Starts at last address with last modulo.
  2272.  
  2273.  
  2274. When you have activated the graphic searcher, the following keys are used for
  2275. display control:
  2276.  
  2277.  
  2278.         Cursor up        Scrolls plane one line down.
  2279.  
  2280.         Cursor dn        Scrolls plane one line up.
  2281.  
  2282.         Cursor left      Scrolls plane one line right.
  2283.  
  2284.         Cursor right     Scrolls plane one line left.
  2285.  
  2286.         SHIFT-Cursor up  Scrolls plane one screen down.
  2287.  
  2288.         SHIFT-Cursor dn  Scrolls plane one screen up.
  2289.  
  2290.         HELP             Modulo=modulo+2.
  2291.  
  2292.         DEL              Modulo=modulo-2.
  2293.  
  2294.         SHIFT-Help       Modulo=modulo+16.
  2295.  
  2296.         SHIFT-Del        Modulo=modulo-16.
  2297.  
  2298.         BACKSPACE        Modulo=0.
  2299.  
  2300.         CR               Switches between hires and lores.
  2301.  
  2302.         CTRL             Ends graphic searcher.
  2303.  
  2304.  
  2305. Since  the  graphic searcher also supports the memory manager, it is possible
  2306. not only to look at the graphic memory but at the entier space of addressable
  2307. memory including other memory and rom image.
  2308.  
  2309. Because of technical reasons the status bar is now located at the bottom.  It
  2310. has  also become neccessary to limit the modulo.  It can now range from $ffb2
  2311. to $3ffe for a hires and from $ffda to $3ffe for a lores plane.
  2312.  
  2313.  
  2314.  
  2315.  
  2316. Hear Sound:
  2317.  
  2318. The 'H' command sends an area of memory as a sample to the audio hardware:
  2319.  
  2320.  
  2321.         H [s][e](p)     Hear memory from s to e with period p.
  2322.  
  2323.         H [s][e]        Hear memory from s to e with last period.
  2324.  
  2325.  
  2326. Memory manager is supported.
  2327.  
  2328.  
  2329.  
  2330.  
  2331. SIM Addresses:
  2332.  
  2333. The 's' command is used to transfer the display and backup and the SIM
  2334. code itself:
  2335.  
  2336.         s [p][b][c]     New display at p, new backup at b, SIM copied to c.
  2337.  
  2338.         s [p][b]        New display at p, new backup at b.
  2339.  
  2340.         s [p]           New display at p.
  2341.  
  2342.         s               Redraws the display.
  2343.  
  2344.  
  2345. Be  carefull  when you transfer the SIM code.  SIM does adjust breakpoint and
  2346. traps  to  the  new address, but a possible debug server will only know about
  2347. the new location when you quit SIM.  The old copy of SIM will still work, but
  2348. its  breakpoint  and  trap  system will be confused.  The same problem occurs
  2349. when the tasktraphandle is set to SIM.  Use this command only when the system
  2350. is dead.
  2351.  
  2352. SIM  does  not  check the values you enter, make sure that you do not specify
  2353. locations where i.e.  display and SIM would overlay.
  2354.  
  2355.  
  2356.  
  2357.  
  2358. Copperlist:
  2359.  
  2360. The 'l' command is basically used to disassemble a copperlist.  The following
  2361. variations are used for different actions:
  2362.  
  2363.  
  2364.         l*              Shows the active copperlist.
  2365.  
  2366.  
  2367.         l? [s][e]       Starts to search for the copperlist from s to e.
  2368.  
  2369.         l? [s]          Starts to search for the copperlist from s to $80000.
  2370.  
  2371.         l?              Searches for the copperlist from $70 to $80000.
  2372.  
  2373.         l= [n]          Starts to search quickly for copperlist 1 or 2.
  2374.  
  2375.  
  2376. To end copperlist display or searching, press <CTRL>.
  2377.  
  2378. When  you  search  quickly,  the  copperlist  you  are  looking  for  will be
  2379. activated.  If this one is not the running one, search again for the other to
  2380. set the other copperlist again.  This kind of searching has the risk that you
  2381. may search for a copperlist that does not exist.
  2382.  
  2383. The  'l='  function  does  not  work  properly on MC68020+ due to some timing
  2384. problems.  Calling it on any MC68020+ may not find a copperlist.
  2385.  
  2386.  
  2387.  
  2388.  
  2389. Set Scanrange:
  2390.  
  2391. The  'R'  command  is  used  to  define  the  range  in which the access scan
  2392. shortcuts will search for accesses.  Default is $10000:
  2393.  
  2394.  
  2395.         R [s]           Sets range to s.
  2396.  
  2397.  
  2398.  
  2399.  
  2400. EXAMPLES:
  2401.  
  2402.         ? 256*5,52*56
  2403.         F10 r:dpc pc@
  2404.         F
  2405.         P 12356 52
  2406.         s 70000 c50000 c40000
  2407.         l*
  2408.         l=1
  2409.         l? 20000
  2410.         R $80000
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418. Debugger Window Support
  2419. -----------------------
  2420.  
  2421.  
  2422.         A [s]           Set new start address
  2423.         T [s]{@}        Set linkterm
  2424.  
  2425.  
  2426. Start Address:
  2427.  
  2428. With this command you can directly set the start address of the active view:
  2429.  
  2430.         A [s]           Set new start address of view to s.
  2431.  
  2432.  
  2433.  
  2434.  
  2435. Linkterm:
  2436.  
  2437. To  set  a  linkterm for a view, you use the 'T' command.  SIM will calculate
  2438. the  result  of  this  term  and  use it as new start address each time it is
  2439. entered or the AMIGA-r shortcut is pressed:
  2440.  
  2441.  
  2442.         T [s] @         Set smart linkterm for active view.
  2443.  
  2444.         T [s]           Set simple linkterm for active view.
  2445.  
  2446.         T               Removes linkterm.
  2447.  
  2448.  
  2449. When  SIM  calculates  a  simple  linkterm,  it takes the result as new start
  2450. address.  The result of a smart linkterm is only used as new start address if
  2451. it  is  not  in  the space currently displayed in the view.  Normally this is
  2452. only used to link a view to the PC.
  2453.  
  2454.  
  2455.  
  2456.  
  2457. EXAMPLES:
  2458.  
  2459.         A a0+56
  2460.         T a0+d0
  2461.         T pc @
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471. 4.4     The Debugger Window
  2472. ===========================
  2473.  
  2474.  
  2475. You can switch it on or off by pressing <esc>.  When you do so, a part of the
  2476. worktable  is  locked  for the cursor and used to print out the registers and
  2477. one  or  two  different  views of the memory in different forms (disassembly,
  2478. ascii etc.).  The window is updated as soon as you execute a command that may
  2479. change the memory and at entry of SIM.
  2480.  
  2481. The  two  views have two start addresses that are stored in m0 and m1.  m1 is
  2482. unused when you do not splitt the window and use only one view.
  2483.  
  2484. You can link the two views to two terms, the socalled 'linkterms'.
  2485.  
  2486.  
  2487.  
  2488. 4.5 Debugger Window Shortcuts
  2489. =============================
  2490.  
  2491.  
  2492. The  window  and its views are controled with shortcuts that are qualified by
  2493. either  left or right Amiga.  If you have splitted the window, you can select
  2494. the view that recieves the commands by pressing <TAB>.
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503. View Address
  2504. ------------
  2505.  
  2506.  
  2507.         Cursor up       Decreases  the  views  start  address and scrolls the
  2508.                         display one line down.
  2509.  
  2510.         Cursor dn       Increases  the  views  start  address and scrolls the
  2511.                         display one line up.
  2512.  
  2513.         Cursor left     Decreases  the  views  start address by one byte (two
  2514.                         bytes for disassembly and copper dump).
  2515.  
  2516.         Cursor right    Increases  the  views  start address by one byte (two
  2517.                         bytes for disassembly and copper dump).
  2518.  
  2519.         SHIFT-C up      Decreases  the  views  start  address and scrolls the
  2520.                         display one page up.
  2521.  
  2522.         SHIFT-C dn      Increases  the  views  start  address and scrolls the
  2523.                         display one page down.
  2524.  
  2525.         ALT-C up        Decreases  the  size of the current view by one line.
  2526.                         The minimum size is one line.
  2527.  
  2528.         ALT-C dn        Increases  the  size of the current view by one line.
  2529.                         The  maximum size is as large as there stays one line
  2530.                         for the monitor.  If the cursor was in a line used by
  2531.                         the  debugger  window, it is moved to the top line in
  2532.                         the worktable.
  2533.  
  2534.         SHIFT-Alt-C up  Moves  the  bar separating the two views one line up,
  2535.                         which  decreases  the  upper  view  and increases the
  2536.                         lower view one line.
  2537.  
  2538.         SHIFT-Alt-C dn  Moves the bar separating the two views one line down,
  2539.                         which  increases  the  upper  view  and decreases the
  2540.                         lower view one line.
  2541.  
  2542.         s               Splitts  the window into two views or unsplitts again
  2543.                         and removes the inactive view.
  2544.  
  2545.         r               Recalculates the linkterm(s) and sets the views start
  2546.                         addresses again.
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554. Output Form Selection
  2555. ---------------------
  2556.  
  2557.  
  2558.         a               Selects asciidump for the active view.
  2559.  
  2560.         m               Selects hexdump for the active view.
  2561.  
  2562.         l               Selects copper disassembly for the active view.
  2563.  
  2564.         m               Selects disassembly for the active view.
  2565.  
  2566.         p               Selects text for the active view.
  2567.  
  2568.         D               Dis-/enables symbols in general.
  2569.  
  2570.         S               Allows symbols  also for $xxxx(An) either only at the
  2571.                         PC or throughout the entier disassembly.
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579. Breakpoints
  2580. -----------
  2581.  
  2582.  
  2583.         b               Sets an unconditioned illegal breakpoint at the start
  2584.                         address of the active view.
  2585.  
  2586.         v               Sets  an unconditioned resident illegal breakpoint at
  2587.                         the start address of the active view.
  2588.  
  2589.         B               Sets  a  JSR-breakpoint  at  the start address of the
  2590.                         active view.
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599. Flow
  2600. ----
  2601.  
  2602.  
  2603.         z               Does one trace step.
  2604.  
  2605.         u               Does  one  trace  step  that  does  not  follow  into
  2606.                         subroutines.
  2607.  
  2608.         i               Puts PC to next instruction.
  2609.  
  2610.         x               Exits SIM.
  2611.  
  2612.         q               Quits SIM and returns control to debug server.
  2613.  
  2614.         g               Leaves   a   subroutine.    Therefore   SIM   puts  a
  2615.                         STACK-breakpoint   at  the  actual  stackpointer  and
  2616.                         exits.   Do  not  use  this  when  the subroutine has
  2617.                         already put more data on the stack.  This corresponds
  2618.                         to the command line 'bssp:X'.
  2619.  
  2620.         G               Performs an RTS. Basically does 'rpc[sp]:rspsp+4'.
  2621.  
  2622.         j               Sets the pc to the start address of the active view.
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631. Edit
  2632. ----
  2633.  
  2634.         e               Starts  to  edit  in  continuous  mode  at  the start
  2635.                         address of the active view.
  2636.  
  2637.         n               Starts  to  assemble  in continuous mode at the start
  2638.                         address of the active view.
  2639.  
  2640.         N               Replaces  the instruction at the start address of the
  2641.                         active view with NOP instruction.
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649. Indirection
  2650. -----------
  2651.  
  2652.  
  2653.         [               Goes  to  next higher indirection level and takes the
  2654.                         longword  at  the start address of the active view as
  2655.                         the new start address and stores the old one.
  2656.  
  2657.         ]               Goes  to  previous  indirection  level  and takes the
  2658.                         stored start address as the new one.
  2659.  
  2660.         {               Same as AMGIA-[ but the longword will be read as BCPL
  2661.                         and multiplied by four.
  2662.  
  2663.         }               Goes  to  next  higher indirection level and uses the
  2664.                         last address this level pointed at.
  2665.  
  2666.         SHIFT-ALT-C left  If  the  instruction  at  the PC is a branch of any
  2667.                         kind,  an indirection to the address of the branch is
  2668.                         done.
  2669.  
  2670.         ALT-C           If  the  instruction  at  the  start of the view is a
  2671.                         branch  of any kind, an indirection to the address of
  2672.                         the branch is done.
  2673.  
  2674.         SHIFT-ALT-C right Goes to previous indirection level.
  2675.  
  2676.         ALT-C right     Goes to previous indirection level.
  2677.  
  2678.  
  2679. The  indirection  commands  can  have  a maximum depth of 8 levels.  SIM does
  2680. never reset to the first level on its own, if you have reached the limit, you
  2681. must reset it by returning to level 1.
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691. Find and Compare
  2692. ----------------
  2693.  
  2694.  
  2695.         f               Continues  to  search  at  the  start  address of the
  2696.                         active view.
  2697.  
  2698.         c               Continues to compare.  The source address will be the
  2699.                         start  address  of  the  first view , the destination
  2700.                         address the start address of the second view.
  2701.  
  2702.         >               Initiates  scan  for  accesses  on  start  address of
  2703.                         current  view.   The  range  can  be set with the 'R'
  2704.                         command,  default  is  $10000.   SIM will search both
  2705.                         upwards   and   downwards  for  accesses,  the  range
  2706.                         specifies the maximum distance to test.
  2707.  
  2708.         <               Continues scan.
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718. Miscellaneous
  2719. -------------
  2720.  
  2721.  
  2722.         P               Toggles the printer on/off. The printer can only be
  2723.                         activated if there is one connected to the parallel
  2724.                         port and it is selected.
  2725.  
  2726.         H               Makes a hardcopy of the actual display by printing it
  2727.                         as  text.   You  do  not have to activate the printer
  2728.                         first.
  2729.  
  2730.         k               Toggles between US keymap and custom keymap.
  2731.  
  2732.         !               Flushes keystatefield, see chapter 'The Keyboard'.
  2733.  
  2734.         ?               Toggles  keyboard  buffer  killer,  see  chapter 'The
  2735.                         Keyboard'
  2736.  
  2737.         +               Toggles  fully  printable  charset.  When switched on
  2738.                         (full), the chars $0-$1f and $80-$9f are not replaced
  2739.                         by a period in asciidump, hexdump etc.  Switch it off
  2740.                         (semi) when using the printer.
  2741.  
  2742.         \               Toggles  the  auto-unmodify traps feature.  When this
  2743.                         is switched on, all modified traps are set again when
  2744.                         you leave SIM.
  2745.  
  2746.         F1 to F10       Toggles availability of funktion keys.
  2747.  
  2748.         0 to 9          Takes  one  of the ten position memories as the start
  2749.                         address of the active view.
  2750.  
  2751.         SHIFT-0 to 9    Stores the start address of the active view in one of
  2752.                         the  ten  position  memories.   Works  only  with the
  2753.                         keypad!
  2754.  
  2755.         L               Switches  between  PAL, NTSC and NTSC overscan if ECS
  2756.                         or  AGA chipset is available.  If not, NTSC users can
  2757.                         switch between NTSC and NTSC overscan only.
  2758.  
  2759.         M               Toggles the MMU on or off (68020+ only).
  2760.  
  2761.         R               Toggles register display mode:  Either display MSP or
  2762.                         SR flags (68020+ only).
  2763.  
  2764.         ®               Toggles register display mode:  Either small register
  2765.                         list or large.
  2766.  
  2767.         Z               Toggles  EA calculation for condition breakpoints and
  2768.                         trace  on/off.  If the SEA, TEA, SX or TX register is
  2769.                         used in an condition expression, switch this on.
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779. *****************************************************************************
  2780.         5.      Additional Information
  2781. *****************************************************************************
  2782.  
  2783.  
  2784.  
  2785. 5.1     Assembler Usage
  2786. =======================
  2787.  
  2788.  
  2789. SIM  contains  a  full  68000  assembler  which allows you to make changes to
  2790. programs while debugging.  It supports the standard optimisations and aliases
  2791. used by most other assemblers:
  2792.  
  2793.  
  2794.       - ADDI  and  ADDA can be replaced by ADD.  ADDX can also be replaced by
  2795.         ADD  if  the  effective  addresses are address register indirect with
  2796.         predecrement.
  2797.  
  2798.       - SUBI  and  SUBA can be replaced by SUB.  SUBX can also be replaced by
  2799.         SUB  if  the  effective  addresses are address register indirect with
  2800.         predecrement.
  2801.  
  2802.       - CMP can be used instead of CMPA, CMPI and CMPM.
  2803.  
  2804.       - EOR, OR and AND can be used instead of EORI, ORI and ANDI.
  2805.  
  2806.       - Bcc  and  DBcc  instructions  and PC-relative effective addresses use
  2807.         absolute addresses.  It is possible to specify the offset directly by
  2808.         puting  a  '+'  or  '-'  sign  in  front (but note that the offset is
  2809.         counted from start of instruction plus 2):
  2810.  
  2811.                 00060010:       bra     $60000
  2812.           or    00060010:       bra     -$12
  2813.  
  2814.       - If no size is given, Bcc will be optimised to short if possible.
  2815.  
  2816.       - If  no size given, memory direct effective addresses are optimised to
  2817.         WORD if possible.
  2818.  
  2819.       - If  no  size given for an instruction, the default size is used which
  2820.         in most cases is WORD.
  2821.  
  2822.       - The interpreter is very tollerant concerning spaces, a line like
  2823.  
  2824.                 move.l    (  $75 ) (   PC  , D7.l  )  , ( $4 ).w
  2825.  
  2826.         will be accepted and assembled correctly.
  2827.  
  2828.  
  2829.  
  2830. 5.2     Calculator Usage
  2831. ========================
  2832.  
  2833.  
  2834. The  calculator  is one of the central functions of SIM, all numeric input is
  2835. handled  by  it.   It  disposes  of  several very useful operations and value
  2836. forms.  The following operators are supported, sorted after priority:
  2837.  
  2838.  
  2839.         ( )     Brackets:   Correspond to normal brackets.  Number of opening
  2840.                 and  closing  brackets  must be the same.  Maximum nesting is
  2841.                 127.
  2842.  
  2843.         [ ]     Memory indirection:  The result of the term in these brackets
  2844.                 an address and the content of the memory at that address will
  2845.                 be read.
  2846.  
  2847.                 A  size directly after the closing bracket will define if the
  2848.                 value  will  be  read as a BYTE, WORD or LONG and extended to
  2849.                 LONG.   I.e.:  [4].l reads out AbsExecBase, [$dff002].w reads
  2850.                 out the actual DMACON as a WORD.
  2851.  
  2852.         -       Prefix  change:   Changes  a positive value to a negative and
  2853.                 vice versa.  I.e.:  -5 is -5, -0 is 0, --6 is 6.
  2854.  
  2855.         ~       Logical NOT: Inverts all 32 bits of the value. I.e.: ~5 is -6.
  2856.  
  2857.         .s      Sizing:   Any  value  will  be extended to LONG from the size
  2858.                 specified.  I.e.:  $89.b is $ffffff89.
  2859.  
  2860.                 The  size  of  the result is used both for the assembler when
  2861.                 using  memory  direct  effective addresses and for data input
  2862.                 for   the  memory  edit  command  etc.   If  multiple  sizing
  2863.                 operations  occur,  the  last sizing  operation in the lowest
  2864.                 bracket level defines the finial size of the result.
  2865.  
  2866.         * /     Multiply and divide: Signed LONG multiplication and division.
  2867.                 I.e.: -$56*5 is fffffe52, 9/-3 is -3.
  2868.  
  2869.         \       Modulo: Signed LONG modulo. I.e.: 11\4 is 3.
  2870.  
  2871.         + -     Addition  and  subtraction:   LONG  addition and subtraction.
  2872.                 I.e.:  1000-9 is 991.
  2873.  
  2874.         <<      Shift left:  Correspond to a multiplication with 2 to the nth
  2875.                 power,  whereas  n is the numer of bits to be shifted.  I.e.:
  2876.                 $20<<8 is $2000.
  2877.  
  2878.         >>      Shift  right:   Corresponds  to  a  division  by 2 to the nth
  2879.                 power,  whereas  n is the numer of bits to be shifted.  I.e.:
  2880.                 $2000>>8 is $20.
  2881.  
  2882.         &       Logical  AND:   LONG  AND  operation.   I.e.:  $1234&$ff00 is
  2883.                 $1200.
  2884.  
  2885.         !       Logical EOR: LONG EOR operation. I.e.: $c1!$54 is $a5.
  2886.  
  2887.         |       Logical OR:  LONG OR operation.  I.e.:  $1200|$34 is $1234.
  2888.  
  2889.         <>      Not  equal:   Result  of  this  operation is -1 if values not
  2890.                 equal, else 0.  I.e.:  5<>6 is -1, 3<>3 is 0.
  2891.  
  2892.         =       Equal:   Result  of this operation is -1 if values are equal,
  2893.                 else 0.  I.e.:  5=6 is 0, 3=3 is -1.
  2894.  
  2895.         <=      Lower or same:  Signed comparison, result is -1 if value left
  2896.                 of operator is lower or the same than the right value.  I.e.:
  2897.                 1<=1 is -1, 6<=5 is 0.
  2898.  
  2899.         >=      Greater  or  equal:  Signed comparison, result is -1 if value
  2900.                 left  of  operator  is greater or equal than the right value.
  2901.                 I.e.:  2=>1 is -1, 0=>5 is 0.
  2902.  
  2903.         <       Less:   Signed  comparison,  result  is  -1  if value left of
  2904.                 operator  is less than the right value.  I.e.:  1<1 is 0, 0<5
  2905.                 is -1.
  2906.  
  2907.         >       Greater:   Signed  comparison,  result is -1 if value left of
  2908.                 operator  is greater than the right value.  I.e.:  2>1 is -1,
  2909.                 0>5 is 0.
  2910.  
  2911.  
  2912. As for the form of values, the following are supported:
  2913.  
  2914.  
  2915.         $x      Hexadecimal number:  A number in hexadecimal form, consisting
  2916.                 of max.  8 digits 0-9 and a-f.  I.e.:  $badcode1
  2917.  
  2918.         #x      Decimal  number:   A  number  in  decimal form, consisting of
  2919.                 digits 0-9.  I.e.:  #1992.
  2920.  
  2921.         %x      Binary  number:   A number in binary form, consisting of max.
  2922.                 32 digits 0 and 1.  I.e.:  %1010001011.
  2923.  
  2924.         ' "     ASCII  chars:   A  number  consisting of max.  4 ASCII chars.
  2925.                 The  string  must be introduced and ended with the same sign.
  2926.                 I.e.:  "SIM!", 'DATA', '"MC"'.
  2927.  
  2928.         !       Last  result:   Stands  for  the  result  of  the  last  term
  2929.                 calculated.   I.e.:   To  display  16 bytes at $50000 one can
  2930.                 enter the command 'm $50000 !+$10'.
  2931.  
  2932.         @       Actual  address:   Stands for the actual address used by dump
  2933.                 commands and edit/assembly commands.  I.e.:  @-100.
  2934.  
  2935.         SIM     SIM start:  The program and base address of SIM.
  2936.  
  2937.         D0-D7 ,A0-A7 ,PC ,SP ,SSP ,USP ,SR ,CCR and M0-M7
  2938.         (MSP/ISP, VBR for 68020+)
  2939.  
  2940.                 CPU  registers:  The calculator can directly use the contents
  2941.                 of these registers.  SSP is the supervisor stack pointer, USP
  2942.                 the  userstack  pointer,  SP  and A7 the actual stack pointer
  2943.                 (68020+:  SSP is the actual supervisor stack pointer, MSP and
  2944.                 ISP  the  master and interrupt stack pointers, VBR the vector
  2945.                 base register).
  2946.  
  2947.                 M0-M7  are  variables,  M0  and  M1  are  used  as view start
  2948.                 registers.  I.e.:  pc+10-d0.
  2949.  
  2950.         SEA, TEA, SX, TX
  2951.  
  2952.                 The effective address of the source and destination EA of the
  2953.                 instruction  at the PC.  The SX and TX registers are 1 if the
  2954.                 instruction  has a source/destination EA, otherwise 0 and the
  2955.                 corresponding EA register is undefined.  I.e.:  sea*sx
  2956.  
  2957.         x,\x    Symbols: Uses the symbol specified after a '\'.  I.e. \start.
  2958.  
  2959.  
  2960. A  term normally ends at a space, a colon, a semicolon, a komma or a carriage
  2961. return.   If you have opened a bracket, you can have spaces between operators
  2962. and  values, but ONLY then.  Otherwise, the end of the term will not be there
  2963. where you wanted it to be.
  2964.  
  2965. The  calculator can work in decimal or hexadecimal mode.  In decimal mode you
  2966. do  not  have  to  write  the  '#'  in  front  of  a  decimal number, but for
  2967. hexadecimal  numbers,  the '$' is neccessary.  In hexadecimal mode you do not
  2968. have  to  write the '$' for hexadecimal numbers, but for decimal numbers, the
  2969. '#' is neccessary.
  2970.  
  2971. Hexadecimal  mode  is  usually used to get addresses and hexadecimal numbers.
  2972. For the other cases decimal mode is used, also for the assembler.
  2973.  
  2974.  
  2975.  
  2976. 5.3     Data Line
  2977. =================
  2978.  
  2979.  
  2980. The  data line is used to specify data for different commands like find, edit
  2981. or occupy.  The data line consists of four elements:
  2982.  
  2983.  
  2984.       - Hexadecimaly numbers are introduced with or without '$'.  They can be
  2985.         as  long  as  neccessary.   The  number is ended by a char that is no
  2986.         digit.   If you enter an odd number of digits, the last digit will be
  2987.         taken  as byte, its higher nibble zeroed.  Spaces are allowed between
  2988.         digits.
  2989.  
  2990.       - Assembler  instructions  are  initiated  by a 'n' character, then the
  2991.         instruction follows.
  2992.  
  2993.       - Calculator  terms are initiated by a '?', then the term follows.  The
  2994.         size  of the result will be considered (LONG=4 bytes,WORD=2 bytes and
  2995.         BYTE=1 byte).
  2996.  
  2997.       - Ascii  chars  are either initiated by ' or " and closed with the same
  2998.         or a <CR>.  The string length is only limited by the line length.
  2999.  
  3000.  
  3001. An example, using all the elements from above. The line:
  3002.  
  3003.  
  3004.         45,"ABC",njmp $60000,?[$fc0000].w,6666
  3005.  
  3006.  
  3007. is interpreted as:
  3008.  
  3009.         45  41 42 43  4e f9 00 06 00 00  11 11        66 66
  3010.         |-  |-------  |----------------  |----        |----
  3011.         |   |         |                  |            |
  3012.         45  "ABC"     jmp $60000         [$fc0000].w  6666
  3013.  
  3014.  
  3015. A  data  line  ends  at  a  space or an illegal char.  Between the komma that
  3016. separates  two  datatypes  and  the  next datatype there can be spaces.  also
  3017. between digits (only for the edit command, not for find and occupy).
  3018.  
  3019.  
  3020.  
  3021. 5.4     The Debug Server Entrance
  3022. =================================
  3023.  
  3024.  
  3025. The  debug server entrance is specially concieved for the cooperation between
  3026. SIM  and  another  debugger  or loader, i.e.  'SIMBug'.  It enables the debug
  3027. server to give control over a program to SIM and SIM to return control to the
  3028. debug server.
  3029.  
  3030. In  a  part of the SIM base, there is space to store the registers d0-a6, USP
  3031. and  SSP  (ISP/MSP),  SR  and PC of the program that is monitored.  The debug
  3032. server  can  fill  in this table.  Additionally, It can specify a reentry PC,
  3033. SR,  USP and SSP (ISP/MSP).  When it enters SIM by the debug server entrance,
  3034. SIM  takes  the  registers out of the table and copies them into the register
  3035. buffer.   SIM  has  now  the  control  over  the  program.   The length field
  3036. indicates  how  far  you have initialised the list from the length field.  If
  3037. you do not fill in the entier structure, the rest will be zeroed.
  3038.  
  3039. If  you  want  to  give control back to the debug server, i.e.  to unload the
  3040. program, you can use the 'q' command (or 'Q' or AMIGA-q).  SIM does then copy
  3041. the  registers  back  into the base area and takes the reentry PC, SR USP and
  3042. SSP  (ISP/MSP) as the actual ones.  To be sure that the debug server is still
  3043. there,  SIM  looks  at  the  address  <reentrypc-4> if the longword $4f4b4159
  3044. ("OKAY") is there.  If the longword is there, it exits.  That way, it returns
  3045. to  the address specified by the reentry PC with reentry stacks and a reentry
  3046. SR.   The  registers  do  not  contain sencefull information, appart a6 which
  3047. contains  the base/codeaddress of SIM.  In case you transfered SIM, the debug
  3048. server knows where you put it.
  3049.  
  3050. The  debug  server can now read out the table with the registers and use them
  3051. for itself.
  3052.  
  3053.  
  3054.  
  3055. 5.5     The SIM Base
  3056. ====================
  3057.  
  3058.  
  3059. At  the  start  of  SIM, the different entrances are located, the backups and
  3060. reentry  values  and  the debug server data structure.  The structure of this
  3061. base  is  documented  here.  The offsets described won't be changed in higher
  3062. versions, I hope, but I feel free to extend it at the upper end:
  3063.  
  3064.  
  3065. ;--- Base ---------
  3066.  
  3067.  STRUCT toolbase       ;+0  The start address of SIM in memory
  3068.  
  3069.  
  3070. ;--- Display ------
  3071.  
  3072.  APTR  plane           ;+0  The start address of the $5000 bytes display ram
  3073.                             (must be graphic memory!)
  3074.  
  3075.  APTR  backup          ;+4  The start address of the backup of the display.
  3076.                             When not zero, SIM will copy what is in the
  3077.                             memory of the future display to this address
  3078.                             when entered and copy it back when left.
  3079.  
  3080.  
  3081. ;--- Entrances ----
  3082.  
  3083.  JMP   entrance1       ;+8  Entrance for JSR. Here you can simply enter SIM
  3084.                             by a 'JSR' to this address.
  3085.  
  3086.  JMP   entrance2       ;+12 Entrance for Exec's traphandle. When you want to
  3087.                             use SIM as traphandler of your task, write this
  3088.                             address to <taskstruct+50>.
  3089.  
  3090.  JMP   entrance3       ;+16 Debug server entrance.
  3091.  
  3092.  LONG  0               ;+20 *** RESERVED FOR EXPANSION ***
  3093.  
  3094.  
  3095. ;--- Traps --------    ;When a trap is set directly, its vector is set to
  3096.                        ;the corresponding entrance in here.
  3097.  
  3098.  JMP   entrance22      ;+24 Bus error
  3099.  JMP   entrance23      ;+28 Address error
  3100.  JMP   entrance24      ;+32 Illegal instruction
  3101.  JMP   entrance25      ;+36 Divide-by-zero
  3102.  JMP   entrance26      ;+40 CHK instruction
  3103.  JMP   entrance27      ;+44 TRAPV instruction
  3104.  JMP   entrance28      ;+48 Privilege violation
  3105.  JMP   entrance29      ;+52 Trace
  3106.  JMP   entrance2a      ;+56 Op Code 1010
  3107.  JMP   entrance2b      ;+60 Op Code 1111
  3108.  
  3109.  
  3110. ;--- Signal -------
  3111.  
  3112.  LONG  "SIM!"          ;+64 This Long signals that this is SIM
  3113.  LONG  version         ;+68 Version of SIM as 4 ASCII chars
  3114.  
  3115.  
  3116. ;--- Backups ------    ;When SIM is entered it backups some customregisters
  3117.                        ;and vectors here.
  3118.  
  3119.  WORD  dmacon          ;+72 $DFF096/002
  3120.  WORD  intena          ;+74 $DFF09A/01C
  3121.  WORD  intreq          ;+76 $DFF09C/01E
  3122.  LONG  level2          ;+78 VBR+$68
  3123.  LONG  level3          ;+82 VBR+$6C
  3124.  
  3125.  BYTE  ciaacra         ;+86 $BFEE01
  3126.  BYTE  ciaacrb         ;+87 $BFEF01
  3127.  BYTE  ciabcra         ;+88 $BFDE00
  3128.  BYTE  ciabcrb         ;+89 $BFDF00
  3129.  BYTE  ciaapra         ;+90 $BFE001
  3130.  BYTE  ciaaprb         ;+91 $BFE101
  3131.  BYTE  ciaaddra        ;+92 $BFE201
  3132.  BYTE  ciaaddrb        ;+93 $BFE301
  3133.  BYTE  ciabddra        ;+94 $BFD200
  3134.  BYTE  ciaasp          ;+95 $BFEC01
  3135.  LONG  vpos            ;+96 $DFF004
  3136.  
  3137.  
  3138. ;--- Reentry ------    ;Reentry values of things that can't be saved.
  3139.                        ;When SIM is left, it inits the registers named
  3140.                        ;with the values in this list.
  3141.  
  3142.  WORD  $2981           ;+100 DIWSTRT
  3143.  WORD  $29c1           ;+102 DIWSTOP
  3144.  WORD  $0038           ;+104 DDFSTRT
  3145.  WORD  $00d0           ;+106 DDFSTOP
  3146.  WORD  $5200           ;+108 BPLCON0
  3147.  WORD  $0000           ;+110 BPLCON1
  3148.  WORD  $0000           ;+112 BPLMOD1
  3149.  WORD  $0000           ;+114 COLOR00
  3150.  WORD  $0000           ;+116 COLOR01
  3151.  
  3152.  
  3153. ;--- ICR Special --    ;The ICR data and mask.
  3154.  
  3155.  BYTE  lasticr         ;+118 $BFED00 read
  3156.  BYTE  reentryicrmask  ;+119 $BFED00 write
  3157.  
  3158.  
  3159. ;--- Distances ----    ;Distances to internal structures.
  3160.  
  3161.  LONG  disasscalc-base ;+120 Distance to disasscalc module
  3162.  LONG  preferences-base;+124 Distance to preferences structure
  3163.  
  3164.  
  3165. ;--- Debug --------    ;Debug server structure for entrance 3.
  3166.  
  3167.  LONG  0               ;+128 Offset from here to end of inited part
  3168.  LONG  "????"          ;+132 Sign of server
  3169.  
  3170.  
  3171. ;--- Program ------    ;The registers of the program that is debugged.
  3172.  
  3173.  LONG  0               ;+136 Register d0
  3174.  LONG  0               ;+140 Register d1
  3175.  LONG  0               ;+144 Register d2
  3176.  LONG  0               ;+148 Register d3
  3177.  LONG  0               ;+152 Register d4
  3178.  LONG  0               ;+156 Register d5
  3179.  LONG  0               ;+160 Register d6
  3180.  LONG  0               ;+164 Register d7
  3181.  LONG  0               ;+168 Register a0
  3182.  LONG  0               ;+172 Register a1
  3183.  LONG  0               ;+176 Register a2
  3184.  LONG  0               ;+180 Register a3
  3185.  LONG  0               ;+184 Register a4
  3186.  LONG  0               ;+188 Register a5
  3187.  LONG  0               ;+192 Register a6
  3188.  LONG  0               ;+196 User stack pointer
  3189.  LONG  0               ;+200 Supervisor stack pointer/ISP
  3190.  LONG  0               ;+204 PC of program
  3191.  WORD  0               ;+208 SR of program
  3192.  
  3193.  
  3194. ;--- Server data --
  3195.  
  3196.  LONG  0               ;+210 Reentry routine of server
  3197.  LONG  0               ;+214 Reentry usp of server
  3198.  LONG  0               ;+218 Reentry ssp of server/ISP
  3199.  LONG  0               ;+222 Reentry sr of server
  3200.  
  3201.  
  3202. ;--- Extension ----
  3203.  
  3204.  APTR  0               ;+224 Pointer to zero ended list of APTRs that point
  3205.                              to zero ended texts. The texts in this list are
  3206.                              printed and the pointer is cleared
  3207.  APTR  0               ;+228 Pointer to task structure
  3208.  APTR  0               ;+232 Segmentlist
  3209.  APTR  0               ;+236 Symbollist with labels
  3210.  
  3211.  LONG  0               ;+240 MSP (68020+ only)
  3212.  LONG  0               ;+244 Reentry MSP (68020+ only)
  3213.  
  3214.  LONG  0,0             ; RESERVED
  3215.  
  3216.  LONG  sim_size        ;+256 Size of SIM
  3217.  BYTE  0               ;+260 CPU information
  3218.  BYTE  0               ;+261 MMU information
  3219.  WORD  0               ;+262 BEAMCON0 reentry value
  3220.  LONG  0               ;+264 VBR
  3221.  
  3222.  
  3223. ;--- End ----------    ;+268 This is the end of the actual structure
  3224.  
  3225.  
  3226.  
  3227. 5.6     Errors
  3228. ==============
  3229.  
  3230.  
  3231. SIM  is  a  flexible tool.  Therefore the user can do many mistakes.  In this
  3232. chapter,  all  errors  are  explained.  When an error occurs that bases on an
  3233. error  in the command line (which in fact is in most cases so) SIM prints the
  3234. error  text in the line of the cursor and copies the command line in the next
  3235. line.  The cursor is in the line of the copied command line below the char or
  3236. the word that probably caused the error.
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244. Assembler errors
  3245. ----------------
  3246.  
  3247.  
  3248.         illegal instruction:
  3249.  
  3250.                 The assembler does not know this instruction.
  3251.  
  3252.         illegal value:
  3253.  
  3254.                 An number is higher or less than it should be.
  3255.  
  3256.         illegal ea:
  3257.  
  3258.                 This addressing mode is not allowed.
  3259.  
  3260.         illegal size:
  3261.  
  3262.                 An  instruction has either no size at all or does not support
  3263.                 this size.
  3264.  
  3265.         illegal operator:
  3266.  
  3267.                 An operator is not allowed here.
  3268.  
  3269.         line malformed:
  3270.  
  3271.                 Something is undefinably wrong.
  3272.  
  3273.         too few info:
  3274.  
  3275.                 Some part of this instruction is missing.
  3276.  
  3277.         illegal sea:
  3278.  
  3279.                 An illegal effective address as source.
  3280.  
  3281.         illegal tea:
  3282.  
  3283.                 An illegal effective address as destination.
  3284.  
  3285.         illegal char:
  3286.  
  3287.                 The character is not allowed here.
  3288.  
  3289.         illegal condition:
  3290.  
  3291.                 The condition of a Bcc, DBcc or Scc is inexistent.
  3292.  
  3293.         illegal direction:
  3294.  
  3295.                 The direction for bitshifting is neither left nor right.
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303. Calculator errors
  3304. -----------------
  3305.  
  3306.  
  3307.         bracketerror:
  3308.  
  3309.                 The number of brackets opened and closed does not match.
  3310.  
  3311.         overflow:
  3312.  
  3313.                 The result is larger than $ffffffff or ±$8000000, or you have
  3314.                 divided by zero or you do more than 30 operations.
  3315.  
  3316.         illegal value:
  3317.  
  3318.                 The calculator cannot interprete that as a number.
  3319.  
  3320.         illegal operator:
  3321.  
  3322.                 This  is no operator for mathematical operations supported by
  3323.                 the calculator.
  3324.  
  3325.         no value given:
  3326.  
  3327.                 You have forgotten to give a term, or the very first value of
  3328.                 an expected term is of an unknown type.
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337. Disk errors
  3338. -----------
  3339.  
  3340.  
  3341.         disk error:
  3342.  
  3343.                 Something  went  wrong with the disk access, either the track
  3344.                 that  is  read is damaged or the disk was writeprotected.  In
  3345.                 most  cases  you  will get a warning in the statusline of the
  3346.                 disk access display.
  3347.  
  3348.         file not found:
  3349.  
  3350.                 SIM  could  not  locate the file you want to load or the path
  3351.                 given was faulty.
  3352.  
  3353.         not enough space:
  3354.  
  3355.                 The file to be saved won't fit on the disk.
  3356.  
  3357.         disk full:
  3358.  
  3359.                 That error should not occur.
  3360.  
  3361.         directory error:
  3362.  
  3363.                 If  something  goes  wrong  while  listing the directory of a
  3364.                 disk,  i.e.   bad  hashes  or  disk  damaged,  this  error is
  3365.                 returned.
  3366.  
  3367.         illegal path:
  3368.  
  3369.                 SIM cannot locate the directory you want to list.
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377. Other errors
  3378. ------------
  3379.  
  3380.  
  3381.         too much:
  3382.  
  3383.                 The  start address given for a command is higher than the end
  3384.                 address.
  3385.  
  3386.         breakpointerror:
  3387.  
  3388.                 SIM  has  no  more  breakpoints  free  or  it could not set a
  3389.                 breakpoint  there,  either  because ROM is read only or it is
  3390.                 not  possible  to  put  breakpoints  in  the memory presently
  3391.                 occupied by the SIM code.
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398. 5.7     Footer Messages
  3399. =======================
  3400.  
  3401.  
  3402. As mentioned earlier, there is a status field in the footer line.  This space
  3403. is  used  to transmit messages to the user that are not as important as to be
  3404. printed  in  the  monitor  or serve as additional information.  Currently the
  3405. following texts can appear there due to an event:
  3406.  
  3407.  
  3408.         <nothing>       SIM is awaiting commands.
  3409.  
  3410.         busy            As  soon  as  SIM  is executing commands this text is
  3411.                         printed.  This shows you If SIM is working or not.
  3412.  
  3413.         break           When you break the execution of a command SIM replies
  3414.                         with this message.
  3415.  
  3416.         pause           When you pause.
  3417.  
  3418.         lock            When you press SHIFT-CTRL to stop all output for some
  3419.                         time.
  3420.  
  3421.         error           When an error occurs.
  3422.  
  3423.         Fx on/off       When  you  toggle  function  keys SIM returns the new
  3424.                         state to you this way.
  3425.  
  3426.         flushed         When you flush the keystatefield.
  3427.  
  3428.         prt err         When the printer has troubble (paper out/select...).
  3429.  
  3430.         cnd err         When  an error occurs while calculating the condition
  3431.                         terms  of  breakpoints  or  trace, SIM is entered and
  3432.                         this text appears.
  3433.  
  3434.         prt on/off      When you toggle the printer and it is available.
  3435.  
  3436.         AUT on/off      When you toggle the auto unmodify traps feature.
  3437.  
  3438.         US/** kmap      When you select the keymap.
  3439.  
  3440.         indir x         When  you use indirects the current indirect level is
  3441.                         shown.
  3442.  
  3443.         returned        When  you  return from the keyboard restoring routine
  3444.                         by entering 'return'.
  3445.  
  3446.         KBF on/off      When you toggle the keyboard buffer killer.
  3447.  
  3448.         more            When  the  directory  of  a  disk does not fit in the
  3449.                         visible monitor part, SIM writes that message to tell
  3450.                         you that there is more to see.
  3451.  
  3452.         semi/full       Whether or not the full charset is printable.
  3453.  
  3454.         symbols/opcode  Symbols  are  available  and used or not (disassembly
  3455.                         with symbols or opcode field).
  3456.  
  3457.         $xxxx()         Display offset for d16(ax) EAs.
  3458.  
  3459.         label()         Display symbol for all d16(ax) EAs.
  3460.  
  3461.         >label()        Display  symbol  of d16(ax) EAs of instruction at PC.
  3462.                         Use offset for other instructions.
  3463.  
  3464.         MMU on/off      The status of the MMU tree (68020+ version only).
  3465.  
  3466.         MSP/SR flags    If  the register list shall either display the MSP or
  3467.                         the SR flags (68020+ version only).
  3468.  
  3469.         found           If the scan for an access address was successful.
  3470.  
  3471.         caln/no EA      If  or if not the calculation of EAs is allowed while
  3472.                         tracing.
  3473.  
  3474.  
  3475.  
  3476.  
  3477. *****************************************************************************
  3478.         6.      Appendix
  3479. *****************************************************************************
  3480.  
  3481.  
  3482.  
  3483. 6.1     Acknowledgements
  3484. ========================
  3485.  
  3486.  
  3487. Big  thanks  must go to all the people who helped me in this project and many
  3488. others:
  3489.  
  3490.  
  3491.       - Daniel Weber for continuous testing of all new features I
  3492.         inserted, some good and some bad ideas and his mighty ProAsm.
  3493.         Not to forget, for all the cool movies each saturday too.
  3494.  
  3495.       - René Eberhard for more tips, betatesting, exchange of KS 2.0
  3496.         knowhow and loads of fun at MicroSpot and Feller and everywhere
  3497.         else.
  3498.  
  3499.       - Bryan Ford for many good ideas, betatesting, tons of hints,
  3500.         profreading my documentations and all the cool e-mail chat
  3501.         and much, much more.
  3502.  
  3503.       - André Dietisheim, Oliver Ferlin, Stefan Strasser, Kay Temirel,
  3504.         Ch. Schneider, F. Buergel and Niel Ericson for bugreports and
  3505.         ideas.
  3506.  
  3507.       - Michael Hitch for MC68040 testing.
  3508.  
  3509.       - And to all the registered users.
  3510.  
  3511.  
  3512.  
  3513. 6.2     Registered Users
  3514. ========================
  3515.  
  3516.  
  3517. Thanks  go  to  the following users who registered and persuaded me that some
  3518. people use this tool:
  3519.  
  3520.  
  3521.         Daniel Weber            (Switzerland)
  3522.         René Eberhard           (Switzerland)
  3523.         Kay Temirel             (Germany)
  3524.         Niel Ericson            (Canada)
  3525.         Roby Leemann            (Switzerland)
  3526.         Steve Anderson          (Canada)
  3527.         Jörn Körner             (Germany)
  3528.         Bryan Ford              (USA)
  3529.         Dan Babcock             (USA)
  3530.         Gerd Hesina             (Austria)
  3531.         Jandl Mario             (Austria)
  3532.  
  3533.  
  3534.  
  3535. 6.3     Contacting Me
  3536. =====================
  3537.  
  3538.  
  3539. If  you  want to register, if you have bugreports, question, ideas, flames or
  3540. complaints (constructive criticism is always welcome), or if you just want to
  3541. contact me, write or send a letter to:
  3542.  
  3543.  
  3544.         Stefan Walter
  3545.         Finsterruetistr. 57
  3546.         8135 Langnau a./A.
  3547.         SWITZERLAND
  3548.  
  3549.  
  3550. Because  snail mail is slow, you can also contact me by phone or by sending a
  3551. message  to  the  electronic mail address below (if you call by phone, please
  3552. concider  any  possible  time  differences between your location and mine and
  3553. don't wake me up in the night :).
  3554.  
  3555.  
  3556.       Phone:          Switzerland/(0)1/713-01-46
  3557.       Internet:       avalon.physik.unizh.ch!swalter
  3558.  
  3559.  
  3560.  
  3561.  
  3562. -----------------------------------------------------------------------------
  3563.                                                    Stefan Walter, 10.Mar.1993
  3564.  
  3565.