home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / other / barfly / docs / barfly.man < prev    next >
Encoding:
Text File  |  1998-05-09  |  183.9 KB  |  6,509 lines

  1. This file documents Barfly, a development system for AmigaOS V2.04 or
  2. newer.
  3.  
  4.  
  5.  
  6.                               Barfly 1.0
  7.  
  8.        An Intuition controled Debugger and Optimizing Assembler
  9.  
  10.                   Copyright (c) 1989-98 Ralph Schmidt
  11.  
  12.                              - Shareware -
  13.  
  14. Basic Informations
  15. ******************
  16.  
  17. Copyright and other legal stuff
  18. ===============================
  19.  
  20.    Copyright (c) 1989-98 Ralph Schmidt
  21.  
  22.    Permission is granted to make and distribute verbatim copies of this
  23. manual provided the copyright notice and this permission notice are
  24. preserved on all copies.
  25.  
  26.    No guarantee of any kind is given that the programs described in
  27. this document are 100% reliable. You are using this material at your
  28. own risk. The author *can not* be made responsible for any damage which
  29. is caused by using these programs.
  30.  
  31.    Permission is granted to include this package in Public-Domain
  32. collections, especially in Fred Fishs Amiga Disk Library (including
  33. CD-ROM versions of it).  The distribution file may be uploaded to
  34. Bulletin Board Systems or FTP servers. If you want to distribute this
  35. program you *must* use the original distribution archive `Barfly.lha'.
  36.  
  37.    *None* of the programs may be included or used in commercial programs
  38. unless by written permission from the author.
  39.  
  40.    *None* of the programs may be modified in any way. This especially
  41. includes changing the copyright notices or removing any of the Shareware
  42. restrictions.
  43.  
  44.    *None* of the programs may be used on any machine which is used for
  45. the research, development, construction, testing or production of
  46. weapons or other military applications. This also includes any machine
  47. which is used for training persons for *any* of the above mentioned
  48. purposes.
  49.  
  50.    *None* of the programs may be used by more than the registrated
  51. owner.
  52.  
  53. Registration
  54. ============
  55.  
  56.    Well...i decided to release it as GiftWare now with a PUBLIC key.
  57. The PPC/ELF support may be useful for some people and i just don`t have
  58. the time anymore to handle some few registrations.  If somebody thinks
  59. it`s a nice product he`s free to send me whatever he thinks is
  60. appropriate.
  61.  
  62.    *Here you can read the old registration text...*
  63.  
  64.    As you may have noticed in the copyright I'm working for five years
  65. at Barfly. It has always consumed and will continue to consume a large
  66. amount of my time.
  67.  
  68.    I cannot afford just working for fun. Thus, I decided to release
  69. Barfly as Shareware. I had already tried to release Barfly as a
  70. commercial product but the story behind it is more than sad. To sum
  71. it...german Amiga software companys aren't worth any time...`they suck'.
  72. Some people may think the price is too high for a Shareware product but
  73. i think that BAsm is as powerful as the 2 main available commercial
  74. Assemblers...if not more powerful if you compare the speed and the
  75. optimize functions;there's no commercial Debugger available that can
  76. compete with BDebug.  I've used Barfly myself for commercial Amiga
  77. applications.  Cyberstorm 060, Z3-Fastlane device, CDRive,
  78. SCSIConfig,...
  79.  
  80.    The unregistered version of Barfly pops up the About requester at
  81. the start and has some functions disabled:
  82.      Assembler:
  83.       o only 8192Bytes large code possible
  84.       o the Section commands aren't available
  85.      Debugger:
  86.       o Only 1 Window per Object
  87.       o Enforcer,CyberGuard Catch not available
  88.       o Task Catch not available
  89.       o Crashed Task Catch not available
  90.       o Limited Step count(about 150-200 Steps)
  91.  
  92.    Registered users will be shipped a disk with the newest public
  93. release of Barfly, along with a personalized, so-called "keyfile". It
  94. enables all the missing features and disables the Shareware reminders.
  95. This keyfile will work with all future releases of Barfly, so you can
  96. simply download the latest version from your local bulletin board
  97. without having to wait weeks for your update passing through the slow
  98. mail channels. The keyfile `must not' be distributed in any way.
  99.  
  100. The fee for a Barfly registration is
  101.       70.- DM  (D-Mark),
  102.       70.- SFr (Schweizer Franken),
  103.      230.- FF  (French Francs),
  104.       50.- US$ (US Dollar)
  105.  
  106.    There is NO splitted version available. Only Barfly and Basm
  107. together.
  108.  
  109.    The fastest, cheapest and easiest way to register is put the money
  110. together with the filled registration form into a letter and send it to
  111.  
  112.    Please allow 2-8 weeks delivery for the registrated version.
  113. Currently I am very busy with my civil service and working for Phase5 so
  114. please be patient.
  115.  
  116.      Ralph Schmidt
  117.      Kleiner Hellweg 4
  118.      33154 Salzkotten
  119.      FR Germany
  120.      Phone: Nahh..not anymore:-)
  121.      E-Mail: laire@popmail.owl.de
  122.         Irc: Laire on #amiga,#amigager
  123.  
  124. Introduction
  125. ************
  126.  
  127. Purpose
  128. =======
  129.  
  130.    BDebug is an Intuition controled multi-task system Debugger for OS
  131. 2.04 and newer.
  132.  
  133.    You can use BDebug to debugging your programs, catching tasks,
  134. reseach Enforcer and CyberGuard hits, follow Source-Level Informations
  135. and other advanced functions.  The Debugger supports assemblers, SAS C,
  136. Dice and GCC.
  137.  
  138. Some of BDebug's features are:
  139.  
  140.    * font-sensitive, resizable and Style Guide compliant GadTools GUI
  141.  
  142.    * Object-Oriented that results in a low learning curve
  143.  
  144.    * Supports 68000...68060 and the FPUs
  145.  
  146.    * Supports the PPC603/604
  147.  
  148.    * Supports PPC ELF object format
  149.  
  150.    * Can debug multiple tasks at the same time
  151.  
  152.    * Not limited by the amount of window objects.
  153.  
  154.    * highly configurable
  155.  
  156.    * keyboard support
  157.  
  158.    BAsm is a very fast optimizing Assembler for OS 2.04 and newer.
  159.  
  160. Some of BAsm's features are:
  161.  
  162.    * 68000-68060, 6888x and PPC603-PPC604
  163.  
  164.    * Very Fast
  165.  
  166.    * Include and Incbin Cache
  167.  
  168.    * Strong Optimizer with Multi-Pass Optimizing
  169.  
  170.    * High Level Macros
  171.  
  172.    * ARexx
  173.  
  174.    * Supports OS 2.04 and OS 3.0 Hunks
  175.  
  176.    * SAS D1 Source Level Format
  177.  
  178. System requirements
  179. ===================
  180.  
  181.    Barfly requires Amiga operating system version 2.04 or better.
  182.  
  183.    Kickstart 1.3 is *not* supported; this operating system is considered
  184. obsolete.
  185.  
  186.    Barfly requires at least one megabyte of RAM to run.  A hardisk or a
  187. faster CPU is not required but increase performances and comfort, of
  188. course.
  189.  
  190. Installation
  191. ============
  192.  
  193.    It is really easy to install Barfly:
  194.  
  195.    1. Copy the the binary and the icon (called "BDebug" and
  196. "BDebug.info")   to any directory.
  197.  
  198.    2. Copy the the binary and the icon (called "BAsm" and "BAsm.info")
  199. to any directory.
  200.  
  201.    Then copy the supplied configuration files from "s/Barfly/#?" to "S:"
  202. directory of your system partition or create env:Barflypath with the
  203. path to a directory that contains Barfly/#?.
  204.  
  205. Other topics
  206. ************
  207.  
  208. Updates
  209. =======
  210.  
  211.    Whenever a new release of Barfly gets released, I will post some
  212. information in the appropriate newsgroups of some electronic networks.
  213. The new archive will soon be available on many bulletin boards and on
  214. all `AmiNet' FTP servers. Major releases will also come with some PD
  215. disks, especially on Fred Fish's collection.
  216.  
  217.    As mentioned above, registered users will neither need a new keyfile
  218. nor a special personalized program version. They can use all new
  219. features immediately.
  220.  
  221. Support
  222. =======
  223.  
  224.    If you have some questions, comments, suggestions or even flames,
  225. please feel free to contact me at one of the following addresses. If
  226. you send your letter via e-mail, there's a good chance for getting a
  227. quick reply.
  228.  
  229.      Snailmail: Ralph Schmidt
  230.                 Kleiner Hellweg 4
  231.                 33154 Salzkotten
  232.                 FR Germany
  233.      
  234.          Phone: too bad:-)
  235.      
  236.         E-Mail: laire@popmail.owl.de
  237.            Irc: Laire on #amiga, #amigager
  238.  
  239. History
  240. =======
  241.  
  242.    * 0.0 - 1.0
  243.      not released
  244.  
  245.    * 1.0 - 1.31
  246.      the 68k version
  247.  
  248.    * 2.0 -
  249.      the PPC/ELF extension
  250.  
  251. Future
  252. ======
  253.  
  254. Here are some ideas for future versions of BDebug:
  255.  
  256.    * Full Source Level support for GCC and perhaps SAS.
  257.  
  258.    * Better BDebug Arexx support...the current one is a bad excuse.
  259.  
  260.    * Mungwall Trace methods.
  261.  
  262.    * Automatic Refresh of some Windows(Task Window...)
  263.  
  264.    * Amigaguide file mode in the autodocs functions.
  265.  
  266.    * Highlight changed registers
  267.  
  268.    * Better documentation.
  269.  
  270.    * BAsmOption for the easy BAsm options configuration.
  271.  
  272.    * Other things i'm too lazy to mention now.
  273.  
  274. Important:
  275.      There is absolutely NO guarantee that these features will ever be
  276.      implemented. So don't be disappointed, if they aren't in the next
  277.      version.
  278.  
  279. Acknowledegments
  280. ================
  281.  
  282. Thanks must go to:
  283.  
  284.    - Dirk Leschner, Frank Jakobs
  285.  
  286.      for being my best friends
  287.  
  288.    - Matthias Scheler
  289.  
  290.      for his manual design and Filer.
  291.  
  292.    - S.Schaem, Børge Nøst, Alexis Wilke, Michael B. Smith, Marc Heuler
  293.  
  294.      for their superb betatesting efforts
  295.  
  296.    - Mike Schwartz
  297.  
  298.      for a lot suggestions to improve basm. Sad he has left the Amiga
  299.      community 2 years ago.
  300.  
  301.    - Stefan Becker
  302.  
  303.      for Toolmanager and being a nice guy.
  304.  
  305.    - Christoph Wolf
  306.  
  307.      for DynamiCache and being a nice guy.
  308.  
  309.    - Brian Cerveny(Redwine)
  310.  
  311.      for Grapevine and being a nice guy.
  312.  
  313.    - All my IRC friends.
  314.  
  315.      for many great hours. Thanks!
  316.  
  317.      Andrew Denton(Guardian), Kenneth Dyke(Nyx), Bill Coldwell(Cryo),
  318.      Brian Cerveny(Redwine), Joseph Hillenburg(xterm), Scott
  319.      Ellis(ScottE), Chris Wichura(Caw), John Wiederhirn(John\_W), Mike
  320.      Schwartz(mykes), Markus Illenseer(ill), Holger Lubitz(holgi),
  321.      Ralph Babel(rbabel), Seth Harman(Budha) and a lot guys i haven't
  322.      mentioned here.
  323.  
  324.    - Chris Schneider and Urban D. Mueller
  325.  
  326.      for some suggestions 2-3 years ago and installing Aminet.
  327.  
  328.    - Michael "billy" Böhnisch
  329.  
  330.      for his cleanup on MakeBarflyFD 2-3 years ago.
  331.  
  332.    - Steve Wright
  333.  
  334.      for designing the icons 2 years ago.
  335.  
  336. And of course to all the other Beta testers and registered users.
  337.  
  338.    The V40 Includes can be ftp'ed from the FTP-Server.
  339.  
  340.    ftp.rz.uni-wuerzburg.de: pub/amiga/frozenfish/bbs/com
  341.  
  342.    A superb Linker "lk" by Alex Wilke should be soon availble on Aminet.
  343.  
  344.                               BDebug 1.0
  345.  
  346.                     An Intuition controled Debugger
  347.  
  348.                   Copyright (c) 1989-98 Ralph Schmidt
  349.  
  350.                              - Shareware -
  351.  
  352. Usage of BDebug
  353. ***************
  354.  
  355. The Command Window
  356. ==================
  357.  
  358. Debugger Philosophy
  359. ===================
  360.  
  361.    BDebug is a multitasking Debugger that supports the Motorola
  362. processors 68000...68060 and 68881...68882.  The Debugger allows to
  363. debug unlimited tasks parallel.  Because of the Debugger's complexity
  364. BDebug was designed in an object-oriented way to allow an easy and
  365. comfortable way to use it.  The register window `REGWindow' is the Root
  366. class of the task object that can be expanded by several subclass
  367. windows.  Every subclass window has privat menus and inherits the
  368. public menus of its father object.
  369.  
  370. Debug Methods
  371. =============
  372.  
  373.    The Debugger offers a variety of different Debug methods that can be
  374. activated by menu or gadget.
  375.  
  376. Debug Task
  377. ..........
  378.  
  379.    is used to select a task you wann to debug. If you doubleclick on a
  380. task a `REGWindow' and a couple of information windows opens.  Which
  381. type and how many are opened depends on the current configuration.
  382. After the task could be stopped the contents of the `REGWindow' and all
  383. other information windows gets refreshed.  If the task is in the `Wait'
  384. state the task is stopped when it gets a signal.
  385.  
  386.                          Task Listview Layout
  387.  
  388.                                    
  389.                 Taskaddress & Priority & Status & Name
  390.  
  391.                         Process Listview Layout
  392.  
  393.                                    
  394.       Taskaddress & Priority & Status & Name[CLI Number,CLI Name]
  395.  
  396.    You should know what task you can stop and what kind of task should
  397. never be stopped. For example the Input.device should never be stopped.
  398.  
  399. Debug File
  400. ..........
  401.  
  402.    is used to load and stop a program.  This function is equal to the
  403. bdebug cli startup with the exception that you can enter the parameter
  404. in a requester.  If no error occur all configurated windows are opened
  405. and the PC stops at the defined programstart breakpoint that normally
  406. points to the first command of the program.
  407.  
  408. Debug Next Task
  409. ...............
  410.  
  411.    is used to debug the next task that is opened.  The Debugger waits
  412. until another task is created by AddTask and a couple of information
  413. windows opens.  Which type and how many are opened depends on the
  414. current configuration.  After the new task was caught the pc points to
  415. the beginning of the task and `Catch Next Task' is disactivated.  To
  416. catch a program that is started from the WV you have to use `Debug Next
  417. Task' to catch the WB Startup Task `WBL' that starts the program.  Now
  418. you have to activate `Debug Next Task' again and let the current task
  419. run.  After a short time the task `WBL' ends and the program's task is
  420. caught.
  421.  
  422.      You should avoid to start a new task between the 2 `Debug Next
  423.      Task' phases because it's easy to catch the wrong one.
  424.  
  425.  
  426.      You should notice that `AddTask' is patched and points to a new
  427.      routine. Thus you should be careful with programs that also patch
  428.      `AddTask'. Furthermore it's useful to know in what sequences these
  429.      patches have to be removed.  The Debugger can only be closed when
  430.      all patched system function that were installed after the Debugger
  431.      was started are removed.
  432.  
  433.  
  434.      If you start a program in the shell without `c:Run' no new task is
  435.      created. Instead the program is run as a subroutine in shell's
  436.      task so you can't catch the task that easy.
  437.  
  438.  
  439. Debug Crashed Task
  440. ..................
  441.  
  442.    is used to catch tasks that crash so you track down the bug location
  443. a lot easier. If the system itself doesn't run anymore you shouldn't
  444. expect that bdebug still runs because it depends on a working system.
  445. If a task crashes and the option `Debug Crashed Task' is activated a
  446. couple of information windows opens. Which type and how many are opened
  447. depends on the current configuration.  `Task Held Requester'.
  448.  
  449. Catch Enforcer Hit
  450. ..................
  451.  
  452.    is used to tell the Debugger to stop the task it controls when an
  453. Enforcer or CyberGuard hit happens.  Unfortunately the Debugger can't
  454. always stop the task at exactly the same location where the hit
  455. happened.  Mostly the hit command is 1-2 instructions above the stopped
  456. task's PC.
  457.  
  458.    This function needs Enforcer V37.x by M. Sinz or CyberGuard V1.x and
  459. it must be installed before BDebug is launched.  Please read the
  460. documentation.
  461.  
  462. Select Display Mode
  463. ...................
  464.  
  465.    This function allows you to choose Screen Mode for the Debugger.
  466.  
  467. How to start ?
  468. ==============
  469.  
  470.    If you only want to debug a program you have to start bdebug with
  471. the program's name and parameters or by using `Debug Program' in the
  472. command window.  Another method is to move a program's icon on the
  473. command window or specify BDebug as in the icon as the `DefaultTool'.
  474.  
  475.    `Name:'
  476.  
  477.      BDEBUG - The CLI Startup
  478.  
  479.  
  480.    `Synopnis:'
  481.  
  482.      BDEBUG [?] [<Program> [Argument] ]
  483.  
  484.  
  485.    `Function:'
  486.  
  487.      BDebug activates the Debugger, loads and stops the optionally
  488.      entered program. If it can find a local config file with  the
  489.      suffix *.bdebug it loads it.
  490.  
  491.  
  492.    `Inputs'
  493.  
  494.         * ? shows an information message
  495.  
  496.         * program name If no program name is entered BDebug looks for
  497.           env:BDebugProgram and loads the program instead that the env:
  498.           points to.
  499.  
  500.         * argument line of the program. If there are spaces in
  501.           parameters you have to enclose the argument with `""'.
  502.  
  503.  
  504. Usage of BDebug
  505. ***************
  506.  
  507. The Register Window
  508. ===================
  509.  
  510. Register Window
  511. ---------------
  512.  
  513.    The register window is the most important control layer of the
  514. Debugger and every debugged task has one.  You can link unlimited other
  515. information windows to the `REGWindow' or you can tell the Debugger to
  516. give up controling the task.  In the title line of the window you can
  517. see the ID number of the task, so you can recognize what information
  518. window belongs to this task.  Furthermore the title line also contains
  519. the task address, the state, `RUN', `WAIT' or `STOP' and the name of
  520. the task.  The task is in the `RUN' state if the task has the control
  521. at the moment instead of the traphandler; the task is in the `STOP'
  522. state when the task waits and the traphandler controls what happens.
  523. The task is the `WAIT' state only when the Debugger has to wait to
  524. catch a task by a `Debug Task'.  In the upper area of the window you
  525. see the normal data and address registers where the address register
  526. also have additional information fields.  To change a register or to
  527. watch memory where the register points to you only need to doubleclick
  528. on the register or on the register's memory contents.  Furthermore you
  529. may change other usermode registers by this method.  Supervisor
  530. register can't be changed because that doesn't make much sense for a
  531. system Debugger.
  532.  
  533.                            `68000 Registers'
  534.  
  535.              D0=xxxxxxxx yyyy A0=xxxxxxxx   Arg1 Arg2 [!]
  536.  
  537.              D1=xxxxxxxx yyyy A1=xxxxxxxx   Arg1 Arg2 [!]
  538.  
  539.              D2=xxxxxxxx yyyy A2=xxxxxxxx   Arg1 Arg2 [!]
  540.  
  541.              D3=xxxxxxxx yyyy A3=xxxxxxxx   Arg1 Arg2 [!]
  542.  
  543.              D4=xxxxxxxx yyyy A4=xxxxxxxx   Arg1 Arg2 [!]
  544.  
  545.              D5=xxxxxxxx yyyy A5=xxxxxxxx   Arg1 Arg2 [!]
  546.  
  547.              D6=xxxxxxxx yyyy A6=xxxxxxxx   Arg1 Arg2 [!]
  548.  
  549.              D7=xxxxxxxx yyyy A7=xxxxxxxx   Arg1 Arg2 [!]
  550.  
  551.            USP=xxxxxxxx  SSP=xxxxxxxx  PC=xxxxxxxx  SR=xxxx
  552.  
  553.    * [!] shows if the address register points on an odd address.
  554.  
  555.    * if the address register points on an illegal memory area the char
  556.      `*' is shown in Arg1 and Arg2 to avoid crashes by reading non
  557.      readable io-addresses.  You can config the readable memory areas.
  558.  
  559.    * if the address register points on the following system structures
  560.      the name of the Node is shown in Arg1 and the Name of the
  561.      structure in Arg2.
  562.  
  563.         * Library
  564.  
  565.         * Device
  566.  
  567.         * Port
  568.  
  569.         * Task
  570.  
  571.         * Resource
  572.  
  573.         * MemHead
  574.  
  575.    * if the address register points to the custom chip area the name of
  576.      the register is shown in Arg1 and the ID-Word CUSTOM is shown in
  577.      Arg2.  Custom register map is $dff000-$dff200.
  578.  
  579.    * if the address register points to a symbol the symbol and the
  580.      contents is shown.
  581.  
  582.    * Otherwise 8Bytes of the memory are shown where the register points
  583.      to.  The 8 Bytes are shown hexadecimal in Arg1 and ascii in Arg2.
  584.  
  585.                            `68010 Registers'
  586.  
  587.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  588.  
  589.                            `68020 Registers'
  590.  
  591.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  592.  
  593.         MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx
  594.  
  595.                            `68030 Registers'
  596.  
  597.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  598.  
  599.         MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx
  600.  
  601.                CRP=xxxxxxxxxxxxxxxx SRP=xxxxxxxxxxxxxxxx
  602.  
  603.            TT0=xxxxxxxx  TT1=xxxxxxxx   TC=xxxx PSR=xxxxxxxx
  604.  
  605.                            `68040 Registers'
  606.  
  607.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  608.  
  609.                MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx
  610.  
  611.           URP=xxxxxxxx  SRP=xxxxxxxx   TC=xxxx  PSR=xxxxxxxx
  612.  
  613.         ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx
  614.  
  615.                            `68060 Registers'
  616.  
  617.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  618.  
  619.               CACR=xxxxxxxx  PCR=xxxxxxxx BUSCR=xxxxxxxx
  620.  
  621.           URP=xxxxxxxx  SRP=xxxxxxxx   TC=xxxx  PSR=xxxxxxxx
  622.  
  623.         ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx
  624.  
  625.                            Type  Information
  626.  
  627.               xxxxxxxx  [Symbol] Mnemonic operand1[,...]]
  628.  
  629.             (EA): [Address1=Contents]...[Address2=Contents]
  630.  
  631.      In the `(EA)' line you can see the addresses and their contents
  632.      the current command accesses.  The contents of illegal addresses
  633.      aren't shown.
  634.  
  635. Local Menus
  636. -----------
  637.  
  638.    * Close Window
  639.  
  640.      closes the `REGWindow', all connected windows and disactivates the
  641.      Debugger for this task.  To disactivate the Debugger you have to
  642.      choose if the task should keep running so it's the task's business
  643.      to stop.  Furthermore you can end the task by runing the cleanup
  644.      routine of the task or just removing the task from the list but
  645.      this can cause sideeffects you can't always oversee.  If the task
  646.      is a process then the Remove option is equal to the Cleanup option.
  647.      If it's only a task the Cleanup option is equal to the Cleanup
  648.      option.  Note that the Remove option doesn't free any resources of
  649.      the task.
  650.  
  651.           You should really know what you're doing if you, for example,
  652.           remove a task from the system.
  653.  
  654.  
  655.    * ZOOM Windows
  656.  
  657.      expands all windows of the task.
  658.  
  659.    * Log File
  660.  
  661.      activates or disactivates the loging of the register and PC
  662.      changes.  Tip: Use CNC:0/0/640/100/History as the logfile and you
  663.      get an      automatic logfile history.
  664.  
  665.    * Big View
  666.  
  667.      shrinks the `REGWindow' to a 68000 register layout or expands it
  668.      back to the full layout.
  669.  
  670.    * Open DissWindow
  671.  
  672.      opens a DissWindow with the configured dimensions.
  673.  
  674.    * Open MemWindow
  675.  
  676.      opens a MemWindow with the configured dimensions.
  677.  
  678.    * Open FPUWindow
  679.  
  680.      opens a FPUWindow with the configured dimensions.  The menu is
  681.      only available if a FPU is installed.
  682.  
  683.    * Open BreakWindow
  684.  
  685.      opens a BreakpointWindow with the configured dimensions.
  686.  
  687.    * Open CoppWindow
  688.  
  689.      opens a CoppWindow with the configured dimensions.
  690.  
  691.    * Open StructWindow
  692.  
  693.      opens a StructWindow with the configured dimensions.
  694.  
  695.    * Open SnoopWindow
  696.  
  697.      opens a SnoopWindow with the configured dimensions.
  698.  
  699.    * Open WatchWindow
  700.  
  701.      opens a WatchpointWindow with the configured dimensions.
  702.  
  703.    * Open ChecksumWindow
  704.  
  705.      opens a ChecksumWindow with the configured dimensions.
  706.  
  707.    * Save Window Settings
  708.  
  709.      saves the positions and count of all window the current task
  710.      controls.  The saved file then contains the appropriate commands
  711.      you have to enter yourself into the configuration file.  Because
  712.      of the Debugger's window concept it doesn't make sense to save a
  713.      complete configuration file.
  714.  
  715. Public Menus
  716. ------------
  717.  
  718.    * Step 1
  719.  
  720.      runs the current command and stops the task afterwords.
  721.  
  722.    * Step X
  723.  
  724.      runs X commands and stops the task afterwards.
  725.  
  726.    * Step Debug Line
  727.  
  728.      runs commands until the PC encounters another source line.  If the
  729.      PC is outside the program or if no debug informations are
  730.      available a single step i used.  The command enters subroutines.
  731.  
  732.    * Trace Debug Line
  733.  
  734.      is similar to `Step Debug Line' with the exception that it runs
  735.      subroutines.
  736.  
  737.    * Trace over Calls
  738.  
  739.      runs the current command or subroutine and stops the task
  740.      afterwards.  Depending on the configuration and the memory area a
  741.      breakpoint or single steps are used.  If a crash happens in
  742.      certain program parts you should remove the command `Tracebreak'
  743.      from the configuration.
  744.  
  745.           You should avoid to use `Tracebreak' in Libraries and Devices
  746.           which are located in the ram.  If another task accesses the
  747.           routine at the same time you can expect an illegal exception.
  748.  
  749.  
  750.           Some Amiga MMU Setups don't like programs writing to the
  751.           kickstart rom. For example when breakpoints are set.
  752.  
  753.  
  754.    * Trace X over Calls
  755.  
  756.      runs X commands or subroutines and stops the task afterwards.
  757.      Depending on the configuration and the memory area a breakpoint or
  758.      single steps are used.
  759.  
  760.    * Trace Work
  761.  
  762.      is similar to the command `Trace over Calls' with the exception
  763.      that all commands are run.  This function is useful to trace loops.
  764.  
  765.  
  766.           Example:
  767.                      moveq        #10,d0
  768.                  0$:
  769.                      dbra         d0,0$
  770.  
  771.           If you use the function on the command `dbra' the Debugger
  772.           sets a breakpoint after the dbra and runs the task. It drops
  773.           back to single step when it hits a `Jmp', `bra', `rts'....
  774.  
  775.  
  776.    * Trace over OS-Calls
  777.  
  778.      runs the current command or the OS function and stops the task
  779.      afterwards.
  780.  
  781.    * Trace on Flow
  782.  
  783.      stops the task when a PC direction occurs.  This means the PC is
  784.      stopped when it hits a `Jsr', `Jmp', `bcc', `rts'....
  785.  
  786.    * Trace on Address
  787.  
  788.      runs the task until the PC is equal to the entered address.  This
  789.      function is not very fast because the task is running in single
  790.      step mode and after each instruction the PC is compared with the
  791.      address.
  792.  
  793.    * Trace out of OS
  794.  
  795.      runs the task until the PC is outside of the kickstart.  This
  796.      function is useful when you catch a task inside the OS and you
  797.      want to get as fast as possible back to the program's code.  It
  798.      works similar as `Trace on address'.
  799.  
  800.           You shouldn't use this command if your task only runs in the
  801.           kickstart.
  802.  
  803.  
  804.    * (PC)++
  805.  
  806.      jumps over the current command.  Useful to jump over `Illegal'
  807.      breakpoints used for debugging purposes in your program.
  808.  
  809.    * PC-2
  810.  
  811.      subtracts 2 Bytes from the PC.
  812.  
  813.    * Write Nop
  814.  
  815.      overwrites the current command with a `Nop'.
  816.  
  817.    * Write Illegal
  818.  
  819.      overwrites the current command with an `Illegal'.
  820.  
  821.    * Run Task
  822.  
  823.      runs the task and stops only on exceptions.
  824.  
  825.    * Run Watched Task
  826.  
  827.      runs the task in trace mode and stops when a WatchPoint condition
  828.      is true.  If there are no watchpoints the command behaves like
  829.      `Run Task'.
  830.  
  831.    * Run History Task
  832.  
  833.      runs the task in trace mode and saves the registers each step into
  834.      the history stack.
  835.  
  836.    * Stop Task
  837.  
  838.      stops the task.
  839.  
  840.    * Send Signal
  841.  
  842.      sends a signal to the task.  Default Signal is CTRL-C = 12
  843.  
  844.    * Undo Level
  845.  
  846.      sets the undobuffer's depth.
  847.  
  848.    * Undo
  849.  
  850.      undos the last changes in the registerframe.
  851.  
  852.    * View Refresh
  853.  
  854.      activates and disactivates the copperlist refresh after each trace
  855.      operation. This function is help for debugging programs which
  856.      install own copperlists.
  857.  
  858.    * Show (EA)
  859.  
  860.      activates and disactivates the output of the address and address
  861.      contents which are accessed by the current assembler command.
  862.  
  863.    * Symbol
  864.  
  865.      activates and disactivates the use of symbols in the `REGWindow'.
  866.  
  867.    * Delete Symbols
  868.  
  869.      erases all symbols of the task.
  870.  
  871.    * Copy Symbols
  872.  
  873.      can copy a symbol list of the task to a different task.  This
  874.      function is helpful if your task is started from another task and
  875.      you want to keep the symbol list.
  876.  
  877.    * Load Symbols
  878.  
  879.      loads the symbols of a program where you can select an alternative
  880.      process's segmentlist for calculating the symbol and debug
  881.      informations.  Normally you choose the same process but sometimes
  882.      it's helpful to select a different process.  For example, if the
  883.      task you debug is created in a program, you have to choose the
  884.      program's task to get the correct symbol addresses.
  885.  
  886.    * Set Hunklist
  887.  
  888.      sets a new segment list for the SourceWindow and some other hunk
  889.      related functions.  Because the position in the SourceWindow
  890.      depends on the segments sometimes help to load new symbols and
  891.      debug informations for this task.  If you load an alternative
  892.      Hunklist by selecting a custom task when you use `Load Symbols'.
  893.  
  894.    * Reset Hunklist
  895.  
  896.      removes the alternative hunklist.
  897.  
  898.    * Show Value
  899.  
  900.      shows the value of an argument.
  901.  
  902.    * Show Last Exception
  903.  
  904.      shows the last exception.
  905.  
  906.    * Open Task Window
  907.  
  908.      opens a window showing the task structure of the task.
  909.  
  910.    * Open System Window
  911.  
  912.      opens a window showing the ExecBase structure.
  913.  
  914.    * Open Proces Window
  915.  
  916.      opens a window showing the process structure of the process.
  917.  
  918.    * Open CLI Window
  919.  
  920.      opens a window showing the cli structure of the process.
  921.  
  922.    * Open Hunk Window
  923.  
  924.      opens a window showing the hunks of the process.
  925.  
  926.    * Open Symbol Window
  927.  
  928.      opens a window showing the symbols of the process.  If you
  929.      doubleclick on a symbol you get the hunk where the symbol is
  930.      located.
  931.  
  932.    * Open Library Window
  933.  
  934.      opens a window showing the libraries.  If you doubleclick on a
  935.      library entry it opens a `FD:' window that shows all functions of
  936.      the library when the library is defined in the `Barfly.FD' file.
  937.      Furthermore if you doublelick on a function you have the choice to
  938.      see the function in a `DissWindow' or the autodocs documentation.
  939.  
  940.    * Open Device Window
  941.  
  942.      opens a window showing the devices.
  943.  
  944.    * Open Resource Window
  945.  
  946.      opens a window showing the resources.
  947.  
  948.    * Open Port Window
  949.  
  950.      opens a window showing the public ports.
  951.  
  952.    * Open Resident Window
  953.  
  954.      opens a window showing the resident modules.
  955.  
  956.    * Open Interrupt Window
  957.  
  958.      opens a window showing the interrupts.
  959.  
  960.    * Open AutoDocs Window
  961.  
  962.      opens a filerequester which lets you choose the needed autodocs
  963.      information of a library.  This opens a window which shows all
  964.      functions of the chosen autodoc file.  If you now click on a
  965.      function another window is opened showing the function
  966.      documentation.
  967.  
  968.    * Open History Window
  969.  
  970.      opens a HistoryWindow showing the last saved registerframes of the
  971.      undobuffer. The undobuffer is organized in a way to make the first
  972.      entry become the last entry in the HistoryWindow.  The
  973.      HistoryWindow isn't updated automaticlly.
  974.  
  975.    * Stack Check
  976.  
  977.      controls the stack check. A warning is displayed if the register
  978.      A7 points out of the stack bounds or points on an odd address.
  979.      The Debugger only checks the task when the task gives back the
  980.      control to the traproutine, so it's not possible to notice every
  981.      stack problem.
  982.  
  983.           You should be aware that this function doesn't work with a
  984.           WShell task because the `WShell' doesn't set the correct
  985.           stack task values.
  986.  
  987.  
  988.    * Find Task of address
  989.  
  990.      tries to find the task which belongs to the entered address.  The
  991.      command checks if the address is in the task, process, cli,
  992.      mementry structure and the hunks.  It's not safe to assume that
  993.      the function can check all cases.
  994.  
  995.    * Load Binary
  996.  
  997.      loads a file with an optional length into a memory area.  If you
  998.      want the Debugger to automaticlly allocate the memory block you
  999.      have to close the memory requester.
  1000.  
  1001.    * Save Binary
  1002.  
  1003.      saves a memory area into a file.
  1004.  
  1005.    * Freeze Task
  1006.  
  1007.      freezes a selectable task.  When bdebug ends the frozen tasks are
  1008.      awakened again.
  1009.  
  1010.    * Warm up Task
  1011.  
  1012.      warms up a frozen task.
  1013.  
  1014.    * Kill Task
  1015.  
  1016.      kills a selectable task.
  1017.  
  1018.           You should know which task you can kill.  For example, don't
  1019.           kill the input.device or your filesystem.
  1020.  
  1021.  
  1022.    * Show Task
  1023.  
  1024.      shows the task structure of a selectable task.
  1025.  
  1026.    * Show Prozess
  1027.  
  1028.      shows the process structure of a selectable process.
  1029.  
  1030.    * Show CLI
  1031.  
  1032.      shows the cli structure of a selectable process.
  1033.  
  1034.    * Show Hunk
  1035.  
  1036.      shows the hunks of a selectable process.
  1037.  
  1038.    * Send Task Signal
  1039.  
  1040.      sends a signal to a selectable task.
  1041.  
  1042.    * Set Task Priority
  1043.  
  1044.      sets a priority of a selectable task.
  1045.  
  1046.    * Refresh Code Cache
  1047.  
  1048.      refreshes the Code Cache.
  1049.  
  1050.    * Refresh Data Cache
  1051.  
  1052.      refreshes the Data Cache
  1053.  
  1054. Usage of BDebug
  1055. ***************
  1056.  
  1057. The FPU Window
  1058. ==============
  1059.  
  1060. FPU Window
  1061. ----------
  1062.  
  1063.    The FPU Window shows the FPU register FP0 to FP7 in the 96Bit
  1064. Extended format and the registers FPCR, FPSR and FPIAR in hexadecimal.
  1065. You can only open this window if a FPU is available.
  1066.  
  1067.      Register Window Layout
  1068.  
  1069.                            FP0=FloatingPoint
  1070.  
  1071.                            FP1=FloatingPoint
  1072.  
  1073.                            FP2=FloatingPoint
  1074.  
  1075.                            FP3=FloatingPoint
  1076.  
  1077.                            FP4=FloatingPoint
  1078.  
  1079.                            FP5=FloatingPoint
  1080.  
  1081.                            FP6=FloatingPoint
  1082.  
  1083.                            FP7=FloatingPoint
  1084.  
  1085.                       FPCR=xxxxxxxx FPSR=xxxxxxxx
  1086.  
  1087.                             FPIAR=xxxxxxxx
  1088.  
  1089. Local Menus
  1090. -----------
  1091.  
  1092.    * Close Window
  1093.  
  1094.      closes the window.
  1095.  
  1096. Usage of BDebug
  1097. ***************
  1098.  
  1099. The Disassembler Window
  1100. =======================
  1101.  
  1102. Disassembler window
  1103. -------------------
  1104.  
  1105.    The `DissWindow' shows the memory contents in assembler mnemonics.
  1106. The address of the window's view can be absolute or relative.  In
  1107. absolut mode, the window shows the contents of a fixed address,
  1108. indicated by the window title `No Link'.  In relative mode the window
  1109. is connected to a register causing the window to update when the the
  1110. register value changes.  This is indicated by the window title which
  1111. reads `Link to *', where * represents the register name.  The PC is
  1112. shown by the colour pen 2.  If the linked register value is outside of
  1113. the window's view area the whole contents of the window will be
  1114. refreshed.  You can change size of the window and scroll through the
  1115. memory area by using the cursors.  In the title you see an ID-String
  1116. with the format `\#x.y' where `X' represents the `REGWindow' number and
  1117. `y' the number of the `MemWindow'.  Doubleclicking a line of the window
  1118. sets or remove a breakpoint.  You can disable this function in the
  1119. configuration.
  1120.  
  1121. Local Menus
  1122. -----------
  1123.  
  1124.    * Close Window
  1125.  
  1126.      closes the window.
  1127.  
  1128.    * Shrink Window
  1129.  
  1130.      shrinks the window.
  1131.  
  1132.    * Expand Window
  1133.  
  1134.      expands the window to screen size.
  1135.  
  1136.    * Link to Register
  1137.  
  1138.      links the window with a register.  If you enter the string `NO' it
  1139.      switches to absolute mode.
  1140.  
  1141.    * Change address
  1142.  
  1143.      changes the view address of the window.
  1144.  
  1145.    * Clear address
  1146.  
  1147.      resets the view address of the window.
  1148.  
  1149.    * Refresh Window
  1150.  
  1151.      refreshes the window.
  1152.  
  1153.    * .W Branches
  1154.  
  1155.      activates and disactivates the output of the old branch width size.
  1156.  
  1157.    * Neg. Offsets
  1158.  
  1159.      activates and disactivates the output of negative values in
  1160.      indirect address modes with offset.
  1161.  
  1162.    * Neg. Data
  1163.  
  1164.      activates and disactivates the output of negative values in direct
  1165.      address mode.
  1166.  
  1167.    * Opcode Data
  1168.  
  1169.      activates and disactivates the additional output of the command
  1170.      bytes.
  1171.  
  1172.    * Auto Refresh
  1173.  
  1174.      activates and disactivates the global refresh of the window after
  1175.      each step.
  1176.  
  1177.    * Symbols
  1178.  
  1179.      activates and disactivates the symbol output in the window.
  1180.  
  1181.    * Show Lib Call
  1182.  
  1183.      activates and disactivates the symbolic output of library
  1184.      functions so all library functions that are defined in the
  1185.      configuration file `<BarflyPath>/Barfly/BARFLY.FD' are recognized.
  1186.  
  1187.    * Guess Lib Call
  1188.  
  1189.      activates and disactivates the guessing of function call names.
  1190.      This only works in connection with the option `Show Lib Call'.
  1191.      Unfortunately you can't expect that the function names always fit
  1192.      because the library base register A6 can change until the program
  1193.      counter meets the function.
  1194.  
  1195.    * Mark Block End
  1196.  
  1197.      activates and deactivates marking after the instruction `JMP',
  1198.      `BRA', `RTS', `RTE', `RTD' and `RTR' to make program blocks more
  1199.      visible.
  1200.  
  1201.    * Set/Clear Breakpoint
  1202.  
  1203.      sets/removes a breakpoint on the first entry in the window.
  1204.      Breakpoints are shown by changing the pen from colour 1 to colour
  1205.      3 and the char `>' at the beginning of a line.
  1206.  
  1207.    * Pick/Clear Breakpoint
  1208.  
  1209.      sets/removes a breakpoint through a symbol list.
  1210.  
  1211.    * Disassemble to File
  1212.  
  1213.      disassembles a memory area into a file.
  1214.  
  1215. Usage of BDebug
  1216. ***************
  1217.  
  1218. The Memory Window
  1219. =================
  1220.  
  1221. Memory window
  1222. -------------
  1223.  
  1224.    The `MemWindow' shows the memory contents hexadecimal and in
  1225. ascii.You can change size of the window and scroll through the memory
  1226. area whith the cursor keys.  In the title you see an ID-String with the
  1227. format `\#x.y' where `X' represents the `REGWindow' number and `y' the
  1228. number of the `MemWindow'.
  1229.  
  1230. Local Menus
  1231. -----------
  1232.  
  1233.    * Close Window
  1234.  
  1235.      closes the window.
  1236.  
  1237.    * Shrink Window
  1238.  
  1239.      shrinks the window.
  1240.  
  1241.    * Expand Window
  1242.  
  1243.      expands the window to screen size.
  1244.  
  1245.    * Link to Register
  1246.  
  1247.      links the window with a register.  If you enter the string `NO' it
  1248.      switches to absolute mode.
  1249.  
  1250.    * Change address
  1251.  
  1252.      changes the view address of the window.
  1253.  
  1254.    * Clear address
  1255.  
  1256.      resets the view address of the window.
  1257.  
  1258.    * Refresh Window
  1259.  
  1260.      refreshes the window.
  1261.  
  1262.    * Memory Offset Step
  1263.  
  1264.      defines the data format in the window.  The following options can
  1265.      be selected: `None', `Byte', `Word' and `Long'.
  1266.  
  1267.    * Edit
  1268.  
  1269.      activates edit mode of the `MemWindow'.  In edit mode you can
  1270.      switch between hex and ascii input by the key `RETURN'. With `ESC'
  1271.      you can leave edit mode. Only the cursor right and left are
  1272.      changed to the normal.  With these both keys you can access each
  1273.      Byte.  In edit mode you can't change the size of the window.
  1274.  
  1275.    * Copy
  1276.  
  1277.      copies a memory area into another memory area.  The function uses
  1278.      `CopyMem' so it doesn't handle memory areas that overlap.
  1279.  
  1280.    * Fill
  1281.  
  1282.      fills a memory area with a value of a certain data-width.
  1283.  
  1284.    * Compare
  1285.  
  1286.      compares a memory area with another memory area.
  1287.  
  1288.    * Search
  1289.  
  1290.      searches a value of a certain data-width in a memory area.  If the
  1291.      value is found, the address and the value are displayed and you
  1292.      can goon with `Search Next' to find the next address.
  1293.  
  1294.    * Search Next
  1295.  
  1296.      Search the next value. Look at `Search'
  1297.  
  1298.    * Pred
  1299.  
  1300.      sets the address of the window tn the preceding entry of the list.
  1301.      If the node points on an odd, illegal or NULL address the command
  1302.      has no effect.  The next node is equal to `LN_PRED', the second
  1303.      longword of the memory view.
  1304.  
  1305.    * Succ
  1306.  
  1307.      sets the address of the window to the next entry of the list.  If
  1308.      the node points on an odd, illegal or NULL address the command has
  1309.      no effect.  The next node is equal to `LN_SUCC', the first longword
  1310.      of the memory view.
  1311.  
  1312. Usage of BDebug
  1313. ***************
  1314.  
  1315. The Copper Window
  1316. =================
  1317.  
  1318. CopperWindow
  1319. ------------
  1320.  
  1321.    The `CopperWindow' shows the memory contents as copper commands.
  1322. The window is sizeable, and you can use the cursor keys to scroll
  1323. through the memry area.  In the title you see an ID-String with the
  1324. format `\#x.y' where `X' represents the `REGWindow' number and `y' the
  1325. number of the `CoppWindow'.
  1326.  
  1327. Local Menus
  1328. -----------
  1329.  
  1330.    * Close Window
  1331.  
  1332.      closes the window.
  1333.  
  1334.    * Shrink Window
  1335.  
  1336.      shrinks the window.
  1337.  
  1338.    * Expand Window
  1339.  
  1340.      expands the window to screen size.
  1341.  
  1342.    * Link to Register
  1343.  
  1344.      links the window with a register.  If you enter the string `NO' it
  1345.      switches to absolute mode.
  1346.  
  1347.    * Change address
  1348.  
  1349.      changes the view address of the window.
  1350.  
  1351.    * Clear address
  1352.  
  1353.      resets the view address of the window.
  1354.  
  1355.    * Refresh Window
  1356.  
  1357.      refreshes the window.
  1358.  
  1359.    * Goto Into List
  1360.  
  1361.      sets the window list on the standard copperlist
  1362.      `GfxBase->gb_copinit'.
  1363.  
  1364. Usage of BDebug
  1365. ***************
  1366.  
  1367. The Structure Window
  1368. ====================
  1369.  
  1370. StructWindow
  1371. ------------
  1372.  
  1373.    opens window which can be connected with a structure.  You can use
  1374. new structure entries by expanding the the
  1375. `<BarflyPath>/Barfly/Barfly.Include' file or loading a new custom file.
  1376. By a doubleclick on a structure window entry you can cause several
  1377. actions depending on the datatype.  Every datatype is connected with an
  1378. action that is normally started automaticlly.  With the configuration
  1379. command `NoAutoStructAction' you can change this behaviour so that an
  1380. action type requester is opened.
  1381.  
  1382.    The following datatypes are available.
  1383.  
  1384.    * APTR opens a MemWindow.
  1385.  
  1386.    * CSTR shows a string.
  1387.  
  1388.    * BPTR opens a MemWindow at the address BPTR*4.
  1389.  
  1390.    * BSTR shows a string at the address (BPTR*4)+1
  1391.  
  1392.    * CPTR opens a DissWindow.
  1393.  
  1394.    * FPTR opens a DissWindow.
  1395.  
  1396.    * BYTE doesn't cause an action.
  1397.  
  1398.    * WORD doesn't cause an action.
  1399.  
  1400.    * LONG doesn't cause an action.
  1401.  
  1402.    * FLOAT doesn't cause an action.
  1403.  
  1404.    * DOUBLE doesn't cause an action.
  1405.  
  1406.    * EXTENDED doesn't cause an action.
  1407.  
  1408.    * RPTR doesn't cause an action.
  1409.  
  1410.    The following action types are available.
  1411.  
  1412.    * MemWindow opens a MemWindow.
  1413.  
  1414.    * DissWindow opens a DissWindow.
  1415.  
  1416.    * CoppWindow opens a CoppWindow.
  1417.  
  1418.    * StructWindow opens a StructWindow.
  1419.  
  1420.    * NewStruct sets a new structure.
  1421.  
  1422. Structure Macro Fileformat
  1423. --------------------------
  1424.  
  1425.    This section describes the file format of structure macros.  In the
  1426. beginning you define the root directory entries with the first Macro
  1427. `Menudir'.  The first parameter is the name of the entry, then the
  1428. address of the parent directory and then the address of the
  1429. subdirectory.  In the root directory the parent address is obviously
  1430. NULL.  The last entry of the directory is defined by the Macro
  1431. `MENUDIREND'.
  1432.  
  1433.      `Label                   ListViewMacro           Link'
  1434.      RootDir:
  1435.                              .
  1436.                              .
  1437.                              MENUDIR                 exec,0,Exec_Dir
  1438.                              .
  1439.                              .
  1440.      MYCUSTOMENTRY:
  1441.                              MENUDIREND              CUSTOM,0,0
  1442.  
  1443.    The design of a subdirectory only differs from the root directory
  1444. entries only by a parent directory address.
  1445.  
  1446.      `Label                   ListViewMacro           Link'
  1447.      Exec_Dir:
  1448.                              .
  1449.                              .
  1450.                              MENUDIR                 nodes.i,RootDir,Nodes_Dir
  1451.                              .
  1452.                              .
  1453.                              MENUDIREND              tasks.i,RootDir,Tasks_Dir
  1454.  
  1455.    to define the structure directory entries you have to use `MENUITEM'
  1456. and `MENUITEMEND'.  The first parameter in the Item Macros is the name
  1457. of the entry and also the name of the structure.  The second parameter
  1458. defines the address of the parent directory.
  1459.  
  1460.      `Label                   ListViewMacro           Link'
  1461.                              .
  1462.                              .
  1463.      Nodes_Dir:
  1464.                              MENUITEM                LN,Exec_Dir
  1465.                              .
  1466.                              .
  1467.                              MENUITEMEND
  1468.  
  1469.    To define a structure you can use the normal assembler syntax that
  1470. you probably have to adjust to your custom needs. For example you can
  1471. tell BDebug more informations about the datatype an entry represents.
  1472. By redefining `APTR' to a `CSTR' you can tell the Debugger that the
  1473. entry is a stringpointer.  Another example is defining that `APTR'
  1474. points to a structure by `APTR LN_SUCC,Node'.
  1475.  
  1476.      `Label                   IncludeTypeMacro        Name,Link'
  1477.      LN_Struct:
  1478.                              STRUCTUREB              LN,0
  1479.                              APTR                    LN_SUCC,LN
  1480.                              APTR                    LN_PRED,LN
  1481.                              UBYTE                   LN_TYPE
  1482.                              BYTE                    LN_PRI
  1483.                              CCSTR                   LN_NAME
  1484.                              LABEL                   LN_SIZE
  1485.  
  1486. Local Menus
  1487. -----------
  1488.  
  1489.    * Close Window
  1490.  
  1491.      closes the window.
  1492.  
  1493.    * Shrink Window
  1494.  
  1495.      shrinks the window.
  1496.  
  1497.    * Expand Window
  1498.  
  1499.      expands the window to screen size.
  1500.  
  1501.    * Link to Register
  1502.  
  1503.      links the window with a register.  If you enter the string `NO' it
  1504.      switches to absolute mode.
  1505.  
  1506.    * Change address
  1507.  
  1508.      changes the view address of the window.
  1509.  
  1510.    * Clear address
  1511.  
  1512.      resets the view address of the window.
  1513.  
  1514.    * Refresh Window
  1515.  
  1516.      refreshes the window.
  1517.  
  1518.    * Load Custom Struct
  1519.  
  1520.      loads additional structure files. The new structure entries are
  1521.      placed in the `CUSTOM' directory.  The format of custom structure
  1522.      files is equal to the file `BARFLY.INCLUDE'.
  1523.  
  1524.    * Select Structure
  1525.  
  1526.      opens the structure include directory requester where you can
  1527.      select the needed structure.  The parent gadget is placed in the
  1528.      upper border.
  1529.  
  1530.    * Goto Sysbase...
  1531.  
  1532.      sets the window address on the ExecBase.
  1533.  
  1534.    * Goto Gfxbase...
  1535.  
  1536.      sets the window address on the GFXBase.
  1537.  
  1538.    * Save Window....
  1539.  
  1540.      saves the contents of the window in a file.
  1541.  
  1542.    * Full Address
  1543.  
  1544.      this switch decides whether the `StructWindow' also shows the
  1545.      address of the entries.
  1546.  
  1547.    * Offset Address
  1548.  
  1549.      this switch decides wheather the `StructWindow' also shows the
  1550.      offset of the entries.
  1551.  
  1552.    * Pred
  1553.  
  1554.      sets the address of the window on the preceding entry of the list.
  1555.      If the node points on an odd, illegal or NULL address the command
  1556.      has no effect.  The next node is equal to `LN_PRED', the second
  1557.      longword of the memory view.
  1558.  
  1559.    * Succ
  1560.  
  1561.      sets the address of the window on the next entry of the list.  If
  1562.      the node points on an odd, illegal or NULL address the command has
  1563.      no effect.  The next node is equal to `LN_SUCC', the first longword
  1564.      of the memory view.
  1565.  
  1566. Usage of BDebug
  1567. ***************
  1568.  
  1569. The Structure Window
  1570. ====================
  1571.  
  1572. Source window
  1573. -------------
  1574.  
  1575.    The `SourceWindow' shows the source line that belongs to the window
  1576. address. If the program file doesn't have the needed debug informations
  1577. the `Source window' can't be opened. If the address points to an area
  1578. with no relevant debug information, for example the Kickstart or beyond
  1579. the program hunks, all you see is a small message.
  1580.  
  1581. Local Menus
  1582. -----------
  1583.  
  1584.    * Close Window
  1585.  
  1586.      closes the window.
  1587.  
  1588.    * Shrink Window
  1589.  
  1590.      shrinks the window.
  1591.  
  1592.    * Expand Window
  1593.  
  1594.      expands the window to screen size.
  1595.  
  1596.    * Link to Register
  1597.  
  1598.      links the window with a register.  If you enter the string `NO' it
  1599.      switches to absolute mode.
  1600.  
  1601.    * Change address
  1602.  
  1603.      changes the view address of the window.
  1604.  
  1605.    * Clear address
  1606.  
  1607.      resets the view address of the window.
  1608.  
  1609.    * Refresh Window
  1610.  
  1611.      refreshes the window.
  1612.  
  1613.    * Set Breakpoint
  1614.  
  1615.      sets a breakpoint on the active line.
  1616.  
  1617.    * Show HunkInfo
  1618.  
  1619.      shows the hunk of the current source line.
  1620.  
  1621. Usage of BDebug
  1622. ***************
  1623.  
  1624. The Snoop Window
  1625. ================
  1626.  
  1627. Snoop Window
  1628. ------------
  1629.  
  1630.    The `SnoopWindow' snoops the task's allocations.
  1631.  
  1632. Local Menus
  1633. -----------
  1634.  
  1635.    * Close Window
  1636.  
  1637.      closes the window.
  1638.  
  1639.    * Shrink Window
  1640.  
  1641.      shrinks the window.
  1642.  
  1643.    * Expand Window
  1644.  
  1645.      expands the window to screen size.
  1646.  
  1647.    * Refresh Window
  1648.  
  1649.      refreshes the window.
  1650.  
  1651.    * Auto Refresh
  1652.  
  1653.      activates/deactivates display refresh by an allocation.
  1654.  
  1655.    * Snoop Memory
  1656.  
  1657.      activates/deactivates snooping.
  1658.  
  1659.    * Snoop Mask
  1660.  
  1661.      sets the allocation filter mask.  If the Mask is set to , only
  1662.      allocations with the size 20 are recorded. Default -1.
  1663.  
  1664.    * Snoop Max Entries
  1665.  
  1666.      sets the maximal recordable snoop entries.
  1667.  
  1668. Usage of BDebug
  1669. ***************
  1670.  
  1671. The Breakpoint Window
  1672. =====================
  1673.  
  1674. Breakpoint window
  1675. -----------------
  1676.  
  1677.    The `BreakWindow' handles all breakpoints and contains the functions
  1678. that are needed with breakpoints.  In general, breakpoints are
  1679. addresses in the program where the task should be stopped.  The
  1680. breakpoints are handled globally so they aren't deleted when close the
  1681. window.
  1682.  
  1683. Local Menus
  1684. -----------
  1685.  
  1686.    * Toggle
  1687.  
  1688.      activates and deactivates all breakpoints.
  1689.  
  1690.    * All
  1691.  
  1692.      selects all breakpoints.
  1693.  
  1694.    * Clear
  1695.  
  1696.      unselects all breakpoints.
  1697.  
  1698.    * On
  1699.  
  1700.      activates all selected breakpoints.
  1701.  
  1702.    * Off
  1703.  
  1704.      deactivates all selected breakpoints.
  1705.  
  1706.    * Hit
  1707.  
  1708.      defines how often a breakpoint must be encountered before the
  1709.      program stops. Default is 1.
  1710.  
  1711.    * ?
  1712.  
  1713.      shows the hunk where the breakpoint is located and also shows if
  1714.      the breakpoint is equal to a symbol.
  1715.  
  1716.    * Input
  1717.  
  1718.      sets and removes a breakpoint.
  1719.  
  1720.    * Pick
  1721.  
  1722.      sets and removes a breakpoint using the symbol list.
  1723.  
  1724.    * Delete
  1725.  
  1726.      removes all selected breakpoint.
  1727.  
  1728.    * Goto
  1729.  
  1730.      opens a DissWindow for each selected breakpoint.
  1731.  
  1732.    * Run
  1733.  
  1734.      runs the program until the PC encounters a selected breakpoint.
  1735.  
  1736. Usage of BDebug
  1737. ***************
  1738.  
  1739. The Watchpoint Window
  1740. =====================
  1741.  
  1742. Watchpoint window
  1743. -----------------
  1744.  
  1745.    The `Watchwindow' allows to set breakpoints that aren't depending on
  1746. a certain PC address but on other conditions.  Every watchpoint has a
  1747. condition, data width and can have one of 3 different watchpoints
  1748. states.  The `Memory' watchpoint compares the saved contents of the
  1749. address with the current contents and dependent on the condition the
  1750. program is stopped or not.  The `Register' watchpoint compares the
  1751. saved contents of a register with the current contents and dependent on
  1752. the condition the program is stopped or not.  The `Argument' watchpoint
  1753. compares the saved value of an argument with the current contents and
  1754. dependent on the condition the program is stopped or not.  The last
  1755. watchpoint type is the most powerful because it can simulate the first
  1756. two types with the cost of a slowdown.  The use of watchpoints is very
  1757. time consuming because the whole program is run in single step mode.
  1758. In order to use watchpoi you have to run the task with `Run Watched
  1759. Task'.
  1760.  
  1761.      If an error occurs in the exception handler during the evaluation
  1762.      of a dynamic arugment, the screen flashes.
  1763.  
  1764.  
  1765. Local Menus
  1766. -----------
  1767.  
  1768.    * Toggle
  1769.  
  1770.      activates and deactivates all watchpoints.
  1771.  
  1772.    * All
  1773.  
  1774.      selects all watchpoints.
  1775.  
  1776.    * Clear
  1777.  
  1778.      unselects all watchpoints.
  1779.  
  1780.    * On
  1781.  
  1782.      activates all selected watchpoints.
  1783.  
  1784.    * Off
  1785.  
  1786.      deactivates all selected watchpoints.
  1787.  
  1788.    * Add
  1789.  
  1790.      opens a requester where the parameters for a watchpoint have to be
  1791.      adjusted and adds the new watchpoint to the list.  You can change
  1792.      the parameters simply by doubeclicking on a watchpoint.
  1793.  
  1794.    * Refresh
  1795.  
  1796.      refreshes the watchpoint arguments.
  1797.  
  1798.    * Check
  1799.  
  1800.      checks all selected watchpoints.
  1801.  
  1802.    * Delete
  1803.  
  1804.      removes all selected watchpoints.
  1805.  
  1806. Usage of BDebug
  1807. ***************
  1808.  
  1809. The Checksum Window
  1810. ===================
  1811.  
  1812. Checksum Window
  1813. ---------------
  1814.  
  1815.    The `ChecksumWindow' controls all checksum areas that are controlled
  1816. each time the task stops.  Helpful to find illegal random writes bugs.
  1817. The checkpoints are controled globally so they aren't deleted when you
  1818. close the window.
  1819.  
  1820. Local Menus
  1821. -----------
  1822.  
  1823.    * Toggle
  1824.  
  1825.      activates or deactivates all checksum areas.
  1826.  
  1827.    * All
  1828.  
  1829.      selects all checksum areas.
  1830.  
  1831.    * Clear
  1832.  
  1833.      unselects all checksum areas.
  1834.  
  1835.    * On
  1836.  
  1837.      activates all selected checksum areas.
  1838.  
  1839.    * Off
  1840.  
  1841.      deactivates all selected checksum areas.
  1842.  
  1843.    * Address
  1844.  
  1845.      adds a checksum area into the list.
  1846.  
  1847.    * Hunk
  1848.  
  1849.      adds a hunk of the current process into the checksum area list.
  1850.  
  1851.    * Task
  1852.  
  1853.      adds a hunk of selectable process into the checksum area list.
  1854.  
  1855.    * Refresh
  1856.  
  1857.      calculate a new checksum for all selected areas.
  1858.  
  1859.    * Delete
  1860.  
  1861.      removes all selected checksum areas.
  1862.  
  1863.    * Check
  1864.  
  1865.      checks all areas for checksum errors.
  1866.  
  1867. Usage of BDebug
  1868. ***************
  1869.  
  1870. Requester Arguments
  1871. ===================
  1872.  
  1873. Argument Structur
  1874. -----------------
  1875.  
  1876.    An argument can use absolut values, symbols and registers as
  1877. operands and the operators +,-,*,/,|,!,&,<<,>>,~.  Additionally to the
  1878. normal symbols, some special symbols are available.
  1879.  
  1880.    * By {Argument}.[b,w,l] you can read from a memory address, that is
  1881.      defined by the argument. An error is indicated if you specify an
  1882.      illegal address with isn't defined in the legal memory space.
  1883.  
  1884.    * \#d?  represents the address of the `Disswindows' with the ID ?
  1885.  
  1886.    * \#m?  represents the address of the `Memwindows' with the ID ?
  1887.  
  1888.    * \#c?  represents the address of the `Coppwindows' with the ID ?
  1889.  
  1890.    * \#h?  represents the address of the hunk ?.  Helpful for Enforcer
  1891.      and CyberGuard Hunk:Offset output
  1892.  
  1893.    * \#ea? represents the address of the EA with the number ?.  Check
  1894.      Register Window.
  1895.  
  1896.    * \#em? represents the contents where the address EA number ?
  1897.      points to.  Check Register Window. If the address EA is illegal an
  1898.      error is shown.
  1899.  
  1900.    * \#ls  represents the start address of a loaded binary file.
  1901.  
  1902.    * \#le  represents the end address of a loaded binary file.
  1903.  
  1904.    * \#ll  represents the length address of a loaded binary file.
  1905.  
  1906.    * \#p   represents the start address of the programs.  Only true for
  1907.      a loaded program.
  1908.  
  1909.    If you have the following Enforcer or CyberGuard hit output `Hunk
  1910. 0:$11c' you can calculate the address by entering the argument #h0+$11c.
  1911.  
  1912. Usage of BDebug
  1913. ***************
  1914.  
  1915. Technical Informations
  1916. ======================
  1917.  
  1918. Exceptions
  1919. ----------
  1920.  
  1921.    The Debugger can catch all exceptions if the system is still working.
  1922. If an exception is caused, the traphandler catches the exception and
  1923. tells the Debugger what went on so it can react on the exception.  If
  1924. the exception wasn't caused by the Debugger, the type and the possible
  1925. reason for the exception is shown.  The `Return-address' of the
  1926. debugged task points on an internal `ILLEGAL'. If the processor
  1927. encounters this `ILLEGAL' the task is closed and all windows are
  1928. removed.  You shouldn't step over this `ILLEGAL' because it increases
  1929. the possibility of a system crash.  If a task is caught by `Debug Next
  1930. Task' and notices a custom `finalPC' routine in the `Addtask()'
  1931. function, the `Return-address' isn't set on the internal `ILLEGAL'
  1932. cleanup function because the `finalPC' pointer is sometimes used for
  1933. parsing an argument.  In this case the Debugger notices that the task
  1934. ends by using the `RemTask()' function.
  1935.  
  1936.      If the task changes the `Return-address' the Debugger tries to
  1937.      determine the taskend by `RemTask'.
  1938.  
  1939.  
  1940. Exception Handler
  1941. -----------------
  1942.  
  1943.    Every task has a pointer in its task structure that points to its
  1944. exception handler, named `TC_TRAPCODE'.  When you load a program
  1945. through the Debugger, the Debugger's standard exception handler is
  1946. installed. It works basicly the same for `Catch Next Task' and `Debug
  1947. Task'.  The only difference is the `Debug Crashed Task' mode where the
  1948. Debugger sets a special catch exception handler in each task that isn't
  1949. controlled by the Debugger.  When an exception occurs and the
  1950. Debugger's exception handler is called the Debugger first checks if it
  1951. knows the task that caused it.  If this is not the case something
  1952. seriously is broken and the Deadend Alert 35000000 will be popped up.
  1953. If all goes well the registers are saved, the Debugger task gets a
  1954. message and the exception handler waits for a message by the Debugger
  1955. to go on.  When the Debugger gets the message it causes the appropriate
  1956. function. For example refreshing the windows.  If the Debugger gets a
  1957. step command it sends the exception handler the appropriate message and
  1958. the handler does a step.
  1959.  
  1960. Debug Informations
  1961. ------------------
  1962.  
  1963.    Currently the following formats are supported.
  1964.  
  1965.    * BASM Specialformat This format allows the Debugger to decide if
  1966.      the code is in the Mainpart, Includes or in a Macro.
  1967.  
  1968.    * SAS D1 This format only allows a Source-Code connection.  It
  1969.      doesn't support local variables, Structures and Macros.
  1970.  
  1971.    * GCC STABS This format is very powerful and offers all a
  1972.      source-level Debugger needs.  Unfortunately the Debugger only
  1973.      supports a simple Source-Code connection at the moment.  It's
  1974.      planned to support more in the future.
  1975.  
  1976. GCC Compiler and BDebug
  1977. -----------------------
  1978.  
  1979.    Unfortunately you can't debug programs that are using the current
  1980. `ixemul.library' because in Openlibrary() initroutine the Task field
  1981. TC_TRAPCODE is changed.  Hopefully there'll be soon an `ixemul.library'
  1982. available that doesn't change the traphandler.  If you're using GCC
  1983. with the link lib `gerlib' that is available on Aminet FTP Servers you
  1984. shouldn't experience any problems with BDebug.
  1985.  
  1986. Usage of BDebug
  1987. ***************
  1988.  
  1989. Configuration
  1990. =============
  1991.  
  1992.    The default configuration file is named `BDEBUG.Config' and is
  1993. located in the directory `<BarflyPath>/' or `s:Barfly/'.  Obviously
  1994. it's not optimal to be forced to use the same config file for different
  1995. programs. Therefore you can also specify a local config file with
  1996. program name and the suffix `.BDebug'.
  1997.  
  1998. ToolTypes
  1999. ---------
  2000.  
  2001.    The following tooltypes are supported to activate the basic
  2002. functions of the commandwindow.
  2003.  
  2004.    * CatchNextTask
  2005.  
  2006.    * CatchCrashedTask
  2007.  
  2008.    * CatchEnforcerHit
  2009.  
  2010. Barfly.FD
  2011. ---------
  2012.  
  2013.    Following steps are necessary to create a new `Barfly.FD' file with
  2014. new library functions.  First the assign `FD:' must point to the
  2015. directory containing the FD files that should be included in the new
  2016. `Barfly.FD'.  Make sure that every FD file contains the Library,
  2017. Resource and Device name in the first line in following format: `*
  2018. "foobar.libary"'.  If necessary, add the name yourself, so that a
  2019. correct FD database can be build up.  If you're more experienced with
  2020. FD files, you can yourself add new entries to the `Barfly.FD' file. The
  2021. layout of the `Barfly.FD' file pretty obvious.
  2022.  
  2023. Configuration Commands
  2024. ----------------------
  2025.  
  2026. Register window
  2027. ---------------
  2028.  
  2029. RegWindow=x/y/width/height/register
  2030. ...................................
  2031.  
  2032.    This command defines the position of a `REGWindow'.
  2033.  
  2034. RegFlags=flag[|flags...]
  2035. ........................
  2036.  
  2037.    This command defines certain flags in the `REGWindows'.
  2038.  
  2039.    * AUTOVIEWREFRESH
  2040.  
  2041.    * SYMBOLS
  2042.  
  2043.    * STACKCHECK
  2044.  
  2045.    * NOBIGVIEW
  2046.  
  2047. FPU Window
  2048. ----------
  2049.  
  2050. FpuWindow=x/y/width/height/register
  2051. ...................................
  2052.  
  2053.    This command defines the position of a `FPUWindow'.
  2054.  
  2055. OpenFPUWindows=Count
  2056. ....................
  2057.  
  2058.    This command tells the Debugger to open a `FPUWindow'.
  2059.  
  2060. Disassembler window
  2061. -------------------
  2062.  
  2063. DissWindow=x/y/width/height/register
  2064. ....................................
  2065.  
  2066.    This command defines the position,the dimension and linked register
  2067. of the `DissWindow'.
  2068.  
  2069.    Example: DISSWINDOW=0/0/300/100/PC
  2070.  
  2071. DissFlags=flag[|flags...]
  2072. .........................
  2073.  
  2074.    This command defines certain flags in the `DISSWindow'.
  2075.  
  2076.    * AUTOREFRESH
  2077.  
  2078.    * SHOWLIB
  2079.  
  2080.    * GUESSLIB
  2081.  
  2082.    * SHOWEA
  2083.  
  2084.    * WORDBRANCHES
  2085.  
  2086.    * NEGOFFSETS
  2087.  
  2088.    * NEGDI
  2089.  
  2090.    * OPCODEDATA
  2091.  
  2092.    * BLANKAFTERJMPBRA
  2093.  
  2094. OpenDissWindows=Count
  2095. .....................
  2096.  
  2097.    This command tells the Debugger to open a number of `DissWindows'.
  2098.  
  2099. Memory window
  2100. -------------
  2101.  
  2102. MemWindow=x/y/width/height/register
  2103. ...................................
  2104.  
  2105.    This command defines the position, the dimension and linked register
  2106. of the `MemWindow'.
  2107.  
  2108.    Example: MEMWINDOW=0/0/300/100/A0
  2109.  
  2110. OpenMemWindows=Count
  2111. ....................
  2112.  
  2113.    This command tells the Debugger to open a number of `MemWindows'.
  2114.  
  2115. MemoryOffsetStep=Count
  2116. ......................
  2117.  
  2118.    This command defines the Offset-Step of the `MemWindows'.
  2119.  
  2120.    * 0 no Space
  2121.  
  2122.    * 1 Space after each Byte.
  2123.  
  2124.    * 2 Space after each Word.
  2125.  
  2126.    * 4 Space after each Longword.
  2127.  
  2128. Copper window
  2129. -------------
  2130.  
  2131. CoppWindow=x/y/width/height/register
  2132. ....................................
  2133.  
  2134.    This command defines the position, the dimension and linked register
  2135. of the `CoppWindow'.
  2136.  
  2137.    Example: COPPWINDOW=0/0/300/100/A0
  2138.  
  2139. OpenCoppWindows=Count
  2140. .....................
  2141.  
  2142.    This command tells the Debugger to open a number of `CoppWindows'.
  2143.  
  2144. StructWindow
  2145. ------------
  2146.  
  2147. StructWindow=x/y/width/height/register
  2148. ......................................
  2149.  
  2150.    This command defines the position, the dimension and linked register
  2151. of the `StructWindow'.
  2152.  
  2153.    Example: StructWINDOW=0/0/300/100/A0
  2154.  
  2155. StructFlags=flag[|flags...]
  2156. ...........................
  2157.  
  2158.    This command defines certain flags for the `StructWindow'
  2159.  
  2160.    * AUTOREFRESH
  2161.  
  2162.    * ADDRESSFORMAT
  2163.  
  2164.    * OFFSETFORMAT
  2165.  
  2166.    * NEWWINDOW
  2167.  
  2168. OpenStructWindows=Count
  2169. .......................
  2170.  
  2171.    This command tells the Debugger to open a number of `StructWindows'.
  2172.  
  2173. Source window
  2174. -------------
  2175.  
  2176. SourceWindow=x/y/width/height/register
  2177. ......................................
  2178.  
  2179.    This command defines the position, the dimension and linked register
  2180. of the `SourceWindow'.
  2181.  
  2182.    Example: SOURCEWINDOW=0/0/300/100/A0
  2183.  
  2184. OpenSourceWindows=Count
  2185. .......................
  2186.  
  2187.    This command tells the Debugger to open a number of `SourceWindows'.
  2188.  
  2189. Breakpoint window
  2190. -----------------
  2191.  
  2192. BreakWindow=x/y/width/height
  2193. ............................
  2194.  
  2195.    This command defines the position of a `BreakPointWindow'.
  2196.  
  2197. OpenBreakWindows=Count
  2198. ......................
  2199.  
  2200.    This command tells the Debugger to open a `BreakPointWindow'.
  2201.  
  2202. Watchpoint window
  2203. -----------------
  2204.  
  2205. WatchWindow=x/y/width/height
  2206. ............................
  2207.  
  2208.    This command defines the position of a `WatchpoinzWindow'.
  2209.  
  2210. OpenWatchWindows=Count
  2211. ......................
  2212.  
  2213.    This command tells the Debugger to open a `WatchPointWindow'.
  2214.  
  2215. Checksum window
  2216. ---------------
  2217.  
  2218. ChecksumWindow=x/y/width/height
  2219. ...............................
  2220.  
  2221.    This command defines the position of a `ChecksumWindow'.
  2222.  
  2223. ChecksumWindows=Count
  2224. .....................
  2225.  
  2226.    This command tells the Debugger to open a `ChecksumWindow'.
  2227.  
  2228. SnoopMemory window
  2229. ------------------
  2230.  
  2231. SnoopMemWindow=x/y/width/height/register
  2232. ........................................
  2233.  
  2234.    This command defines the position of a `SnoopMemWindow'.
  2235.  
  2236. OpenSnoopMemWindow=Count
  2237. ........................
  2238.  
  2239.    This command tells the Debugger to open a `SnoopMemWindow'.
  2240.  
  2241. SnoopMask=Mask
  2242. ..............
  2243.  
  2244.    This command defines the snoop mask. The mask defines the length of
  2245. memory blocks that should be recorded.  Default is -1 so everything is
  2246. recorded.
  2247.  
  2248. SnoopMax=Count
  2249. ..............
  2250.  
  2251.    This command defines the count of snoop entries.  Default is 100.
  2252.  
  2253. HistoryEntrys=Count
  2254. ...................
  2255.  
  2256.    This command defines the count of history entries.  Default is 5.
  2257.  
  2258. Information Windows
  2259. -------------------
  2260.  
  2261. GlobalViewWindow=x/y/width/height
  2262. .................................
  2263.  
  2264.    This command defines the position and dimensions of a standard
  2265. information window. For example the Library Window belongs to this
  2266. group.
  2267.  
  2268.    Example: GLOBALVIEWWINDOW=0/0/300/100
  2269. GLOBALVIEWWINDOW=0/200/300/100
  2270.  
  2271. Other Windows
  2272. -------------
  2273.  
  2274. CommandWindow=x/y/width/height
  2275. ..............................
  2276.  
  2277.    This command defines the position of the small `CommandWindow'.
  2278. This command has no function in local configuration files.
  2279.  
  2280. FileShell=<Window Specifikation>
  2281. ................................
  2282.  
  2283.    This command defines the shell that is opened with the loaded
  2284. program. You should always open the shell on the Debugger's Public
  2285. Screen. The shell parameters are the same you know from the CLI.
  2286.  
  2287. Misc
  2288. ----
  2289.  
  2290. TaskStack=Count
  2291. ...............
  2292.  
  2293.    This command defines the stack of the loaded program.  Defaullt are
  2294. 4096 Bytes.
  2295.  
  2296. Priority=Count
  2297. ..............
  2298.  
  2299.    This command defines the Debugger's priority.
  2300.  
  2301. SetBreak=Argument
  2302. .................
  2303.  
  2304.    This command can be used to define a list of breakpoints that are
  2305. set before the program is started.  This is useful to pass the module
  2306. `Main.c' for example.  If no breakpoints are defined or if a parsing
  2307. problem occurs the standard breakpoint ( the first program instruction
  2308. ) is set.
  2309.  
  2310.    * SETBREAK=_main    ; SAS C Main Program Start
  2311.  
  2312.    * SETBREAK=_main    ; GCC C Main Program Start
  2313.  
  2314.    * SETBREAK=@main   ; DICE C Main Program Start
  2315.  
  2316.    * SETBREAK=!    ; Programstart(Default)
  2317.  
  2318. ClickBreak=State
  2319. ................
  2320.  
  2321.    This command can be used to define the action of the DissWindow on a
  2322. doubleclick.
  2323.  
  2324. `State=0'
  2325.      No Action(Default).
  2326.  
  2327. `State=1'
  2328.      Set/Clear Breakpoint and pop up a Requester for a Set.
  2329.  
  2330. `State=2'
  2331.      Set/Clear Breakpoint.
  2332.  
  2333. ShowMem=Start:End
  2334. .................
  2335.  
  2336.    defines the address areas that are legal to the Debugger so you can
  2337. look at address areas that are not in the memorylist or in the rom.
  2338. Illegal address areas are shown with `*' in the windows.  You should
  2339. `never' define the custom chip areas as legal because a read access on
  2340. a writeonly register can cause a deadly crash.
  2341.  
  2342.    Example: SHOWMEM=$e80000:$f00000          defines the Zorro 2 area
  2343. as free.
  2344.  
  2345.      By this command you can overrule the internal Enforcer or
  2346.      CyberGuard legal memory areas so you should be free of hits.
  2347.  
  2348.  
  2349. DefCommand=Key,Qualifier[|Qualifier...],Function
  2350. ................................................
  2351.  
  2352.    This commands allows to connect menu functions with key sequences.
  2353. Because of the object-oriented concept of the Debugger that allows
  2354. multiple instances of objects it's not easy to decide what object is
  2355. meant.  Therefore if the object is active it's used and if no object of
  2356. this type is active the first entry the object-type list is used.  As
  2357. the key parameter every Rawkey can be used with the exception of `TAB'
  2358. and the functionkeys that are used internally.  The key is searched
  2359. first in the local and then in the global configuration.
  2360.  
  2361.    As qualifiers you can use the following keys.
  2362.  
  2363.    * LSHIFT
  2364.  
  2365.    * RSHIFT
  2366.  
  2367.    * CAPSLOCK
  2368.  
  2369.    * CTRL
  2370.  
  2371.    * LALT
  2372.  
  2373.    * RALT
  2374.  
  2375.    * LCOMMAND
  2376.  
  2377.    * RCOMMAND
  2378.  
  2379.           Bespiel:      DEFCOMMAND=$15,CTRL,"Step 1 Position"
  2380.  
  2381.      Defines CTRL-Z as Step 1 Position
  2382.  
  2383. AutoDocDir=<Path>
  2384. .................
  2385.  
  2386.    This command sets the path for the autodocs directory.
  2387.  
  2388. AutoDocAlias=Library,File
  2389. .........................
  2390.  
  2391.    This command sets an alias for Libraries, Devices or Resources to
  2392. define the connected Autodocs file.  There's no other way because it's
  2393. impossible to build the autodocs file by knowing the library name.
  2394.  
  2395. ArexxPath=<rx-path>
  2396. ...................
  2397.  
  2398.    This command sets the Arexx-Script Start-Command.  In a normal
  2399. system the path should be <sys:Rexxc/rx>.
  2400.  
  2401. ArexxInput=<File>
  2402. .................
  2403.  
  2404.    This command sets the Arexx-Command Input-File.  If you don't
  2405. specify the file, NIL: is used.
  2406.  
  2407. ArexxOutput=<File>
  2408. ..................
  2409.  
  2410.    This command sets the Arexx-Command Output-File.  If you don't
  2411. specify the file, NIL: is used.
  2412.  
  2413. ArexxCommand=[1...10],<Pfad>
  2414. ............................
  2415.  
  2416.    This command sets the 10 entries in the Arexx-Menu.  You specify the
  2417. number and the path of the Arexx-Script.
  2418.  
  2419.    ArexxCommand=1,"Rexx:Example.rexx"
  2420.  
  2421. ExecuteCommand=<File>
  2422. .....................
  2423.  
  2424.    this command can set up a list of programs that should be run before
  2425. the debugged program's task is started.  This parameter only works with
  2426. programs which are loaded by the Debugger. You also have to make sure
  2427. that the loaded programs have to `end' otherwise the task can't be
  2428. started.  For example you could use this command to set breakpoints
  2429. with Arexx-Scripts.
  2430.  
  2431. LoadInclude
  2432. ...........
  2433.  
  2434.    tells the Debugger to load the structure information file
  2435. `Barfly.Include'.
  2436.  
  2437. AddStructFile=Filename
  2438. ......................
  2439.  
  2440.    tells the Debugger to load a custom structure information file and
  2441. adds it into the CUSTOM/ subtree.
  2442.  
  2443. ClicktoFront
  2444. ............
  2445.  
  2446.    activates the Debugger's own `ClicktoFront' handler.  This function
  2447. should only be used if you don't use an own `Commodity' for this task.
  2448.  
  2449. CenterWindow
  2450. ............
  2451.  
  2452.    activates centering mode for all stringrequester windows.
  2453.  
  2454. ScreenInFront
  2455. .............
  2456.  
  2457.    activates `ScreenToFront' mode that pops the screen to front after
  2458. every trace operation.
  2459.  
  2460. OpenScreen[=width,height,depth,mode]
  2461. ....................................
  2462.  
  2463.    tells the Debugger to open its own screen.  If you don't enter
  2464. dimension parameters the wb screen is cloned. For the mode string you
  2465. string you can see in `Prefs/ScreenMode' requester.  This command has
  2466. no function in local configuration files.
  2467.  
  2468.    OPENSCREEN=1448,560,2,PAL:HighRes Interlace
  2469.  
  2470. OpenPubScreen=Name
  2471. ..................
  2472.  
  2473.    tells the Debugger to open on the Pubscreen with the specified name.
  2474. This command has no function in local configuration files.
  2475.  
  2476. ScreenFont=fontname/Height
  2477. ..........................
  2478.  
  2479.    defines a font for a Debugger screen.  This command has no function
  2480. in local configuration files.
  2481.  
  2482. QuietException=Exception Nummer
  2483. ...............................
  2484.  
  2485.    masks off certain exceptions for the exception requester so that
  2486. only a `DisplayBeep' is caused instead of a textrequest.  With the
  2487. value -1 you can mask off every exception and for example with the
  2488. value 4 you mask off the `Illegal' exception.
  2489.  
  2490. DisableXPointer
  2491. ...............
  2492.  
  2493.    deactivate the Wait-Pointer.
  2494.  
  2495. TraceBreak
  2496. ..........
  2497.  
  2498.    tells the Debugger to use breakpoints in the `Subroutine' Traces
  2499. instead of single steps.  The advantage is a speed up and the
  2500. disadvantage is that you can cause crashes while you step through
  2501. resident/reentry code.
  2502.  
  2503. CrashedTask
  2504. ...........
  2505.  
  2506.    activates `CatchCrashedTask' mode.
  2507.  
  2508. CatchEnforcerHit
  2509. ................
  2510.  
  2511.    activates `CatchEnforcerHit' mode.
  2512.  
  2513. DoNotCacheFullFile
  2514. ..................
  2515.  
  2516.    tells the Debugger not to cache program files while reading the
  2517. Symbol/Debug informations to save memory.  Obviously the parsing speed
  2518. will decrease.
  2519.  
  2520. DoNotPopPathRequest
  2521. ...................
  2522.  
  2523.    tells the Debugger to ignore errors from opening source files and
  2524. not to open a path requester.
  2525.  
  2526. NoAutoStructAction
  2527. ..................
  2528.  
  2529.    tells the Debugger to open a type-requester by an action in the
  2530. Structure Window.
  2531.  
  2532. NoBreakpointErrors
  2533. ..................
  2534.  
  2535.    tells the Debugger to ignore SETBREAK= errors that cause the
  2536. Debugger to always set an error on the program start.
  2537.  
  2538. Usage of BDebug
  2539. ***************
  2540.  
  2541. Arexx
  2542. =====
  2543.  
  2544. Commands
  2545. --------
  2546.  
  2547. SIMPLEREQUEST "
  2548. ...............
  2549.  
  2550.    * RC: -
  2551.  
  2552.    * result: 'OK'
  2553.  
  2554. TWOGADREQUEST "
  2555. ...............
  2556.  
  2557.    * RC: -
  2558.  
  2559.    * result: 'OK','FALSE'
  2560.  
  2561. TRIGADREQUEST "
  2562. ...............
  2563.  
  2564.    * RC: -
  2565.  
  2566.    * result: 'OK','FALSE','RESUME'
  2567.  
  2568. NEXT_ROOTWINDOW
  2569. ...............
  2570.  
  2571.    * RC: -
  2572.  
  2573.    * result: 'OK','FALSE'
  2574.  
  2575. NEXT_SUBWINDOW
  2576. ..............
  2577.  
  2578.    * RC: -
  2579.  
  2580.    * result: 'OK','FALSE'
  2581.  
  2582. FIRST_DISSWINDOW
  2583. ................
  2584.  
  2585.    * RC: -
  2586.  
  2587.    * result: 'OK','FALSE'
  2588.  
  2589. FIRST_MEMWINDOW
  2590. ...............
  2591.  
  2592.    * RC: -
  2593.  
  2594.    * result: 'OK','FALSE'
  2595.  
  2596. FIRST_COPPWINDOW
  2597. ................
  2598.  
  2599.    * RC: -
  2600.  
  2601.    * result: 'OK','FALSE'
  2602.  
  2603. FIRST_FPUWINDOW
  2604. ...............
  2605.  
  2606.    * RC: -
  2607.  
  2608.    * result: 'OK','FALSE'
  2609.  
  2610. FIRST_BREAKPOINTWINDOW
  2611. ......................
  2612.  
  2613.    * RC: -
  2614.  
  2615.    * result: 'OK','FALSE'
  2616.  
  2617. FIRST_STRUCTWINDOW
  2618. ..................
  2619.  
  2620.    * RC: -
  2621.  
  2622.    * result: 'OK','FALSE'
  2623.  
  2624. FIRST_SOURCEWINDOW
  2625. ..................
  2626.  
  2627.    * RC: -
  2628.  
  2629.    * result: 'OK','FALSE'
  2630.  
  2631. FIRST_SNOOPWINDOW
  2632. .................
  2633.  
  2634.    * RC: -
  2635.  
  2636.    * result: 'OK','FALSE'
  2637.  
  2638. FIRST_WATCHWINDOW
  2639. .................
  2640.  
  2641.    * RC: -
  2642.  
  2643.    * result: 'OK','FALSE'
  2644.  
  2645. ACTIVATE_ROOTWINDOW
  2646. ...................
  2647.  
  2648.    * RC: -
  2649.  
  2650.    * result: 'OK','FALSE'
  2651.  
  2652. ACTIVATE_SUBWINDOW
  2653. ..................
  2654.  
  2655.    * RC: -
  2656.  
  2657.    * result: 'OK','FALSE'
  2658.  
  2659. OPEN_DISSWINDOW '@REG' | 'Argument'
  2660. ...................................
  2661.  
  2662.    * RC: -
  2663.  
  2664.    * result: -
  2665.  
  2666. OPEN_MEMWINDOW '@REG' | 'Argument'
  2667. ..................................
  2668.  
  2669.    * RC: -
  2670.  
  2671.    * result: -
  2672.  
  2673. OPEN_COPPWINDOW '@REG' | 'Argument'
  2674. ...................................
  2675.  
  2676.    * RC: -
  2677.  
  2678.    * result: -
  2679.  
  2680. OPEN_SOURCEWINDOW '@REG' | 'Argument'
  2681. .....................................
  2682.  
  2683.    * RC: -
  2684.  
  2685.    * result: -
  2686.  
  2687. OPEN_STRUCTWINDOW '@REG' | 'Argument'
  2688. .....................................
  2689.  
  2690.    * RC: -
  2691.  
  2692.    * result: -
  2693.  
  2694. OPEN_BREAKPOINTWINDOW
  2695. .....................
  2696.  
  2697.    * RC: -
  2698.  
  2699.    * result: -
  2700.  
  2701. OPEN_FPUWINDOW
  2702. ..............
  2703.  
  2704.    * RC: -
  2705.  
  2706.    * result: -
  2707.  
  2708. OPEN_SNOOPMEMORYWINDOW
  2709. ......................
  2710.  
  2711.    * RC: -
  2712.  
  2713.    * result: -
  2714.  
  2715. DOMENU 'Menu-String'
  2716. ....................
  2717.  
  2718.    * RC: -
  2719.  
  2720.    * result: -
  2721.  
  2722. SET_BREAKPOINT 'Argument'
  2723. .........................
  2724.  
  2725.    * RC: -
  2726.  
  2727.    * result: 'OK','FALSE'
  2728.  
  2729. CLEAR_ICACHE 'Address,Length'
  2730. .............................
  2731.  
  2732.    * RC: -
  2733.  
  2734.    * result: 'OK'
  2735.  
  2736. CLEAR_ICACHE 'Address,Length'
  2737. .............................
  2738.  
  2739.    * RC: -
  2740.  
  2741.    * result: 'OK'
  2742.  
  2743. GOTO_ADDRESS 'Address'
  2744. ......................
  2745.  
  2746.    * RC: -
  2747.  
  2748.    * result: 'OK','FALSE'
  2749.  
  2750. CLEAR_ADDRESS
  2751. .............
  2752.  
  2753.    * RC: -
  2754.  
  2755.    * result: 'OK','FALSE'
  2756.  
  2757. LINK_REGISTER 'Register'
  2758. ........................
  2759.  
  2760.    * RC: -
  2761.  
  2762.    * result: 'OK','FALSE'
  2763.  
  2764. SET_REGISTER 'Register,Value'
  2765. .............................
  2766.  
  2767.    * RC: -
  2768.  
  2769.    * result: 'OK','FALSE'
  2770.  
  2771. Read_Byte 'Address'
  2772. ...................
  2773.  
  2774.    RC    : 0=Ok    Result: Result-String
  2775.  
  2776. Read_Word 'Address'
  2777. ...................
  2778.  
  2779.    RC    : 0=Ok    Result: Result-String
  2780.  
  2781. Read_Long 'Address'
  2782. ...................
  2783.  
  2784.    RC    : 0=Ok    Result: Result-String
  2785.  
  2786. Write_Byte 'Address,Value'
  2787. ..........................
  2788.  
  2789.    RC    : 0=Ok
  2790.  
  2791. Write_Word 'Address,Value'
  2792. ..........................
  2793.  
  2794.    RC    : 0=Ok
  2795.  
  2796. Write_Long 'Address,Value'
  2797. ..........................
  2798.  
  2799.    RC    : 0=Ok
  2800.  
  2801. ASL_FileRequester_Save
  2802. ......................
  2803.  
  2804.    RC    : 0=Ok    Result: Filepath-String
  2805.  
  2806. ASL_FileRequester_Load
  2807. ......................
  2808.  
  2809.    RC    : 0=Ok    Result: Filepath-String
  2810.  
  2811. IS_ADDRESS_LEGAL 'Address'
  2812. ..........................
  2813.  
  2814.    * RC: -
  2815.  
  2816.    * result: 'OK','FALSE'
  2817.  
  2818. LOAD_BINARY 'Name,Destination,Length'
  2819. .....................................
  2820.  
  2821. SAVE_BINARY 'Name,Source,Length'
  2822. ................................
  2823.  
  2824. Usage of BDebug
  2825. ***************
  2826.  
  2827. How to use BDebug ?
  2828. ===================
  2829.  
  2830. Trouble Shooting
  2831. ----------------
  2832.  
  2833.    First you should be sure that all necessary configurations file have
  2834. been installed because without `Barfly.FD' file you don't see any
  2835. function names in the disassembler window; and without `Barfly.Include'
  2836. the `StructWindow' is unusable.  Are these preconditions fullfilled you
  2837. should analyse the problem and anticipate how the Debugger can be used.
  2838. Because the debugging of programs depends heavily on the situation i
  2839. can only list some general points.  The reality probably looks
  2840. different... as always:-)
  2841.  
  2842.    Point of departure:
  2843.  
  2844.    * Program from the CLI
  2845.  
  2846.         * 1 Task
  2847.  
  2848.           The program can be started by `bdebug Program [Argument]' or
  2849.           can be loaded the command window `Debug File'.  By this
  2850.           method all symbol and debug files are loaded.  If the
  2851.           Debugger can't find a source file you can add additional
  2852.           paths if you haven't disabled this function.  The standard
  2853.           breakpoint is the first command in the program.  Sometimes
  2854.           this is inconvenient, and you may want to set a different
  2855.           start breakpoint for example to jump over the CStartup code
  2856.           or to set it tn an important program position.
  2857.  
  2858.         * Creates further Tasks
  2859.  
  2860.           In this case you should be sure how you want to catch the next
  2861.           Task. You could catch the Task by `Next Task' or compile the
  2862.           program with an `illegal' in the task and catch it with
  2863.           `Crashed Task'.  After you caught the task you probably would
  2864.           like to use see symbols and debug source.  These informations
  2865.           can be loaded afterwards by using `Load Symbols'.
  2866.  
  2867.    * Program from the WB
  2868.  
  2869.      In this case you should use `Next Task' and then catch the task
  2870.      `WBL'. Afterwards you have to activate `Next Task' again and run
  2871.      `WBL'. You could also use the `illegal' strategy.  After the right
  2872.      task was caught you can load the symbols again.
  2873.  
  2874.    * Is it a Handler, Filesystem or something similar.
  2875.  
  2876.      In this case you should use the `illegal' strategy and catch the
  2877.      task by `Crashed Task'.  An alternative method would be to catch
  2878.      the waiting task with `Debug Task' and wait as long as the task
  2879.      gets woken up by a signal.
  2880.  
  2881.    After you've taken the first hurdles in taking control over the task,
  2882. you should think about how the problem looks like and where it could be
  2883. located.
  2884.  
  2885.    Problem Type:
  2886.  
  2887.    * Enforcer/CyberGuard
  2888.  
  2889.      If an Enforcer or CyberGuard hit is caused, these programs output
  2890.      the hit's program address and most of the time the hunk offset as
  2891.      well.  You can now directly jump to the address by entering the
  2892.      address in the DissWindow by `Change Address' or you open a
  2893.      HunkWindow, doubleclick on the hunk where the hit is located and
  2894.      then enter the offset returned by Enforcer or CyberGuard.  The
  2895.      Debugger itself can also automaticlly stop a debugged program if a
  2896.      hit happens.
  2897.  
  2898.    * Mungwall
  2899.  
  2900.      These hits aren't as easy to find as Enforcer or CyberGuard hits
  2901.      because Mungwall hits aren't shown when the problem happened but
  2902.      only after a `FreeMem'.  In this case you should remember the
  2903.      memoryblock where it happened and determine where the responsible
  2904.      AllocMem is located in the program, so you get an overview in what
  2905.      area the problem is caused.  Now you should open a MemWindow that
  2906.      points to this certain memory area and step through the program
  2907.      and look if something changes the mungwall borders in the
  2908.      MemWindow.  Mungwall borders are before and after the allocated
  2909.      memory area.  If you're more experienced you could also use the
  2910.      WatchpointWindow and set a watchpoint on the certain memory block.
  2911.  
  2912.    * Crash
  2913.  
  2914.      If it's just an ordinary crash the error should be pretty easy to
  2915.      find by single stepping through the responsible code area.  If
  2916.      it's a random crash you should try `Crashed Task' and hope that
  2917.      the task can be caught.  After the task got caught you should
  2918.      check the instructions that caused the crash. If the PC points to
  2919.      data fields that don't look like real code the PC is probably set
  2920.      wrong by a stack cleanup error.  In this case you should check if
  2921.      the next addresses on the stack point to legal program code.
  2922.  
  2923.    * Side effects and mysterious bugs
  2924.  
  2925.      These bugs are the worst to find and there's no general strategy
  2926.      how to find them. In such cases only intuition and patience can
  2927.      help.
  2928.  
  2929. Problems that can happen
  2930. ------------------------
  2931.  
  2932.    * Why does the Debugger react so slow on keyboard commands that
  2933.      control the tracing ?
  2934.  
  2935.      This happens if you debug a task with a higher priority than the
  2936.      Debugger's priority.  For example. DOS-Handler.  Workaround is to
  2937.      increase the priority of the Debugger.
  2938.  
  2939.    * Why do filerequesters block the Debugger.
  2940.  
  2941.      This happens when you debug a handler, because the filerequester
  2942.      normally tests every handler with a IsFilesystem(). When you debug
  2943.      a handler it can't reply the IsFilesystem packet and therefore the
  2944.      filerequester is busy.
  2945.  
  2946.    * If you debug the following program on a 68040 with 68040.library
  2947.      or 68060.library the instruction `rts' is run if you cause a
  2948.      Single-Step on the instruction `fetox'.  Because this command
  2949.      isn't implemented in the 68040 and 68060 it has to be emulated. It
  2950.      seems to forget the tracebit.
  2951.  
  2952.               mc68040
  2953.               fmove.x    #1.3,fp0
  2954.               fmove.x    #255,fp1
  2955.               fetox.x    fp0,fp1
  2956.               rts
  2957.  
  2958.    * If a program doesn't return from a DOS function, check whether you
  2959.      accidently entered a char in shell window.
  2960.  
  2961.                                BAsm 1.0
  2962.  
  2963.                     A cli/arexx controled Assembler
  2964.  
  2965.                   Copyright (c) 1989-98 Ralph Schmidt
  2966.  
  2967.                              - Shareware -
  2968.  
  2969. The Assembler
  2970. *************
  2971.  
  2972.    The assembler understands the commands and addressmodes from the
  2973. 68000 through the 68060 and both the Floating-Point Units, 68881 and
  2974. 68882.  It supports only the 68851 MMU commands, which are also
  2975. supported by the 68030.  Since the new V2.0 it also supports from
  2976. PPC601 to PPC620.  The assembler achieves it's speed by translating the
  2977. source in a single pass, followed by a backpatch phase which corrects
  2978. all unresolved references.
  2979.  
  2980. Syntax
  2981. ======
  2982.  
  2983. Comments
  2984. --------
  2985.  
  2986.    A comment can start in several different ways.  In a pure comment it
  2987. starts either with a ; or *.  A comment can only be started after an
  2988. assembler command or symbol with a ; if an assembler command or symbol
  2989. exists within that line.
  2990.  
  2991.          ;A comment
  2992.      *A comment
  2993.          move.l a0,a0    ;A comment
  2994.  
  2995. Opcode/Instructions arrangement
  2996. -------------------------------
  2997.  
  2998.    `[label[:]] [opcode] [operand[, operand[, operand...]]]]]'
  2999.  
  3000.    * Opcodes
  3001.  
  3002.      An Opcode can be a Motorola Mnemonic, an assembler command, or a
  3003.      Macro call.
  3004.  
  3005.    * Operations
  3006.  
  3007.      In a Motorola mnemonic operands are based on legal addressmoes; in
  3008.      assembler privat instructions the parameters depend on the
  3009.      instruction.
  3010.  
  3011. Symbol structure
  3012. ----------------
  3013.  
  3014.    A symbol can represent the following types:
  3015.  
  3016.    * Value
  3017.  
  3018.    * Program Counter
  3019.  
  3020.    * Register
  3021.  
  3022.    * Register List
  3023.  
  3024.    * Macro
  3025.  
  3026.    Symbols can only be defined once. The exceptions are local labels
  3027. and symbols defined by Set.
  3028.  
  3029.                      Structure rules for Symbols.
  3030.  
  3031.    * The first letter of a symbol can be one of the following: a...z,
  3032.      A...Z,_, @,. and \.
  3033.  
  3034.    * From the second letter on, the symbol can contain the following
  3035.      letters: a...z, A...Z, 0...9, _,@ and ..
  3036.  
  3037.    * If a symbol consists of only numbers and ends with $, then it is a
  3038.      numerical local label.
  3039.  
  3040.    * A symbol is ended by an illegal letter.
  3041.  
  3042.    * If a symbol begins with a . or \, then it is a local label.
  3043.  
  3044.    * A macro symbol should not contain a ..
  3045.  
  3046.    * To avoid a conflict, a symbol should not end with .b, .w or .l.
  3047.  
  3048.  
  3049.      ThisIsALabel              ;That is a normal label
  3050.      ThisIsALabel1.loop:       ;That is a normal label
  3051.      This@_Is_@A_@Label
  3052.      1$:                       ;That is a numerical local label
  3053.      .ThisIsALabel             ;That is a local label
  3054.      .ThisIsALael1:            ;That is a local label
  3055.      \ThisIsALabel.loop:       ;That is a local label
  3056.      ThisIsASymbol=10
  3057.      ThisIsASymbol = 10
  3058.      ThisIsASymbol equ 10
  3059.  
  3060. The relative label
  3061. ------------------
  3062.  
  3063.    This symbol represents an offset to the start of a program.
  3064.  
  3065.  
  3066.      label
  3067.      label:
  3068.      label    nop
  3069.      label: nop
  3070.  
  3071. The local Label
  3072. ---------------
  3073.  
  3074.    A local label is only valid between two normal relative labels, thus
  3075. you cannot reference local labels outside of that scope.  Otherwise it
  3076. works similar as a normal label.  There are 2 different prefixes that
  3077. introduce a local label: . and \ that define 2 different local labels.
  3078. A special case is the Backward Reference Label that is introduced with
  3079. ... It doesn't depend on a certain define area between normal labels
  3080. thus you can only access the symbol if it were defined earlier.
  3081.  
  3082.  
  3083.      ..:
  3084.      label_0:
  3085.      .local:
  3086.       bra.s .local
  3087.      label_1:
  3088.      .local:
  3089.       bra.s \local
  3090.      \local:
  3091.       nop
  3092.      label_end:
  3093.      ..:
  3094.       dbra d0,..
  3095.      ..:
  3096.       dbra d1,..
  3097.      ..Hello:
  3098.       dbra d1,..Hello
  3099.  
  3100. The local numerical label
  3101. -------------------------
  3102.  
  3103.    Addionally to the non-numerical local label there are also the
  3104. numerical labels which are based of 4 digits with the postfix $.  BASM
  3105. handles the number as a hash key with the consequence that there's no
  3106. difference between 001$ and 1$.
  3107.  
  3108.  
  3109.  
  3110.      label_0:
  3111.      123$:    nop
  3112.      label_1:
  3113.      123$:    nop
  3114.  
  3115. The absolute Symbol
  3116. -------------------
  3117.  
  3118.    The absolute symbol is defined by a direct value initializing that
  3119. is initiated by =, equ or set.  If you define a symbol by set you can
  3120. change it as often as needed.
  3121.  
  3122.  
  3123.  
  3124.      value1=2
  3125.      value2 equ value1*2
  3126.      value3 set value2
  3127.  
  3128. The 68k Register Symbol
  3129. -----------------------
  3130.  
  3131.    The register symbol is defined by `equr' or `fequr' that is used for
  3132. FPU registers.
  3133.  
  3134.  
  3135.  
  3136.      Ptr    equr    a1
  3137.      PI    fequr    fp2
  3138.       move.l   (Ptr),d0   ;move.l  (a1),d0
  3139.       fmove.x  PI,fp0     ;fmove.x fp2,fp0
  3140.  
  3141. The PPC Register Symbol
  3142. -----------------------
  3143.  
  3144.    The register symbol is defined by `equrp' or `fequrp' that is used
  3145. for FPU registers.
  3146.  
  3147.  
  3148.  
  3149.      Ptr    equrp    3
  3150.      PI    fequrp    4
  3151.          lwz    0,0(Ptr)
  3152.          fadd    0,4,PI
  3153.  
  3154. The 68k Register List Symbol
  3155. ----------------------------
  3156.  
  3157.    The register list symbol is defined by `reg' and represents the
  3158. register mask for `Movem' and `fmovem'.  You must not mix FPU and
  3159. Integer registers with each other in a register list.
  3160.  
  3161.  
  3162.      mask    reg    d0/d2/d4-d7/a0-a4/a6-a7
  3163.      mask1    reg    d0-a6
  3164.      mask2    reg    d0-6
  3165.      fmask    reg    fp0-fp2/fp4-fp5
  3166.  
  3167. The Macro Symbol
  3168. ----------------
  3169.  
  3170.    By using the command `macro' or `cmacro' after the symbol, the
  3171. symbol is defined as a macro.  The macro block is terminated by the
  3172. command endm.  The Macro cmacro is case-insensitive and therefore
  3173. useful to emulate commands that are missing from the core.
  3174.  
  3175.  
  3176.  
  3177.  
  3178.      Symbol[:] macro
  3179.      .
  3180.      .
  3181.      Symbol[:] endm
  3182.  
  3183. Datatypes
  3184. ---------
  3185.  
  3186.    The assembler understands 3 distinct datatypes.
  3187.  
  3188.    * 32Bit Integer
  3189.  
  3190.    * 96Bit Extended Floating Point
  3191.  
  3192.    * 96Bit Packed Binary Floating Point
  3193.  
  3194.    At the moment only integer datatypes are supported in arithmetic
  3195. arguments so you can only use the FPU datatypes as constants.
  3196.  
  3197.      +-------------+--------------------+
  3198.      | Format      | Representation     |
  3199.      +-------------+--------------------+
  3200.      +-------------+--------------------+
  3201.      | Decimal     | 1024               |
  3202.      +-------------+--------------------+
  3203.      | Hexadecimal | $400               |
  3204.      +-------------+--------------------+
  3205.      | Binary      | %10000000000       |
  3206.      +-------------+--------------------+
  3207.      | Ascii       | "OK", 'OK' or `OK` |
  3208.      +-------------+--------------------+
  3209.  
  3210.    Furthermore you can use symbols or the character `*' that represents
  3211. the program counter in arguments.  There are limitation in the use of
  3212. symbols in arguments.  For example you can only add or subtract
  3213. constants from an external label, Floatingpoint Values can only be used
  3214. as simple constants,...  By the postfix `k' after decimal value the
  3215. value is multply by $1000.
  3216.  
  3217.                         `Floating Point Format'
  3218.  
  3219.      +-------------+-------------------------------------+
  3220.      | Format      | Representation                      |
  3221.      +-------------+-------------------------------------+
  3222.      +-------------+-------------------------------------+
  3223.      | Extended    | '[+,-]3. 145637848298628[e[+,-]123] |
  3224.      +-------------+-------------------------------------+
  3225.      | Packed      | ''[+,-]3. 145637848298628[e[+,-]123]|
  3226.      +-------------+-------------------------------------+
  3227.  
  3228. Datatype Conversion
  3229. -------------------
  3230.  
  3231.    All commands are performed with these 3 datatypes and then converted
  3232. into the required datatype.  For example a 32Bit integer can be
  3233. converted into 16Bit and 8 Bit; an extended floating point into a
  3234. double or single floating point.  Floating point datatypes are rounded
  3235. by a convertation.  If a rouding error occurs the parser returns with
  3236. an error.
  3237.  
  3238. Datatype Format
  3239. ---------------
  3240.  
  3241.                       Internal Datatype Structure
  3242.  
  3243.    * Integer
  3244.  
  3245.      +--------+---------+
  3246.      | Bit 31 | 30..0   |
  3247.      +--------+---------+
  3248.      +--------+---------+
  3249.      |    S   | Integer |
  3250.      +--------+---------+
  3251.  
  3252.    * Single Floating Point
  3253.  
  3254.      +--------+-----------------+------------+
  3255.      | Bit 31 | Bits 30..23     | Bits 22..0 |
  3256.      +--------+-----------------+------------+
  3257.      +--------+-----------------+------------+
  3258.      |  Sign  | Biased Exponent |  Fraction  |
  3259.      +--------+-----------------+------------+
  3260.  
  3261.    * Double Floating Point
  3262.  
  3263.      +--------+-----------------+------------+
  3264.      | Bit 63 | Bits 62..52     | Bits 51..0 |
  3265.      +--------+-----------------+------------+
  3266.      +--------+-----------------+------------+
  3267.      |  Sign  | Biased Exponent |  Fraction  |
  3268.      +--------+-----------------+------------+
  3269.  
  3270.    * Extended Floating Point
  3271.  
  3272.      +--------+-----------------+------------+
  3273.      | Bit 95 | Bits 94..80     | Bits 62..0 |
  3274.      +--------+-----------------+------------+
  3275.      +--------+-----------------+------------+
  3276.      |  Sign  | Biased Exponent |  Mantisse  |
  3277.      +--------+-----------------+------------+
  3278.  
  3279.    * Packed Binary Floating Point
  3280.  
  3281.      +------+------+------+------+------+------+------+------+
  3282.      | MEYY | EXP2 | EXP1 | EXP0 | EXP3 | 0000 | 0000 | M016 |
  3283.      +------+------+------+------+------+------+------+------+
  3284.      | M015 | M014 | M013 | M012 | M011 | M010 | M009 | M008 |
  3285.      +------+------+------+------+------+------+------+------+
  3286.      | M007 | M006 | M005 | M004 | M003 | M002 | M001 | M000 |
  3287.      +------+------+------+------+------+------+------+------+
  3288.  
  3289.    * M is the sign (+ or -) of the fraction
  3290.  
  3291.    * E is the sign (+ or -) of the exponent
  3292.  
  3293.    * Y are the internal flags for infinity and NAN
  3294.  
  3295.    * E002-000 are the numbers of the exponent from 2 to 0, EXP3 is used
  3296.      internally.
  3297.  
  3298.    * M016-000 are the numbers of the fraction from 16 to 0. Each number
  3299.      lies in the range from 0 to 9..
  3300.  
  3301. Operations
  3302. ----------
  3303.  
  3304. Operators
  3305. ---------
  3306.  
  3307.      +----------+-------------------------------+
  3308.      | Operator | Function                      |
  3309.      +----------+-------------------------------+
  3310.      +----------+-------------------------------+
  3311.      |   `+'    | 32Bit signed Addition         |
  3312.      +----------+-------------------------------+
  3313.      |   `-'    | 32Bit signed Subtraction      |
  3314.      +----------+-------------------------------+
  3315.      |   `*'    | 32Bit signed Multiplication   |
  3316.      +----------+-------------------------------+
  3317.      |   `/'    | 32Bit signed Division         |
  3318.      +----------+-------------------------------+
  3319.      |   '|'    | 32Bit Or                      |
  3320.      +----------+-------------------------------+
  3321.      |   `!'    | 32Bit Or                      |
  3322.      +----------+-------------------------------+
  3323.      |   `&'    | 32Bit And                     |
  3324.      +----------+-------------------------------+
  3325.      |   `^'    | 32Bit Eor                     |
  3326.      +----------+-------------------------------+
  3327.      |   `<<'   | logic 32Bit Shift to the left |
  3328.      +----------+-------------------------------+
  3329.      |   `>>'   | logic 32Bit Shift to the right|
  3330.      +----------+-------------------------------+
  3331.      |   `~'    | 32Bit Not                     |
  3332.      +----------+-------------------------------+
  3333.  
  3334.      Basm cares for the operator priorities but be careful while
  3335.      porting Seka Sources because Seka doesn't care for the priorities.
  3336.  
  3337. Functions
  3338. ---------
  3339.  
  3340.    The following functions are supported.
  3341.  
  3342.    * _bitnum(Argument) calculates the bit number of the argument. If
  3343.      this is impossible an error occurs.
  3344.  
  3345.    * _bitfield(Argument) calculates the bit mask of the argument. If
  3346.      this is impossible an error occurs.
  3347.  
  3348.    * _extb(Argument) equal to the 680xx command extb
  3349.  
  3350.    * _extw(Argument) equal to the 680xx command extw
  3351.  
  3352.    * _min(Argument[,Argument,...]) calculate the minimum of the
  3353.      argument.
  3354.  
  3355.    * _max(Argument[,Argument,...]) calculate the maximum of the
  3356.      argument.
  3357.  
  3358. PPC Elf Reloc Types
  3359. -------------------
  3360.  
  3361.        addis    3,0,a@ha ;@ha means the UPPER word of the symbol value
  3362. a is written there ;the loader/linker also deals with the sign problem
  3363. if the LOWER ;word is negative.      addi    3,3,a@l ;@l means the UPPER word
  3364. of the symbol value a is written there
  3365.  
  3366. Assembler Commands
  3367. ==================
  3368.  
  3369. Hunk/Link Commands
  3370. ------------------
  3371.  
  3372. [Label] section Name[,Typ[,[RelocModus,Memtyp]
  3373. ..............................................
  3374.  
  3375.    defines a new logical unit so that the DOS-Loader has the
  3376. opportuntity to place smaller hunks into free memory blocks.  Another
  3377. use for this command is to set different memory types for the hunk to
  3378. load gfx data into the chipmem.  If you don't specify the section type
  3379. it assumes "",Code,Public.
  3380.  
  3381.    * Name = Hunkname
  3382.  
  3383.    * Hunk type
  3384.  
  3385.     `CODE'
  3386.           starts a code segment.
  3387.  
  3388.     `DATA'
  3389.           starts a data segment.
  3390.  
  3391.     `BSS'
  3392.           starts an undefined data segment.
  3393.  
  3394.     `DEBUG'
  3395.           starts a custom debug segment.
  3396.  
  3397.     `CUSTOM'
  3398.           starts a Custom-Hunk area.
  3399.  
  3400.    * Reloc-Mode defines the width of the hunk relocation. Default 32Bit
  3401.  
  3402.     `RELOC16'
  3403.           sets the reloc width to 16bit.(V37)
  3404.  
  3405.     `RELOC32'
  3406.           sets the reloc width to 32bit.(Default)
  3407.  
  3408.    * Memtype defines the memory attributes of the hunk.  If you add a
  3409.      `_p', `_c', or `_f' upon the type parameter, you cannot use more
  3410.      memtypes.The memtype `DEBUG' does not allow memory attribute
  3411.      suffixes.
  3412.  
  3413.     `PUBLIC'
  3414.           loads the hunk into the memory with the highest priority.
  3415.           Code Suffix _p.
  3416.  
  3417.     `CHIP'
  3418.           loads the hunk into chip memory. Code Suffix _c.
  3419.  
  3420.     `FAST'
  3421.           loads the hunk into fast memory. Code Suffix _f.
  3422.  
  3423.     `ADVISORY'
  3424.           ignores the hunk if the OS doesn't understand the type. A
  3425.           kind of Debug-Hunk that can be used by the OS.(V39)
  3426.  
  3427.     `ATTR=?'
  3428.           loads the hunk into the memory with specified memory
  3429.           attributs. (V37)
  3430.  
  3431. [Label] code [Name[, Memtyp]]
  3432. .............................
  3433.  
  3434.    defines a new code hunk and is equivalent to the command `section
  3435. ?,code,?'.
  3436.  
  3437.    * Name = Hunkname
  3438.  
  3439.    * Memtype defines the memory attributes for the hunk.
  3440.  
  3441.     `PUBLIC'
  3442.           loads the hunk into the memory with the highest priority.
  3443.           Code Suffix _p.
  3444.  
  3445.     `CHIP'
  3446.           loads the hunk into chip memory. Code Suffix _c.
  3447.  
  3448.     `FAST'
  3449.           loads the hunk into fast memory. Code Suffix _f.
  3450.  
  3451.     `ADVISORY'
  3452.           ignores the hunk if the OS doesn't understand the type. A
  3453.           kind of Debug-Hunk that can be used by the OS.(V39)
  3454.  
  3455.     `ATTR=?'
  3456.           loads the hunk into the memory with specified memory
  3457.           attributs. (V37)
  3458.  
  3459. [Label] data [Name[, Memtyp]]
  3460. .............................
  3461.  
  3462.    defines a new data hunk and is equivalent to the command `section
  3463. ?,data,?'.
  3464.  
  3465.    * Name = Hunkname
  3466.  
  3467.    * Memtype defines the memory attributes for the hunk.
  3468.  
  3469.     `PUBLIC'
  3470.           loads the hunk into the memory with the highest priority.
  3471.           Code Suffix _p.
  3472.  
  3473.     `CHIP'
  3474.           loads the hunk into chip memory. Code Suffix _c.
  3475.  
  3476.     `FAST'
  3477.           loads the hunk into fast memory. Code Suffix _f.
  3478.  
  3479.     `ADVISORY'
  3480.           ignores the hunk if the OS doesn't understand the type. A
  3481.           kind of Debug-Hunk that can be used by the OS.(V39)
  3482.  
  3483.     `ATTR=?'
  3484.           loads the hunk into the memory with specified memory
  3485.           attributs. (V37)
  3486.  
  3487. [Label] bss [Name[, Memtyp]]
  3488. ............................
  3489.  
  3490.    defines a new BSS hunk and is equivalent to the command `section
  3491. ?,bss,?'.
  3492.  
  3493.    * Name = Hunkname
  3494.  
  3495.    * Memtype defines the memory attributes for the hunk.
  3496.  
  3497.     `PUBLIC'
  3498.           loads the hunk into the memory with the highest priority.
  3499.           Code Suffix _p.
  3500.  
  3501.     `CHIP'
  3502.           loads the hunk into chip memory. Code Suffix _c.
  3503.  
  3504.     `FAST'
  3505.           loads the hunk into fast memory. Code Suffix _f.
  3506.  
  3507.     `ADVISORY'
  3508.           ignores the hunk if the OS doesn't understand the type. A
  3509.           kind of Debug-Hunk that can be used by the OS.(V39)
  3510.  
  3511.     `ATTR=?'
  3512.           loads the hunk into the memory with specified memory
  3513.           attributs. (V37)
  3514.  
  3515. [Label] cseg [Name[, Memtyp]]
  3516. .............................
  3517.  
  3518.    has the same function as the command `code'.
  3519.  
  3520. [Label] dseg [Name[, Memtyp]]
  3521. .............................
  3522.  
  3523.    has the same function as the command `data'.
  3524.  
  3525. idnt Name
  3526. .........
  3527.  
  3528.    defines the name of the `HUNK_UNIT' hunk in the object file.
  3529.  
  3530.    * Name = Hunkname
  3531.  
  3532. identify Name
  3533. .............
  3534.  
  3535.    defines the name of the actual hunk.
  3536.  
  3537.    * Name = Hunkname
  3538.  
  3539. BDebugArg Argument
  3540. ..................
  3541.  
  3542.    defines a parameter in env:BDebugProgram. It doesn't active this
  3543. function you have to activate by option "-J" in *Note BOPT: MI_BOPT.
  3544.  
  3545.    * Argument = Argument Text
  3546.  
  3547. smalldata [Register]
  3548. ....................
  3549.  
  3550.    activates smalldata mode for the hunk.  Optionally, you can also
  3551. define the smalldata register.  Default register is `A4'.  The program
  3552. itself must initialize the smalldata register with the address of the
  3553. smalldata data hunk.
  3554.  
  3555.  
  3556.  
  3557.       bopt    w2-            ;68020 addressmode warnings off
  3558.       mc68020            ;68020 mode activated
  3559.      
  3560.       smalldata    a3        ;Default is A4!!!
  3561.       xref    _LinkerDB        ;Special linker symbol
  3562.      
  3563.       lea.l    _LinkerDB,a3        ;Address of the smalldata data segments
  3564.       move.l    #0,(d_test.l,a3)
  3565.       move.l    #"TEST",d_test(a3)
  3566.       moveq    #0,d0
  3567.       tst.b    array(a3,d0.w)
  3568.       rts
  3569.      
  3570.       section    "__MERGED",BSS    ;The smalldata data segments are defined
  3571.                                      ;the following way
  3572.      d_test:
  3573.       ds.l    1
  3574.      array:
  3575.       ds.b    20
  3576.  
  3577. xref Symbol[, Symbol...]
  3578. ........................
  3579.  
  3580.    imports a symbol so that you can access symbols that were exported
  3581. by XDef.  The linker resolves these reference during the link process
  3582. and creates a program file.  If the assembler finds a XRef in the source
  3583. it creates an object file. This decision can be overruled.
  3584.  
  3585.    * Symbol = Name of the importet symbol.
  3586.  
  3587. xdef Symbol[, Symbol...]
  3588. ........................
  3589.  
  3590.    exports a symbol as global so that other object files can import the
  3591. symbol by XRef.  There's no need to define a symbol before you mark them
  3592. with XDef. If the assembler finds a XRef in the source it creates an
  3593. object file. This decision can be overruled.
  3594.  
  3595.    * Symbol = Name of the global symbol
  3596.  
  3597. global Symbol[, Symbol...]
  3598. ..........................
  3599.  
  3600.    has the same function like XDef.
  3601.  
  3602. public Symbol[, Symbol...]
  3603. ..........................
  3604.  
  3605.    has the same function like XDef.
  3606.  
  3607. .type Symbol, Type
  3608. ..................
  3609.  
  3610.    defines the type of a symbol. You need to define XDef functions as
  3611. @function if you want to link against it.  This is an ELF format option.
  3612.  
  3613.    * Symbol = Name of the Symbol
  3614.  
  3615.    * Type defines the type of the symbol.
  3616.  
  3617.     `@FUNCTION'
  3618.           defines the symbol as a function symbol.
  3619.  
  3620.     `@OBJECT'
  3621.           defines the symbol as a data object.
  3622.  
  3623. .size Symbol, Size
  3624. ..................
  3625.  
  3626.    defines the size of a symbol. This way it`s easy to define how long
  3627. a function is for example.  This is an ELF format option.
  3628.  
  3629.    * Symbol = Name of the Symbol
  3630.  
  3631.    * Size defines the size of the symbol.
  3632.  
  3633. output Name
  3634. ...........
  3635.  
  3636.    sets an output filename.  If you don't specify a filename the
  3637. assembler uses the source filename and adds the appropriate filetype
  3638. suffix.
  3639.  
  3640.    * Name = Filename
  3641.  
  3642. objfile
  3643. .......
  3644.  
  3645.    has the same function like Output.
  3646.  
  3647. exeobj
  3648. ......
  3649.  
  3650.    writes a program file if you want to overrule the assembler.
  3651.  
  3652. linkobj
  3653. .......
  3654.  
  3655.    writes an object file if you want to overrule the assembler.
  3656.  
  3657. org Address
  3658. ...........
  3659.  
  3660.    activates absolute mode.  All command that refer to hunk related
  3661. functions aren't allowed.  For example:. section, xdef, xref.  The
  3662. parameter address sets the base address of the created code.
  3663.  
  3664.    * Address = Absolute Address
  3665.  
  3666. addsym
  3667. ......
  3668.  
  3669.    writes a symbol hunk.
  3670.  
  3671. debug
  3672. .....
  3673.  
  3674.    writes a SAS D1 debug hunk to see  source level informations while
  3675. debugging the program through bdebug.
  3676.  
  3677. Symbol Commands
  3678. ---------------
  3679.  
  3680. CArgs [#Offset,]Symbol[,Symbol.w[,Symbol.l]
  3681. ...........................................
  3682.  
  3683.    defines the symbol offsets for a stack function. The first Symbol
  3684. starts with the offset 4 but if you like to use a different Offset it's
  3685. possible to specify one.  Then the offset is increased according to the
  3686. size of the symbol. If the symbol has no size specifier the default size
  3687. is word. Sorry..i would use a longword here but to be compatible with
  3688. Devpac i'm forced to use word.
  3689.  
  3690.       cargs Test1.w,Test2.l
  3691.       move.w    Test1(a7),d0    ;Test1=4
  3692.       move.l    Test2(a7),d0    ;Test2=4+2=6
  3693.  
  3694. Symbol rs[.width] Count
  3695. .......................
  3696.  
  3697.    initializes the Symbol with the value of the counter __RS and
  3698. increases the __RS counter afterwards by Count*Width.  You can use this
  3699. command as a replacement for the include exec/types.i macros to
  3700. increase the parsing speed.
  3701.  
  3702.    * Width
  3703.  
  3704.     `B'
  3705.           1 Byte Valuearea: -$80 <= x < $100
  3706.  
  3707.     `W'
  3708.           2 Bytes Valuearea: -$8000 <= x < $10000
  3709.  
  3710.     `L'
  3711.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3712.  
  3713.     `S'
  3714.           4 Bytes (Single IEEE-Float)
  3715.  
  3716.     `D'
  3717.           8 Bytes (Double IEEE-Float)
  3718.  
  3719.     `X'
  3720.           12 Bytes (Extended IEEE-Float)
  3721.  
  3722.     `P'
  3723.           12 Bytes (Packed BCD-Float)
  3724.  
  3725.     `Q'
  3726.           16 Bytes (Quadword)
  3727.  
  3728. Symbol so[.width] Count
  3729. .......................
  3730.  
  3731.    This command has the same function like rs with the exception that
  3732. the Symbol __SO is used instead of the __RS symbol.  Internally both
  3733. symbols are handled equal.  Devpac has introduced the symbol __RS and
  3734. Macro68k knows the functionality by the name __SO.
  3735.  
  3736. Symbol fo[.width] Count
  3737. .......................
  3738.  
  3739.    decreases the counter __FO by Count*Width and initializes the Symbol
  3740. with the new value.  Useful to create the negative local stackframe
  3741. symbols needed by link.
  3742.  
  3743.    * Width
  3744.  
  3745.     `B'
  3746.           1 Byte Valuearea: -$80 <= x < $100
  3747.  
  3748.     `W'
  3749.           2 Bytes Valuearea: -$8000 <= x < $10000
  3750.  
  3751.     `L'
  3752.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3753.  
  3754.     `S'
  3755.           4 Bytes (Single IEEE-Float)
  3756.  
  3757.     `D'
  3758.           8 Bytes (Double IEEE-Float)
  3759.  
  3760.     `X'
  3761.           12 Bytes (Extended IEEE-Float)
  3762.  
  3763.     `P'
  3764.           12 Bytes (Packed BCD-Float)
  3765.  
  3766.     `Q'
  3767.           16 Bytes (Quadword)
  3768.  
  3769. rsreset
  3770. .......
  3771.  
  3772.    initializes the counter __RS to 0.
  3773.  
  3774. rsset Value
  3775. ...........
  3776.  
  3777.    initializes the counter __RS with the Value
  3778.  
  3779.    * Value = New Index
  3780.  
  3781. clrso
  3782. .....
  3783.  
  3784.    has the same function like rsreset
  3785.  
  3786. clrfo
  3787. .....
  3788.  
  3789.    has the same function like foreset.
  3790.  
  3791. setso Value
  3792. ...........
  3793.  
  3794.    has the same function like rsset
  3795.  
  3796. setrs Value
  3797. ...........
  3798.  
  3799.    has the same function like rsset
  3800.  
  3801. setfo Value
  3802. ...........
  3803.  
  3804.    initializes the counter __FO with the Value
  3805.  
  3806.    * Value = New Index
  3807.  
  3808. Symbol rsval
  3809. ............
  3810.  
  3811.    initializes the Symbol with the value of the __RS counter.
  3812.  
  3813. Symbol soval
  3814. ............
  3815.  
  3816.    has the same function like rsval.
  3817.  
  3818. Symbol foval
  3819. ............
  3820.  
  3821.    initializes the Symbol with the value of the __FO counter.
  3822.  
  3823. Data Commands
  3824. -------------
  3825.  
  3826. align Value
  3827. ...........
  3828.  
  3829.    aligns the program counter to an address that can be devided by the
  3830. value.  Useful because certain DOS structures have to be aligned on 4
  3831. Byte boundaries. For example FileInfoBlock.  Furthermore it's also
  3832. useful to align subroutines on longword boundaries that they fit better
  3833. into the cache structure.
  3834.  
  3835.    * Value = Align Mask
  3836.  
  3837. cnop Offset,Align
  3838. .................
  3839.  
  3840.    aligns the program counter to an address that can be devided by the
  3841. Align value and adds the value onto the address.  Internally only Align
  3842. values < 16 are supported.
  3843.  
  3844. pad.Width Align[,Value]
  3845. .......................
  3846.  
  3847.    aligns the program counter to an address that can be devided by the
  3848. Align*Width and fills the aligned area by the optional mask value.
  3849.  
  3850. quad
  3851. ....
  3852.  
  3853.    aligns the program counter to a 16 Byte address.
  3854.  
  3855. even
  3856. ....
  3857.  
  3858.    aligns the program counter to an even address.  This function is
  3859. useful if you define an odd sized data area and you need a word aligned
  3860. for OS data structures or assembler instructions.
  3861.  
  3862. odd
  3863. ...
  3864.  
  3865.    aligns the program counter to an odd address.
  3866.  
  3867. dc[.width] Value[,Value...]
  3868. ...........................
  3869.  
  3870.    inserts data of the Width into the code.
  3871.  
  3872.    * Width
  3873.  
  3874.     `B'
  3875.           1 Byte Valuearea: -$80 <= x < $100
  3876.  
  3877.     `W'
  3878.           2 Bytes Valuearea: -$8000 <= x < $10000
  3879.  
  3880.     `L'
  3881.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3882.  
  3883.     `S'
  3884.           4 Bytes (Single IEEE-Float)
  3885.  
  3886.     `D'
  3887.           8 Bytes (Double IEEE-Float)
  3888.  
  3889.     `X'
  3890.           12 Bytes (Extended IEEE-Float)
  3891.  
  3892.     `P'
  3893.           12 Bytes (Packed BCD-Float)
  3894.  
  3895. db Value[,Value,...]
  3896. ....................
  3897.  
  3898.    inserts a byte with a value in the valuearea -$80 <= x < $100.
  3899.  
  3900. dw Value[,Value,...]
  3901. ....................
  3902.  
  3903.    inserts a word with a value in the valuearea -$8000 <= x < $10000.
  3904.  
  3905. dl Value[,Value,...]
  3906. ....................
  3907.  
  3908.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3909. $100000000.
  3910.  
  3911. ub Value[,Value,...]
  3912. ....................
  3913.  
  3914.    inserts a byte with a value in the valuearea -$80 <= x < $80.
  3915.  
  3916. uw Value[,Value,...]
  3917. ....................
  3918.  
  3919.    inserts a word with a value in the valuearea -$8000 <= x < $8000.
  3920.  
  3921. ul Value[,Value,...]
  3922. ....................
  3923.  
  3924.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3925. $80000000.
  3926.  
  3927. sb Value[,Value,...]
  3928. ....................
  3929.  
  3930.    inserts a byte with a value in the valuearea -$80 <= x < $100.
  3931.  
  3932. sw Value[,Value,...]
  3933. ....................
  3934.  
  3935.    inserts a word with a value in the valuearea -$8000 <= x < $10000.
  3936.  
  3937. sl Value[,Value,...]
  3938. ....................
  3939.  
  3940.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3941. $100000000.
  3942.  
  3943. pb Value[,Value,...]
  3944. ....................
  3945.  
  3946.    inserts a byte with a value in the valuearea 0 <= x < $80.
  3947.  
  3948. pw Value[,Value,...]
  3949. ....................
  3950.  
  3951.    inserts a word with a value in the valuearea 0 <= x < $8000.
  3952.  
  3953. pl Value[,Value,...]
  3954. ....................
  3955.  
  3956.    inserts a longword with a value in the valuearea 0 <= x < $80000000.
  3957.  
  3958. nb Value[,Value,...]
  3959. ....................
  3960.  
  3961.    inserts a byte with a value in the valuearea -$80 <= x < 0.
  3962.  
  3963. nw Value[,Value,...]
  3964. ....................
  3965.  
  3966.    inserts a word with a value in the valuearea -$8000 <= x < 0.
  3967.  
  3968. nl Value[,Value,...]
  3969. ....................
  3970.  
  3971.    inserts a longword with a value in the valuearea -$80000000 <= x < 0.
  3972.  
  3973. ds[.width] Count[,Value]
  3974. ........................
  3975.  
  3976.    defines a memory area with the length Count * Width and fills the
  3977. area with an optional Value.  Default fill value is 0.  Is the Count 0
  3978. a cnop 0,Width is run.
  3979.  
  3980.    * Width
  3981.  
  3982.     `B'
  3983.           1 Byte Valuearea: -$80 <= x < $100
  3984.  
  3985.     `W'
  3986.           2 Bytes Valuearea: -$8000 <= x < $10000
  3987.  
  3988.     `L'
  3989.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3990.  
  3991.     `S'
  3992.           4 Bytes (Single IEEE-Float)
  3993.  
  3994.     `D'
  3995.           8 Bytes (Double IEEE-Float)
  3996.  
  3997.     `X'
  3998.           12 Bytes (Extended IEEE-Float)
  3999.  
  4000.     `P'
  4001.           12 Bytes (Packed BCD-Float)
  4002.  
  4003.    * Count = Length of the memory area.
  4004.  
  4005.    * Value = optional Fill Value.
  4006.  
  4007. dsb[.width] Count[,Value]
  4008. .........................
  4009.  
  4010.    has the same function like ds
  4011.  
  4012. dsb[.width] Count[,Value]
  4013. .........................
  4014.  
  4015.    has the same function like ds
  4016.  
  4017. blk[.width] Count[,Value...]
  4018. ............................
  4019.  
  4020.    has the same function like ds
  4021.  
  4022. ascii String1[,String2,...]
  4023. ...........................
  4024.  
  4025.    inserts Strings.
  4026.  
  4027. eascii EOR-Value,String1[,String2,...]
  4028. ......................................
  4029.  
  4030.    inserts eor-encrypted Strings.
  4031.  
  4032. cstring String1[,String2,...]
  4033. .............................
  4034.  
  4035.    inserts C-Strings.
  4036.  
  4037. dstring dtype1,dtype2,dtype3
  4038. ............................
  4039.  
  4040.    inserts the current date string.
  4041.  
  4042.                               Datentypen
  4043.  
  4044.    * "w" WeekDay
  4045.  
  4046.    * "d" Date
  4047.  
  4048.    * "t" Time
  4049.  
  4050.  
  4051.       dc.b    " ("
  4052.       dstring    w,d,t
  4053.       dc.b    ")"
  4054.       dc.b    $a,$d,0
  4055.      ;=> (Thursday 14-Okt-93 15:32:06)
  4056.  
  4057. pstring String[,String,...]
  4058. ...........................
  4059.  
  4060.    inserts a BCPL string.
  4061.  
  4062. istring String[,String,...]
  4063. ...........................
  4064.  
  4065.    inserts strings that terminate with a char that has Bit 7 set.
  4066.  
  4067. bitstream Mask
  4068. ..............
  4069.  
  4070.    inserts a bitmask for an image object for example.  The bits are
  4071. aligned to bytes.
  4072.  
  4073.    * Mask =  Mask is a string that is based only of 0 and 1.
  4074.  
  4075.  
  4076.       bitstream "01001000001"
  4077.  
  4078. sprintx "Formatstring"[,Value[,...]]
  4079. ....................................
  4080.  
  4081.    inserts the resulting string into the code.  The string isn't
  4082. terminated by a 0 so that you can add other strings rather easy.
  4083.  
  4084.    * FormatString - is a string in C-Notation so you can
  4085.            use the known C char types n,t,...
  4086.      The following options are allowed.
  4087.  
  4088.    * FormatSyntax - %[flags][width][.limit][length]type
  4089.  
  4090.         * flags - '-' deactivates left side layout.
  4091.  
  4092.         * width - Field Length. If the first char is '0' the field is
  4093.           filled by '0' on the left side.
  4094.  
  4095.         * limit - defines the maximal count of char that can be inserted
  4096.           from a string. Only legal for %s and %b.
  4097.  
  4098.         * length - The size of the datatype. Default is 16-bit for the
  4099.           typs %d,%u and %x. %l is long (32Bit). Attention! The
  4100.           Assembler always pushes a longword on the stack so always use
  4101.           %l if you don't know what you're doing.
  4102.  
  4103.         * type - The following types are supported.
  4104.  
  4105.           b - BSTR, a 32-bit BPTR Pointer on a bytelength     string.
  4106.             A NULL BPTR is handled like an empty string.  d - signed
  4107.           decimal u - unsigned decimal x - hexadezimal in lower case.
  4108.           X - hexadecimal in upper case.  s - String, a 32-bit Pointer
  4109.           on a     NULL-terminated Byte-String.      A NULL BPTR is
  4110.           handled like an empty string.  c - Char
  4111.  
  4112.    * Value - is an argument that has to be resolvable.
  4113.  
  4114. Listing I/O Commands
  4115. --------------------
  4116.  
  4117. list
  4118. ....
  4119.  
  4120.    activates the listing output. Has no function if the global listing
  4121. output wasn't activated.
  4122.  
  4123.                             Listing Format:
  4124.  
  4125.             LINE ADDRESS[Flag1] COMMAND-BYTES[Flag2] SOURCE
  4126.  
  4127.    * Flag1
  4128.  
  4129.         * + shows that the line was created by a macro.
  4130.  
  4131.         * > shows that the Assembler searches the closing ENDC.
  4132.  
  4133.         * < shows that the Assembler searches the closing ENDM.
  4134.  
  4135.    * Flag2
  4136.  
  4137.         * + shows a line overflow and that Bytes are ignored.  Can
  4138.           often happen during data definitions.
  4139.  
  4140. nolist
  4141. ......
  4142.  
  4143.    deactivates the listing output. Has no function if the global
  4144. listing output wasn't activated.
  4145.  
  4146. printx "Formatstring"[,Value[,...]]
  4147. ...................................
  4148.  
  4149.    outputs the string to the current Stdout and works similar as the
  4150. known C-Printf function. Look at SPRINTF
  4151.  
  4152. errfile Name
  4153. ............
  4154.  
  4155.    defines the filename for the error output.
  4156.  
  4157.    * Name = Filename
  4158.  
  4159. lisfile Name
  4160. ............
  4161.  
  4162.    defines the filename for the listing output.  If no error file was
  4163. defined the error output is also written into the listing file.
  4164.  
  4165.    * Name = Filename
  4166.  
  4167. Structuring
  4168. -----------
  4169.  
  4170. symbol[:] macro
  4171. ...............
  4172.  
  4173.    starts a Macro block.
  4174.  
  4175. endm
  4176. ....
  4177.  
  4178.    ends a macroblock.
  4179.  
  4180. mexit
  4181. .....
  4182.  
  4183.    ends a macro call.
  4184.  
  4185. fail
  4186. ....
  4187.  
  4188.    creates an error.
  4189.  
  4190. end
  4191. ...
  4192.  
  4193.    ends the assembling.
  4194.  
  4195. if Symbol
  4196. .........
  4197.  
  4198.    checks if the symbol value is not NULL and assembles the block
  4199. depending on the success.
  4200.  
  4201. ifd Symbol
  4202. ..........
  4203.  
  4204.    checks if the Symbol exists and assembles the block depending on the
  4205. success.
  4206.  
  4207. ifnd Symbol
  4208. ...........
  4209.  
  4210.    checks if the Symbol doesn't exist and assembles the block depending
  4211. on the success.
  4212.  
  4213. ifv String
  4214. ..........
  4215.  
  4216.    This is a privat command that is used for internal functionality and
  4217. subject to change. Touch an burn!
  4218.  
  4219. ifnv String
  4220. ...........
  4221.  
  4222.    This is a privat command that is used for internal functionality and
  4223. subject to change. Touch an burn!
  4224.  
  4225. ifmacrod Macro
  4226. ..............
  4227.  
  4228.    checks if the Macro exists and assembles the block depending on the
  4229. success.
  4230.  
  4231. ifmacrond Macro
  4232. ...............
  4233.  
  4234.    checks if the Macro doesn't exist and assembles the block depending
  4235. on the success.
  4236.  
  4237. ifcmacrod CMacro
  4238. ................
  4239.  
  4240.    checks if the CMacro exists and assembles the block depending on the
  4241. success.
  4242.  
  4243. ifcmacrond CMacro
  4244. .................
  4245.  
  4246.    checks if the CMacro doesn't exist and assembles the block depending
  4247. on the success.
  4248.  
  4249. ifc Symbol,Symbol
  4250. .................
  4251.  
  4252.    compares the first string with the second string and if they are
  4253. equal the block is assembled.
  4254.  
  4255. ifnc 'String','String'
  4256. ......................
  4257.  
  4258.    compares the first string with the second string and if they differ
  4259. the block is assembled.
  4260.  
  4261. if[condition] Symbol=Symbol
  4262. ...........................
  4263.  
  4264.    compares the first symbol with the second symbol and decides
  4265. according to the condition if the block is assembled.
  4266.  
  4267.    * Condition = Normal Bcc-Condition Syntax
  4268.  
  4269.    * Symbol = Normal Symbol
  4270.  
  4271. else
  4272. ....
  4273.  
  4274.    activates the condition block if the block above wasn't assembled.
  4275.  
  4276. elseif
  4277. ......
  4278.  
  4279.    activates the condition block if the block above wasn't assembled.
  4280.  
  4281. endc
  4282. ....
  4283.  
  4284.    defines the end of a condition block.
  4285.  
  4286. endif
  4287. .....
  4288.  
  4289.    defines the end of a condition block.
  4290.  
  4291. repeat Count
  4292. ............
  4293.  
  4294.    repeats the blocks that is located between repeat and endr by the
  4295. number Count.
  4296.  
  4297. rept Count
  4298. ..........
  4299.  
  4300.    has the same function like Repeat
  4301.  
  4302. procstart
  4303. .........
  4304.  
  4305.    defines a function in a Dice-C assembler output and is used to
  4306. optimize Link and Unlk.  This optimize method isn't working yet.
  4307.  
  4308. procend
  4309. .......
  4310.  
  4311.    defines a function in a Dice-C assembler output and is used to
  4312. optimize Link and Unlk.  This optimize method isn't working yet.
  4313.  
  4314. File I/O Commands
  4315. -----------------
  4316.  
  4317. incdir Dir[,Dir[,...]]
  4318. ......................
  4319.  
  4320.    adds directories to the include path list.  BASM uses 2 internal
  4321. path lists and the current directory to find the include and incbin
  4322. files.  First BASM checks for a : character in the filename and if it
  4323. finds a volume the file is loaded direct instead of searching it
  4324. through the pathlists.  The first path list contains the paths that
  4325. were defined in the commandline or *Note BOPT: MI_BOPT by the option -i
  4326. or through incdir.  The second path list contains the paths that were
  4327. defined in global configuration file ENV:BASMOption.  The entries of
  4328. the second list will be removed when the assembler is closed so that
  4329. the paths are still correct in ARexx-Mode.  The first list is removed
  4330. every pass.
  4331.  
  4332.    * Dir = Name of the Include-Path.
  4333.  
  4334. Incpath
  4335. .......
  4336.  
  4337.    has the same function like incdir.
  4338.  
  4339. include Name
  4340. ............
  4341.  
  4342.    loads the external include file, for example the OS-Includes.  If
  4343. the file is a precompiled include file it's detected automaticlly.
  4344. Includes are loaded from the editor or cachefile.library.
  4345.  
  4346.    * Name = Filename
  4347.  
  4348. include2 Name
  4349. .............
  4350.  
  4351.    has the same function like include with the exception that the
  4352. cachefile.library isn't ignored.
  4353.  
  4354.    * Name = Filename
  4355.  
  4356. incbin Name[,size]
  4357. ..................
  4358.  
  4359.    inserts the file with the optional length at the current address
  4360. into the code. Normally used for sounds and graphics.
  4361.  
  4362. incbin2 Name[,size]
  4363. ...................
  4364.  
  4365.    has the same function like incbin with the exception that the
  4366. cachefile.library isn't used.
  4367.  
  4368.    * Name = Name of the data file.
  4369.  
  4370. ibytes Name[,Length]
  4371. ....................
  4372.  
  4373.    has the same function like incbin
  4374.  
  4375. dsbin Name[,Length]
  4376. ...................
  4377.  
  4378.    defines a memory area with the length of the file specified by the
  4379. file. Optinally you can defined the maximal file length.
  4380.  
  4381.    * Name = Filename
  4382.  
  4383.    * Length = maximal file length
  4384.  
  4385. doscmd Name
  4386. ...........
  4387.  
  4388.    runs the program Name.
  4389.  
  4390.       dc.b    0,"$VER: Fubar 1.0 by Joe User"
  4391.       doscmd    "c:date >ram:Temp"
  4392.       incbin    ram:Temp
  4393.       doscmd    "c:delete ram:Temp"
  4394.  
  4395. filecom Name
  4396. ............
  4397.  
  4398.    sets the file comment of output file.
  4399.  
  4400.       filecom "This is a file comment"
  4401.  
  4402. pure
  4403. ....
  4404.  
  4405.    sets the Pure Bit while writing a program file.
  4406.  
  4407. Miscellaneous
  4408. -------------
  4409.  
  4410. trashreg Reglist
  4411. ................
  4412.  
  4413.    defines the registers that are available to the optimizer.
  4414.  
  4415.    * RegList = A normal Registerlist known by Movem.
  4416.  
  4417. super
  4418. .....
  4419.  
  4420.    deactivates Supervisor warnings.
  4421.  
  4422. mc[Type]
  4423. ........
  4424.  
  4425.    defines the 68k processor type to allow certain commands and
  4426. addressmodes.
  4427.  
  4428.                             Processor-Type
  4429.  
  4430.    * 68000 default mode
  4431.  
  4432.    * 68010
  4433.  
  4434.    * 68020
  4435.  
  4436.    * 68030
  4437.  
  4438.    * 68040
  4439.  
  4440.    * 68060
  4441.  
  4442.    * 68881
  4443.  
  4444.    * 68882
  4445.  
  4446. ppc[Type]
  4447. .........
  4448.  
  4449.    defines the ppc processor type. It also switches automaticly into
  4450. the ELF object mode.
  4451.  
  4452.                             Processor-Type
  4453.  
  4454.    * 601
  4455.  
  4456.    * 603
  4457.  
  4458.    * 604
  4459.  
  4460. bopt [opt[,...],...]
  4461. ....................
  4462.  
  4463.    sets the assembler options.
  4464.  
  4465.                                 Options
  4466.  
  4467. `m1[+,-]'
  4468.      activates/deactivates 68010 mode.
  4469.  
  4470. `m2[+,-]'
  4471.      activates/deactivates 68020 mode.
  4472.  
  4473. `m3[+,-]'
  4474.      activates/deactivates 68030 mode.
  4475.  
  4476. `m4[+,-]'
  4477.      activates/deactivates 68040 mode.
  4478.  
  4479. `m6[+,-]'
  4480.      activates/deactivates 68060 mode.
  4481.  
  4482. `mf[+,-]'
  4483.      activates/deactivates 68881/2 mode.
  4484.  
  4485. `ue[+,-]'
  4486.      activates/deactivates writing an executable file.
  4487.  
  4488. `uo[+,-]'
  4489.      activates/deactivates writing an object file.
  4490.  
  4491. `ua[+,-]'
  4492.      activates/deactivates writing an absolut file.
  4493.  
  4494. `un[+,-]'
  4495.      activates/deactivates writing file.
  4496.  
  4497. `p[+,-]'
  4498.      activates/deactivates writing a preassembled Include file.
  4499.  
  4500. `g[+,-]'
  4501.      activates/deactivates adding the prefix _ to each exported symbol.
  4502.      Default is off.
  4503.  
  4504. `sx[+,-]'
  4505.      activates/deactivates writing all XRef/XDef symbols to a symbol
  4506.      hunk.  Default is off.
  4507.  
  4508. `sl[+,-]'
  4509.      activates/deactivates writing all normal symbols to a symbol hunk.
  4510.      Default is off.
  4511.  
  4512. `sa[+,-]'
  4513.      activates/deactivates writing all symbols to a symbol hunk.
  4514.      Default is off.
  4515.  
  4516. `sd[+,-]'
  4517.      activates/deactivates writing a BASM custom format Debug Hunk.
  4518.      Makes only sense as a program file and it needs a lot hd space
  4519.      because it includes all sources. Default is off.
  4520.  
  4521. `s1[+,-]'
  4522.      activates/deactivates writing a SAS D1 compatible Debug Hunk.
  4523.      Default is off.
  4524.  
  4525. `sf[+,-]'
  4526.      activates/deactivates writing the full sourcefile path into the
  4527.      debug hunk.  You should only use this for your own development
  4528.      system because other users may have different HD layouts. This
  4529.      option has only a meaning with in a SAS D1 Debug Hunk. Default is
  4530.      off.
  4531.  
  4532. `j[+,-]'
  4533.      activates/deactivates setting the PURE Bit for a program file.
  4534.      The PURE Bit tells the Shell that this program can be loaded
  4535.      resident.  Default is off.
  4536.  
  4537. `J[+,-]'
  4538.      activates/deactivates creating the file ENV:BDebugProgram that
  4539.      contains the assembled filename for BDebug.  Default is off.
  4540.  
  4541. `a[+,-]'
  4542.      activates/deactivates creating of an .info file for each program.
  4543.      Useful if you use the assembler through the WB.  Default is off.
  4544.  
  4545. `A[+,-]'
  4546.      activates/deactivates Arexxmode. Only allowed in the commandline.
  4547.      Default is off.
  4548.  
  4549. `i<DirName>'
  4550.      defines the include path.
  4551.  
  4552. `o<FileName>'
  4553.      defines the object filename. If not specified the assembler uses
  4554.      the source file name without the source suffix as the output name.
  4555.      For object files it adds the suffix `.o'.
  4556.  
  4557. `P<Priority>'
  4558.      sets the task priority.
  4559.  
  4560. `c[+,-]'
  4561.      activates/deactivates that the assembler interpretes Upper and
  4562.      Lower case as 2 different chars.  Default is on.
  4563.  
  4564. `f[+,-]'
  4565.      activates/deactivates a faster mode that resolves all references
  4566.      in the 2nd pass.  Fortunately this mode needs more memory and has
  4567.      some disadvantages like uncorrect values during the listing.  This
  4568.      option has no effect during optimizing.  Default is off.
  4569.  
  4570. `F[+,-]'
  4571.      activates/deactivates a faster IO mode that keeps include paths as
  4572.      locks instead of strings.  The older basm versions used locks to
  4573.      store paths but as this isn't compatible with multi-assigns I
  4574.      changed that.
  4575.  
  4576. `M<Bytes>'
  4577.      defines the max macro expansion size.  If you get a macromemerror
  4578.      you should increase the size. Default 1000 Bytes.
  4579.  
  4580. `Z<Address>'
  4581.      tells the assembler that the source is starts in the memory at the
  4582.      defined address.  Useful for ARexx scripts.  Option is only
  4583.      available in the commandline.
  4584.  
  4585. `x[+,-]'
  4586.      uses the `cachefile.library' to load resident Includes/Incbins or
  4587.      add unknown files to the cachefile.library database.  Default is
  4588.      off.
  4589.  
  4590. `X[+,-]'
  4591.      erases all files that are controled by the cachefile.library.
  4592.      Default is off.
  4593.  
  4594. `y[+,-]'
  4595.      shows all files that are controled by the cachefile.library.
  4596.      Default is off.
  4597.  
  4598. `l[+,-]'
  4599.      activates/deactivates the listing output.  Default is off.
  4600.  
  4601. `l0[+,-]'
  4602.      activates/deactivates the listing macro expansion.  Default is on.
  4603.  
  4604. `L<Listingfile>'
  4605.      defines the Listing filename.
  4606.  
  4607. `h[+,-]'
  4608.      activates/deactivates the symbol listing output.  Default is off.
  4609.  
  4610. `H[+,-]'
  4611.      activates/deactivates the unused symbol output.  Default is off.
  4612.  
  4613. `v[+,-]'
  4614.      outputs a statistic after assembling.  Default is off.
  4615.  
  4616. `V[+,-]'
  4617.      as little status output as possible Default is off.
  4618.  
  4619. `e[+,-]'
  4620.      creates an error list.  Default is on.
  4621.  
  4622. `es[+,-]'
  4623.      outputs the error list in the Barfly shell.  This option has no
  4624.      meaning in BASM.
  4625.  
  4626. `wo[+,-]'
  4627.      activates/deactivates Optimizing warnings.  Default is on.
  4628.  
  4629. `ws[+,-]'
  4630.      activates/deactivates Supervisor warnings.  Default is on.
  4631.  
  4632. `wm[+,-]'
  4633.      activates/deactivates Move16 warnings because the use of the
  4634.      move16 command is dangerous if you don't know the problems.
  4635.      Default is on.
  4636.  
  4637. `wp[+,-]'
  4638.      activates/deactivates pc-relative access to different section
  4639.      warnings. The linker is needed to resolve such files.  Default is
  4640.      on.
  4641.  
  4642. `w2[+,-]'
  4643.      activates/deactivates 68020 addressmode warnings.  Default is on.
  4644.  
  4645. `w4[+,-]'
  4646.      activates/deactivates 64k-Access warnings.  It's useful if you
  4647.      accidently avoid to forget the address register.  Example: move.l
  4648.      8,d0 instead of move.l 8(an),d0 Default is on.
  4649.  
  4650. `b0'
  4651.      sets the Default Branch Length to 8-Bit. .b Default is off.
  4652.  
  4653. `b1'
  4654.      sets the Default Branch Length to 16-Bit. .w Default is on.
  4655.  
  4656. `b2'
  4657.      sets the Default Branch Length to 32-Bit. .l Default is off.
  4658.  
  4659. `B0'
  4660.      sets the Default BaseDisplacement-Width to 8 Bit. .b Default is on.
  4661.  
  4662. `B1'
  4663.      sets the Default BaseDisplacement-Width to 16 Bit. .w Default is
  4664.      off.
  4665.  
  4666. `B2'
  4667.      sets the Default BaseDisplacement-Width to 32 Bit. .l Default is
  4668.      off.
  4669.  
  4670. `n0'
  4671.      sets the Default OuterDisplacement-Width to 16 Bit. .w Default is
  4672.      off.
  4673.  
  4674. `n1'
  4675.      sets the Default OuterDisplacement-Width to 32 Bit. .l Default is
  4676.      on.
  4677.  
  4678. `q[+,-]'
  4679.      activates/deactivates align long after each rts, bra or jmp to
  4680.      align blocks to the cache structure.  Default is off.
  4681.  
  4682. `O[+,-]'
  4683.      activates/deactivates the Optimizer.  Without this option no
  4684.      optimizing will happen besides addressmode converting.  Default is
  4685.      off.
  4686.  
  4687. `OG[+,-]'
  4688.      activates/deactivates Forward Reference Optimizing to use every
  4689.      possibility. In this mode the source is assembled until no further
  4690.      optimizing method is found.  First the source is assembled
  4691.      normally.  This is shown by the Output Pass 1.  Afterwards the
  4692.      optimize passes are started and continued until no further symbol
  4693.      changes and length errors occur.  This can take a while and
  4694.      depends on the source size. Default is off.
  4695.  
  4696. `OT[+,-]'
  4697.      activates/deactivates Time Optimizing.  Default is off.
  4698.  
  4699.      Addressmode Converting
  4700.  
  4701. `OC0[+,-]'
  4702.      *Note bdwan: OP_DIRECT
  4703.  
  4704. `OC1[+,-]'
  4705.      *Note bdwpc: OP_DIRECT
  4706.  
  4707. `OC2[+,-]'
  4708.      *Note anxn: OP_DIRECT
  4709.  
  4710. `OC3[+,-]'
  4711.      *Note pcxn: OP_DIRECT
  4712.  
  4713. `OC4[+,-]'
  4714.      *Note bdw: OP_DIRECT
  4715.  
  4716. `OC5[+,-]'
  4717.      *Note bdl: OP_DIRECT
  4718.  
  4719. `OC6[+,-]'
  4720.      *Note an: OP_DIRECT
  4721.  
  4722. `OC7[+,-]'
  4723.      *Note pc: OP_DIRECT
  4724.  
  4725. `ODD[+,-]'
  4726.      activates Direct Addressmode Optimizing
  4727.  
  4728.      Direct Optimizing
  4729.  
  4730. `OD0[+,-]'
  4731.      *Note move: OP_OPTIMIZE
  4732.  
  4733. `OD00[+,-]'
  4734.      *Note move: OP_OPTIMIZE
  4735.  
  4736. `OD01[+,-]'
  4737.      *Note move: OP_OPTIMIZE
  4738.  
  4739. `OD02[+,-]'
  4740.      *Note move: OP_OPTIMIZE
  4741.  
  4742. `OD03[+,-]'
  4743.      *Note move: OP_OPTIMIZE
  4744.  
  4745. `OD04[+,-]'
  4746.      *Note move: OP_OPTIMIZE
  4747.  
  4748. `OD05[+,-]'
  4749.      *Note move: OP_OPTIMIZE
  4750.  
  4751. `OD06[+,-]'
  4752.      *Note move: OP_OPTIMIZE
  4753.  
  4754. `OD07[+,-]'
  4755.      *Note move: OP_OPTIMIZE
  4756.  
  4757. `OD08[+,-]'
  4758.      *Note move: OP_OPTIMIZE
  4759.  
  4760. `OD09[+,-]'
  4761.      *Note move: OP_OPTIMIZE
  4762.  
  4763. `OD0a[+,-]'
  4764.      *Note move: OP_OPTIMIZE
  4765.  
  4766. `OD1[+,-]'
  4767.      *Note clr: OP_OPTIMIZE
  4768.  
  4769. `OD2[+,-]'
  4770.      *Note add: OP_OPTIMIZE
  4771.  
  4772. `OD3[+,-]'
  4773.      *Note sub: OP_OPTIMIZE
  4774.  
  4775. `OD4[+,-]'
  4776.      *Note lea: OP_OPTIMIZE
  4777.  
  4778. `OD5[+,-]'
  4779.      *Note cmp: OP_OPTIMIZE
  4780.  
  4781. `OD6[+,-]'
  4782.      *Note bcc: OP_OPTIMIZE
  4783.  
  4784. `OD7[+,-]'
  4785.      *Note jsr: OP_OPTIMIZE
  4786.  
  4787. `OD8[+,-]'
  4788.      *Note jmp: OP_OPTIMIZE
  4789.  
  4790. `OD9[+,-]'
  4791.      *Note asl: OP_OPTIMIZE
  4792.  
  4793. `ODa[+,-]'
  4794.      *Note or: OP_OPTIMIZE  ( This Optimizing is deactivated internal )
  4795.  
  4796. `ODb[+,-]'
  4797.      *Note eor: OP_OPTIMIZE ( This Optimizing is deactivated internal )
  4798.  
  4799. `ODc[+,-]'
  4800.      *Note and: OP_OPTIMIZE
  4801.  
  4802. `ODd[+,-]'
  4803.      *Note mulu: OP_OPTIMIZE
  4804.  
  4805. `ODe[+,-]'
  4806.      *Note muls: OP_OPTIMIZE
  4807.  
  4808. `ODf[+,-]'
  4809.      *Note jsr+rts: OP_OPTIMIZE
  4810.  
  4811. `ODg[+,-]'
  4812.      *Note jmp+rts: OP_OPTIMIZE
  4813.  
  4814. `ODh[+,-]'
  4815.      *Note MovemNoRegister: OP_OPTIMIZE
  4816.  
  4817. `ODi[+,-]'
  4818.      *Note MovemOneRegister: OP_OPTIMIZE
  4819.  
  4820. `ODj[+,-]'
  4821.      *Note Link: OP_OPTIMIZE
  4822.  
  4823. `OAP[+,-]'
  4824.      activates *Note PC-Relative: OP_ADDRESS Optimizing
  4825.  
  4826. `OAS[+,-]'
  4827.      activates *Note Smalldata: OP_ADDRESS Optimizing
  4828.  
  4829. `OAL[+,-]'
  4830.      activates *Note long to word: OP_ADDRESS Optimizing
  4831.  
  4832. `OAX[+,-]'
  4833.      activates *Note x(An) to (An): OP_ADDRESS Optimizing
  4834.  
  4835. `OAY[+,-]'
  4836.      activates *Note 68020 An-EA: OP_ADDRESS Optimizing
  4837.  
  4838. `OAZ[+,-]'
  4839.      activates *Note 68020 PC-EA: OP_ADDRESS Optimizing
  4840.  
  4841. `OAR[+,-]'
  4842.      activates *Note Register: OP_REGISTER Optimizing
  4843.  
  4844.    You should be careful with the command *Note BOPT: MI_BOPT when you
  4845. activate Global-Optimize.  In every parse the default config is set and
  4846. therefore you should define all global options in the commandline or in
  4847. the configuration file.
  4848.  
  4849. 680xx Meta Commands
  4850. -------------------
  4851.  
  4852. mb Operand1,Operand2
  4853. ....................
  4854.  
  4855.    has the same function as move.b.
  4856.  
  4857. mw Operand1,Operand2
  4858. ....................
  4859.  
  4860.    has the same function as move.w.
  4861.  
  4862. ml Operand1,Operand2
  4863. ....................
  4864.  
  4865.    has the same function as move.l.
  4866.  
  4867. mq Operand1,Operand2
  4868. ....................
  4869.  
  4870.    has the same function as moveq.
  4871.  
  4872. xor.? Operand1,Operand2
  4873. .......................
  4874.  
  4875.    has the same function as eor.?.
  4876.  
  4877. xori.? Operand1,Operand2
  4878. ........................
  4879.  
  4880.    has the same function as eori.?.
  4881.  
  4882. bhs.? Label
  4883. ...........
  4884.  
  4885.    has the same function as bcc.?.
  4886.  
  4887. blo.? Label
  4888. ...........
  4889.  
  4890.    has the same function as bcs.?.
  4891.  
  4892. Assembler Macros
  4893. ================
  4894.  
  4895.    Macros are meta commands that can be based of many assembler
  4896. instructions to achieve an abstracter source layout.  In a macro you
  4897. can use several different pattern that are replaced by appropriate
  4898. parameters when the macro is called.  The parameter that are passed
  4899. during a macro call are represented by the following patterns:
  4900. \0,...,\9, \a,...,\z, \A,...,\Z.  The pattern ids are using the
  4901. hexadecimal format.  If a pattern is used with no related parameter an
  4902. empty string is inserted.  Furthermore if a parameter contains
  4903. tabulators or spaces it has to be placed between <...>.  When a macro
  4904. needs relative labels and is should be called more than one time you
  4905. should use the special pattern @.  This pattern is replaced by a number
  4906. that is based of 4 digits and that is increased after each call.  The
  4907. pattern \# is replaced by the value of the symbol narg that represents
  4908. the count of macro parameters.  Besides the standard patterns there are
  4909. some more advanced pattern functions supported that look like
  4910. \*Function-Name.  These functions don't belong to the motorola standard
  4911. thus they aren't supported by every assembler.  Another important point
  4912. is that you can also call macros from from macros but you can't define
  4913. macros in macros.
  4914.  
  4915.    The standard macro pattern
  4916.  
  4917.    Label & [. string] & [, string] & [, string] & [,...]        & [\\0]
  4918. & [\\1|] & [\\2|] & [\\3|]...[\\n|]
  4919.  
  4920.    The advanced macro pattern functions
  4921.  
  4922.    * ` \(Argument)' inserts the string of the macroparameter with the
  4923.      number the argument defines.
  4924.  
  4925.  
  4926.           \(1) =  \1
  4927.           \(1+3+4) = \8
  4928.  
  4929.    * `\*upper(String)' inserts the string in upper case.
  4930.  
  4931.    * `\*lower(String)' inserts the string in lower case.
  4932.  
  4933.    * `\*valof(Argument)' inserts the decimal value of the argument as a
  4934.      string.
  4935.  
  4936.    * `\*strlen(Symbol)' inserts the length of a symbol as a string.
  4937.  
  4938.    * `\*right(String,n)' inserts n chars of the right side of the
  4939.      string.  If the string contains less than n chars the whole string
  4940.      is inserted.
  4941.  
  4942.    * `\*left(String,n)' inserts n chars of the left side of the string.
  4943.      If the string contains less than n chars the whole string is
  4944.      inserted.
  4945.  
  4946.    * `\*mid(String,n,m)' inserts chars from position n to m from the
  4947.      string.  If the position is outside of the string length the chars
  4948.      till the end of the string is inserted.
  4949.  
  4950.  
  4951.      openwind MACRO
  4952.               move.l     intbase,a6
  4953.               lea.l      \1,a0
  4954.               jsr        OpenWindow(a6)
  4955.               ENDM
  4956.      
  4957.      start:
  4958.               openwind   newwindow
  4959.  
  4960.  
  4961.  
  4962.      movewind MACRO
  4963.               move.l     intbase,a6
  4964.               move.l     \1,a0
  4965.               moveq      #0,d0
  4966.               move.\0    \2,d1
  4967.               IFC        `\0',`b'
  4968.               ext.w      d1
  4969.               ENDC
  4970.               jsr        MoveWindow(a6)
  4971.               ENDM
  4972.      
  4973.      start:
  4974.               move.b     #10,d2
  4975.      1$:
  4976.               movewind.b newwindow,d2
  4977.               addq.b     #1,d2
  4978.               cmp.b      #100,d2
  4979.               bne.s      1$
  4980.  
  4981.  
  4982.      wait MACRO
  4983.               moveq      #-1,d0
  4984.      wait\
  4985.               dbra       d0,wait\
  4986.               ENDM
  4987.      
  4988.      start:
  4989.               wait
  4990.               wait
  4991.               wait
  4992.  
  4993.  
  4994.      test MACRO
  4995.               move.l     #\*upper(Hello),d0
  4996.               move.l     #\*lower(Hello),d0
  4997.               move.l     #\*strlen(1234567890123456),d0
  4998.               move.l     #\*valof(value),d0
  4999.               rts
  5000.      
  5001.               cstring    "\*left(abcdefgh,4)"
  5002.               even
  5003.               cstring    "\*left(abcdefgh,10)"
  5004.               even
  5005.               cstring    "\*right(abcdefgh,4)"
  5006.               even
  5007.               cstring    "\*right(abcdefgh,10)"
  5008.               even
  5009.               cstring    "\*mid(abcdefgh,2,4)"
  5010.               even
  5011.               cstring    "\*mid(abcdefgh,2,8)"
  5012.               even
  5013.      
  5014.               ENDM
  5015.      
  5016.      value = 123456789
  5017.      hello:
  5018.               test
  5019.  
  5020.  
  5021.       value = 123456789
  5022.      
  5023.      
  5024.      hello:
  5025.               move.l     #HELLO,d0
  5026.               move.l     #hello,d0
  5027.               move.l     #16,d0
  5028.               move.l     #123456789,d0
  5029.               rts
  5030.               cstring    "abcd"
  5031.               even
  5032.               cstring    "abcdefgh"
  5033.               even
  5034.               cstring    "efgh"
  5035.               even
  5036.               cstring    "abcdefgh"
  5037.               even
  5038.               cstring    "cdef"
  5039.               even
  5040.               cstring    "cdefgh"
  5041.               even
  5042.  
  5043.  
  5044.      PUTTAG MACRO
  5045.               IFC        "\2",""
  5046.      PUTTAG_COUNT set 0
  5047.               ENDC
  5048.      
  5049.               IFNC       "\2",""
  5050.               move.l     \2,-(a7)
  5051.      PUTTAG_COUNT SET PUTTAG_COUNT+4
  5052.               ENDC
  5053.      
  5054.               move.l     \1,-(a7)
  5055.      PUTTAG_COUNT SET PUTTAG_COUNT+4
  5056.      
  5057.               IFC        "\1","#TAG_END"
  5058.      PUTTAG_COUNT SET 4
  5059.               ENDC
  5060.      
  5061.               ENDM
  5062.      
  5063.      CLEARTAG MACRO
  5064.               lea.l      PUTTAG_COUNT(a7),a7
  5065.               ENDM
  5066.      
  5067.      
  5068.      
  5069.               PUTTAG     #TAG_END
  5070.               PUTTAG     #WA_Width,#100
  5071.               PUTTAG     #WA_ScreenTitle,#Title
  5072.               .
  5073.               .
  5074.               move.l     a7,a1
  5075.               sub.l      a0,a0
  5076.               jsr        OpenWindowTagList(a6)
  5077.               CLEARTAG
  5078.  
  5079. Highlevel Macros
  5080. ================
  5081.  
  5082.    In highlevel macros the operands are based of legal addressmodes.
  5083. Arguments are based of operands and the operators +,-,<<,>>. Conditions
  5084. are based of !,=, <,>,<=,>=,<>.  By using highlevel macros you can make
  5085. the programming of non critical source areas easier and more abstract.
  5086. Blame Mike Schwartz for this idea...he forced me to do it:-B
  5087.  
  5088. .REG
  5089. ....
  5090.  
  5091.    sets the accumulator register that is used to calculate arguments.
  5092. Default register is D0.
  5093.  
  5094. .BRANCH b|w|l
  5095. .............
  5096.  
  5097.    sets the length of branch commands that are used in the highlevel
  5098. macros.  Standard length is .b.
  5099.  
  5100. .FOR Operand[.b|w|l] = Operand TO Operand STEP Operand
  5101. ......................................................
  5102.  
  5103.    creates code for a for loop.  The optional width you define after
  5104. the first operand sets the width for all operations in the for loop.
  5105.  
  5106.  
  5107.        .FOR   d0.w = #1 to  STEP #2
  5108.        addq.w #1,d1
  5109.        .NEXT
  5110.      
  5111.        ;Compiled Code
  5112.      
  5113.        move.w #1,d0
  5114.      __for1:
  5115.        addq.w #1,d1
  5116.        add.w  #2,d0
  5117.        cmp.w  ,d0
  5118.        blt.b  __for1
  5119.  
  5120. .NEXT
  5121. .....
  5122.  
  5123.    closes the outer .FOR loop.
  5124.  
  5125. .IF [Argument] =,!, < , > , <> Operand
  5126. ......................................
  5127.  
  5128.    creates code for an IF-Operation.  You can remove the first argument
  5129. if you want to test the operand.  For example .IF <>
  5130.  
  5131.  
  5132.        .IF    (a0) + #0 <> d1
  5133.        moveq  #0,d0
  5134.        .ELSE
  5135.        moveq  #1,d0
  5136.        .ENDIF
  5137.      
  5138.        ;Compiled Code
  5139.      
  5140.        move.l (a0),d7
  5141.        add.l  #0,d7
  5142.        cmp.l  d1,d7
  5143.        beq.b  __else1
  5144.        moveq  #0,d0
  5145.        bra.b  __endif1
  5146.      __else1:
  5147.        moveq  #1,d0
  5148.      __endif1:
  5149.  
  5150. .ELSE
  5151. .....
  5152.  
  5153.    starts an alternative IF-Block.
  5154.  
  5155. .ENDIF
  5156. ......
  5157.  
  5158.    closes the outer .IF block.
  5159.  
  5160. .WHILE [Argument] =,!, < , > , <> Operand
  5161. .........................................
  5162.  
  5163.    creates code for a while loop The optional width you define after
  5164. the first operand sets the width for all operations in the while loop.
  5165.  
  5166.  
  5167.        .WHILE d0 <> #0
  5168.        addq.w #1,d1
  5169.        .ENDWHILE
  5170.      
  5171.        ;Compiled Code
  5172.      
  5173.      __while1:
  5174.        cmp.l  #0,d0
  5175.        beq.s  __endwhile1
  5176.        addq.w #1,d1
  5177.        bra.s  __while1
  5178.      __endwhile1:
  5179.  
  5180. .ENDWHILE
  5181. .........
  5182.  
  5183.    closes the outer while loop.
  5184.  
  5185. .CALL Function [, Argument [, Argument [,...]]]
  5186. ...............................................
  5187.  
  5188.    calls a C-Function by parsing the arguments through the stack.
  5189. Arguments are calculated in the accumulator register.
  5190.  
  5191.  
  5192.  
  5193.        .CALL func , test + 0 - #20 , #test
  5194.      
  5195.        ;Compiled Code
  5196.      
  5197.        move.l test,d7
  5198.        add.l  0,d7
  5199.        sub.l  #20,d7
  5200.        move.l d7,-(a7)
  5201.        move.l #test,-(a7)
  5202.        jsr    func
  5203.        ifnc   "8","0"             ;Were there any parameters ?
  5204.        lea.l  __CALLSize(a7),a7
  5205.        endc
  5206.  
  5207. .RETURN Argument
  5208. ................
  5209.  
  5210.    returns a result value in the accumulator register.
  5211.  
  5212.  
  5213.        .return d1 + d2 + #$100
  5214.      
  5215.        ;Compiled Code
  5216.      
  5217.      
  5218.        move.l d1,d7
  5219.        add.l  d2,d7
  5220.        add.l  #$100,d7
  5221.  
  5222. .DEF func [, Operand [, Operand [,...]]]
  5223. ........................................
  5224.  
  5225.    defines a C-Stack function and loads the defined parameters into the
  5226. operands.
  5227.  
  5228.  
  5229.        .DEF func , d0.w , d1 , (a0)
  5230.        .ENDDEF
  5231.      
  5232.        ;Compiled Code
  5233.      
  5234.        XDEF   func
  5235.        link   a5,#0
  5236.        move.w $0a(a5),d0
  5237.        move.l $0c(a5),d1
  5238.        move.l $10(a5),(a0)
  5239.        unlk   a5            ;.ENDDEF
  5240.        rts
  5241.  
  5242. .ENDDEF
  5243. .......
  5244.  
  5245.    closes a function that was started by .DEF
  5246.  
  5247. .LET [ Operand =] Argument
  5248. ..........................
  5249.  
  5250.    calculates an argument in an accumulator or moves the value to a
  5251. defined operand.
  5252.  
  5253.  
  5254.        .LET + 4 - #LN_SIZE << #7
  5255.        .LET d1 = (a1) - (a0)
  5256.      
  5257.        ;Compiled Code
  5258.      
  5259.        add.l  4,d7
  5260.        sub.l  #LN_SIZE,d7
  5261.        lsl.l  #7,d7
  5262.      
  5263.        move.l (a1),d7
  5264.        sub.l  (a0),d7
  5265.        move.l d7,d1
  5266.  
  5267. Predefined Symbols
  5268. ==================
  5269.  
  5270. NARG
  5271. ....
  5272.  
  5273.    represents the macro parameter count in a macro.
  5274.  
  5275. BARFLY
  5276. ......
  5277.  
  5278.    represents the assembler version.
  5279.  
  5280. 680xx
  5281. .....
  5282.  
  5283.    represents the CPU processor type.
  5284.  
  5285. 6888x
  5286. .....
  5287.  
  5288.    represents the FPU processor type.
  5289.  
  5290. _MOVEMBYTES
  5291. ...........
  5292.  
  5293.    represents the byte count the last movem transfer used.
  5294.  
  5295.  
  5296.       lea    _MOVEMBYTES(a7),a7    ;frees the stack
  5297.  
  5298. _MOVEMREGS
  5299. ..........
  5300.  
  5301.    represents the last movem register mask.
  5302.  
  5303.  
  5304.       movem    (a7)+,_MOVEMREGS
  5305.  
  5306. __RS
  5307. ....
  5308.  
  5309.    represents the RS-Counter.
  5310.  
  5311. __SO
  5312. ....
  5313.  
  5314.    represents the RS-Counter.
  5315.  
  5316. __FO
  5317. ....
  5318.  
  5319.    represents the FO-Counter.
  5320.  
  5321. Optimizing
  5322. ==========
  5323.  
  5324.    Optimize Methods...
  5325.  
  5326. Direct Addressmode Optimizing
  5327. -----------------------------
  5328.  
  5329.    The assembler can direct optimize certain 68020...60 Addressmodes if
  5330. a faster 68000 addressmode exists.  This optimizing method should
  5331. always be activated because of compatibility reasons.
  5332.  
  5333.    * `(bd.w,an)' can be optimized to `x(an)' that removes 1 word and
  5334.      some cycles.
  5335.  
  5336.      +------------------------+--------------------+--------+
  5337.      |       Addressmode      |     Optimizing     | Option |
  5338.      +------------------------+--------------------+--------+
  5339.      +------------------------+--------------------+--------+
  5340.      | move. l (1000.w,an),dn | move.l 1000(an),dn |  -OC0  |
  5341.      +------------------------+--------------------+--------+
  5342.  
  5343.    * `(bd.w,pc)' can be optimized to `x(pc)' that removes 1 word and
  5344.      some cycles.
  5345.  
  5346.      +------------------------+--------------------+--------+
  5347.      |       Addressmode      |     Optimizing     | Option |
  5348.      +------------------------+--------------------+--------+
  5349.      +------------------------+--------------------+--------+
  5350.      | move. l (1000.w,pc),dn | move.l 1000(pc),dn |  -OC1  |
  5351.      +------------------------+--------------------+--------+
  5352.  
  5353.    * `(bd.w)' can be optimized to `bd.w' that removes 1 word and some
  5354.      cycles.
  5355.  
  5356.      +------------------------+--------------------+--------+
  5357.      |       Addressmode      |     Optimizing     | Option |
  5358.      +------------------------+--------------------+--------+
  5359.      +------------------------+--------------------+--------+
  5360.      |  move. l (bd.w),dn     |   move.l bd.w,dn   |  -OC4  |
  5361.      +------------------------+--------------------+--------+
  5362.  
  5363.    * `(bd.l)' can be optimized to `bd.l' that removes 1 word and some
  5364.      cycles.
  5365.  
  5366.      +------------------------+--------------------+--------+
  5367.      |       Addressmode      |     Optimizing     | Option |
  5368.      +------------------------+--------------------+--------+
  5369.      +------------------------+--------------------+--------+
  5370.      |  move. l (bd.l),dn     |   move.l bd.l,dn   |  -OC5  |
  5371.      +------------------------+--------------------+--------+
  5372.  
  5373.    * `(an)' can be optimized to `(an)' that removes 1 word and some
  5374.      cycles.  The addressmode `(an)' can be interpreted as a subgroup
  5375.      of `(bd,an,xn)'. Because `(an)' is a normal 68000 addressmode you
  5376.      should never switch off this optimizing method.
  5377.  
  5378.      +------------------------+--------------------+--------+
  5379.      |       Addressmode      |     Optimizing     | Option |
  5380.      +------------------------+--------------------+--------+
  5381.      +------------------------+--------------------+--------+
  5382.      |     move. l (an),dn    |   move.l (an),dn   |  -OC6  |
  5383.      +------------------------+--------------------+--------+
  5384.  
  5385.    * `(pc)' can be optimized to `(pc)' that removes 1 word and some
  5386.      cycles.  The addressmode `(pc)' can be interpreted as a subgroup
  5387.      of `(bd,pc,xn)'. Because `(pc)' is a normal 68000 addressmode you
  5388.      should never switch off this optimizing method.
  5389.  
  5390.      +------------------------+--------------------+--------+
  5391.      |       Addressmode      |     Optimizing     | Option |
  5392.      +------------------------+--------------------+--------+
  5393.      +------------------------+--------------------+--------+
  5394.      |     move. l (pc),dn    |   move.l (pc),dn   |  -OC7  |
  5395.      +------------------------+--------------------+--------+
  5396.  
  5397. Address Optimizing
  5398. ------------------
  5399.  
  5400.    * `Long'
  5401.  
  5402.      +---------------+----------------+---------------------+--------+
  5403.      | Addressmode   |   Optimizing   |         Note        | Option |
  5404.      +---------------+----------------+---------------------+--------+
  5405.      +---------------+----------------+---------------------+--------+
  5406.      |     x.l,EA    |    x.w,EA      | $ffff8000<=x<=$7fff |        |
  5407.      +---------------+----------------+---------------------+  -OAL  |
  5408.      |     EA,x.l    |    EA,x.l      | $ffff8000<=x<=$7fff |        |
  5409.      +---------------+----------------+---------------------+--------+
  5410.  
  5411.    * `x(an)'
  5412.  
  5413.      +---------------+----------------+---------------------+--------+
  5414.      | Addressmode   |   Optimizing   |         Note        | Option |
  5415.      +---------------+----------------+---------------------+--------+
  5416.      +---------------+----------------+---------------------+--------+
  5417.      |   x(an),EA    |    (an),EA     |         x=0         |        |
  5418.      +---------------+----------------+---------------------+  -OAX  |
  5419.      |   EA,x(an)    |    EA,(an)     |         x=0         |        |
  5420.      +---------------+----------------+---------------------+--------+
  5421.  
  5422.    * `PC-Relative'
  5423.  
  5424.      +---------------+----------------+---------------------+--------+
  5425.      | Addressmode   |   Optimizing   |         Note        | Option |
  5426.      +---------------+----------------+---------------------+--------+
  5427.      +---------------+----------------+---------------------+--------+
  5428.      |   label,EA    |  label(pc),EA  | $ffff8000<=x<=$7fff |  -OAP  |
  5429.      +---------------+----------------+---------------------+--------+
  5430.  
  5431.    * `A4-Smalldata'
  5432.  
  5433.      +---------------+----------------+---------------------+--------+
  5434.      | Addressmode   |   Optimizing   |         Note        | Option |
  5435.      +---------------+----------------+---------------------+--------+
  5436.      +---------------+----------------+---------------------+--------+
  5437.      |     x.l,EA    |    x(a4),EA    | $ffff8000<=x<=$7fff |        |
  5438.      +---------------+----------------+---------------------+  -OAS  |
  5439.      |     EA,x.l    |    EA,x(a4)    | $ffff8000<=x<=$7fff |        |
  5440.      +---------------+----------------+---------------------+--------+
  5441.  
  5442.    * `68020-An'
  5443.  
  5444.      +---------------+----------------+---------------------+--------+
  5445.      | Addressmode   |   Optimizing   |         Note        | Option |
  5446.      +---------------+----------------+---------------------+--------+
  5447.      +---------------+----------------+---------------------+--------+
  5448.      |   (x.l,an)    |    (an)        | x=0                 |  -OAY  |
  5449.      +---------------+----------------+---------------------+        |
  5450.      |   (x.l,an)    |    x(an)       | $ffffff80<=x<=$7f   |        |
  5451.      +---------------+----------------+---------------------+        |
  5452.      |   (x,an,xn)   |    0(an,xn)    | x=0                 |        |
  5453.      +---------------+----------------+---------------------+        |
  5454.      |   (x,an,xn)   |    (x.b,an,xn) | $ffffff80<=x<=$7f   |        |
  5455.      +---------------+----------------+---------------------+        |
  5456.      |   (x,an,xn)   |    (x.w,an,xn) | $ffff8000<=x<=$7fff |        |
  5457.      +---------------+----------------+---------------------+        |
  5458.      |   ([?],x)     |    ([?])       | x=0                 |        |
  5459.      |               |                | ? is also optimized |        |
  5460.      +---------------+----------------+---------------------+        |
  5461.      |   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
  5462.      |               |                | ? is also optimized |        |
  5463.      +---------------+----------------+---------------------+        |
  5464.      |   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
  5465.      |               |                | ? is also optimized |        |
  5466.      +---------------+----------------+---------------------+        |
  5467.      |   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
  5468.      |               |                | ? is also optimized |        |
  5469.      +---------------+----------------+---------------------+--------+
  5470.  
  5471.    * `68020-PC'
  5472.  
  5473.      +---------------+----------------+---------------------+--------+
  5474.      | Addressmode   |   Optimizing   |         Note        | Option |
  5475.      +---------------+----------------+---------------------+--------+
  5476.      +---------------+----------------+---------------------+--------+
  5477.      |   (x.l,pc)    |    (pc)        | x=0                 |  -OAZ  |
  5478.      +---------------+----------------+---------------------+        |
  5479.      |   (x.l,pc)    |    x(pc)       | $ffffff80<=x<=$7f   |        |
  5480.      +---------------+----------------+---------------------+        |
  5481.      |   (x,pc,xn)   |    0(pc,xn)    | x=0                 |        |
  5482.      +---------------+----------------+---------------------+        |
  5483.      |   (x,pc,xn)   |    (x.b,pc,xn) | $ffffff80<=x<=$7f   |        |
  5484.      +---------------+----------------+---------------------+        |
  5485.      |   (x,pc,xn)   |    (x.w,pc,xn) | $ffff8000<=x<=$7fff |        |
  5486.      +---------------+----------------+---------------------+        |
  5487.      |   ([?],x)     |    ([?])       | x=0                 |        |
  5488.      |               |                | ? is also optimized |        |
  5489.      +---------------+----------------+---------------------+        |
  5490.      |   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
  5491.      |               |                | ? is also optimized |        |
  5492.      +---------------+----------------+---------------------+        |
  5493.      |   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
  5494.      |               |                | ? is also optimized |        |
  5495.      +---------------+----------------+---------------------+        |
  5496.      |   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
  5497.      |               |                | ? is also optimized |        |
  5498.      +---------------+----------------+---------------------+--------+
  5499.  
  5500. #x Optimizing
  5501. -------------
  5502.  
  5503.    * `Move'
  5504.  
  5505.      +-------------------+------------------+-------------------------+--------+
  5506.      | Addressmode       |   Optimizing     |         Note            | Option |
  5507.      +-------------------+------------------+-------------------------+--------+
  5508.      |                   |                  |                         |  -OD0  |
  5509.      +-------------------+------------------+-------------------------+--------+
  5510.      |  move.l #x,dn     |   moveq #x,dn    |    $ffffff80<=$7f       |  -OD00 |
  5511.      +-------------------+------------------+-------------------------+        |
  5512.      |  move.? #0,an     |  suba.l an,an    |      ? = w or l         |  -OD01 |
  5513.      +-------------------+------------------+-------------------------+        |
  5514.      |  move.l #x,dn     | moveq #y,dn      | $10000<=x<=$7f0000      |  -OD02 |
  5515.      |                   | swap dn          |                         |        |
  5516.      +-------------------+------------------+-------------------------+        |
  5517.      |  move.l #x,dn     | moveq #y,dn      | $ff80ffff<=x<=$fffEffff |  -OD03 |
  5518.      |                   | swap dn          |                         |        |
  5519.      +-------------------+------------------+-------------------------+        |
  5520.      |  move.l #x,dn     | moveq #y,dn      |      $80<=x<=$ff        |  -OD04 |
  5521.      |                   | not.b dn         |                         |        |
  5522.      +-------------------+------------------+-------------------------+        |
  5523.      |  move.l #x,dn     | moveq #y,dn      |     $ffff<=x<=$ff81     |  -OD05 |
  5524.      |                   | neg.w dn         |                         |        |
  5525.      +-------------------+------------------+-------------------------+        |
  5526.      |  move.l #x,dn     | moveq #y,dn      | $ffff0080<=x<=$ffff0001 |  -OD06 |
  5527.      |                   | neg.w dn         |                         |        |
  5528.      +-------------------+------------------+-------------------------+        |
  5529.      |  move.? #0,EA     | clr.? EA         | ? = w or l.See Trashreg |  -OD07 |
  5530.      |                   |                  | optimizing. I also check|        |
  5531.      |                   |                  | if it accesses the HW   |        |
  5532.      +-------------------+------------------+-------------------------+        |
  5533.      | move.b #$ff,EA    | st EA            |                         |  -OD08 |
  5534.      +-------------------+------------------+-------------------------+        |
  5535.      | movea.l -4(an),an | movea.l -(an),an |                         |  -OD09 |
  5536.      +-------------------+------------------+-------------------------+        |
  5537.      | movea.w -2(an),an | movea.w -(an),an |                         |  -OD0a |
  5538.      +-------------------+------------------+-------------------------+--------+
  5539.  
  5540.    * `Clr'
  5541.  
  5542.      +---------------+----------------+-------------------------+--------+
  5543.      | Addressmode   |   Optimizing   |         Note            | Option |
  5544.      +---------------+----------------+-------------------------+--------+
  5545.      +---------------+----------------+-------------------------+--------+
  5546.      |    clr.l dn   |   moveq #0,dn  |                         |  -OD1  |
  5547.      +---------------+----------------+-------------------------+--------+
  5548.  
  5549.    * `Add'
  5550.  
  5551.      +---------------+----------------+-------------------------+--------+
  5552.      | Addressmode   |   Optimizing   |         Note            | Option |
  5553.      +---------------+----------------+-------------------------+--------+
  5554.      +---------------+----------------+-------------------------+--------+
  5555.      |  add.? #x,EA  |  addq.? #x,EA  |       1<=x<=8           |  -OD2  |
  5556.      +---------------+----------------+-------------------------+        |
  5557.      |  add.? #x,EA  |  subq.? #x,EA  |      -8<=x<=-1          |        |
  5558.      +---------------+----------------+-------------------------+        |
  5559.      |  add.? #x,an  | lea.l x(an),an |   $ffff8000<=x<=$7fff   |        |
  5560.      +---------------+----------------+-------------------------+        |
  5561.      |  add.? #0,EA  | tst.? EA       |       legal EA          |        |
  5562.      +---------------+----------------+-------------------------+        |
  5563.      |  add.? #0,an  | removed        |                         |        |
  5564.      +---------------+----------------+-------------------------+--------+
  5565.  
  5566.    * `Sub'
  5567.  
  5568.      +---------------+----------------+-------------------------+--------+
  5569.      | Addressmode   |   Optimizing   |         Note            | Option |
  5570.      +---------------+----------------+-------------------------+--------+
  5571.      +---------------+----------------+-------------------------+--------+
  5572.      |  sub.? #x,EA  |  subq.? #x,EA  |       1<=x<=8           |  -OD3  |
  5573.      +---------------+----------------+-------------------------+        |
  5574.      |  sub.? #x,EA  |  addq.? #x,EA  |      -8<=x<=-1          |        |
  5575.      +---------------+----------------+-------------------------+        |
  5576.      |  sub.? #x,an  |lea.l -x(an),an |   $ffff8000<=x<=$7fff   |        |
  5577.      +---------------+----------------+-------------------------+        |
  5578.      |  sub.? #0,EA  | tst.? EA       |       legal EA          |        |
  5579.      +---------------+----------------+-------------------------+        |
  5580.      |  sub.? #0,an  | removed        |                         |        |
  5581.      +---------------+----------------+-------------------------+--------+
  5582.  
  5583.    * `Lea'
  5584.  
  5585.      +---------------+----------------+-------------------------+--------+
  5586.      | Addressmode   |   Optimizing   |         Note            | Option |
  5587.      +---------------+----------------+-------------------------+--------+
  5588.      +---------------+----------------+-------------------------+--------+
  5589.      | lea x(an),an  |  addq.w #x,an  |       1<=x<=8           |        |
  5590.      +---------------+----------------+-------------------------+  -OD4  |
  5591.      | lea x(an),an  |  subq.w #x,an  |      -8<=x<=-1          |        |
  5592.      +---------------+----------------+-------------------------+--------+
  5593.  
  5594.    * `Cmp'
  5595.  
  5596.      +---------------+----------------+-------------------------+--------+
  5597.      | Addressmode   |   Optimizing   |         Note            | Option |
  5598.      +---------------+----------------+-------------------------+--------+
  5599.      +---------------+----------------+-------------------------+--------+
  5600.      |  cmp.? #0,EA  |   tst.? EA     |                         |  -OD5  |
  5601.      +---------------+----------------+-------------------------+--------+
  5602.  
  5603.    * `Bcc'
  5604.  
  5605.      The assembler tries to optimize the branch on the smallest
  5606.      possible length so that can win max 2 words and some cycles.
  5607.  
  5608.      +---------------+----------------+-------------------------+--------+
  5609.      | Addressmode   |   Optimizing   |         Note            | Option |
  5610.      +---------------+----------------+-------------------------+--------+
  5611.      +---------------+----------------+-------------------------+--------+
  5612.      |  Bcc.l label  |  Bcc.w label   |   $8000<=label<=$7fff   |  -OD6  |
  5613.      +---------------+----------------+-------------------------+        |
  5614.      |  Bcc.l label  |  Bcc.s label   |     $80<=label<=$7f     |        |
  5615.      +---------------+----------------+-------------------------+        |
  5616.      |  Bcc.w label  |  Bcc.s label   |     $80<=label<=$7f     |        |
  5617.      +---------------+----------------+-------------------------+--------+
  5618.  
  5619.      Attention! This optimizing methid is unsafe when you use
  5620.      BRANCH-Tables.  You should switch off the optimize method over
  5621.      this area.
  5622.  
  5623.  
  5624.    * `Jsr'
  5625.  
  5626.      +---------------+----------------+-------------------------+--------+
  5627.      | Addressmode   |   Optimizing   |         Note            | Option |
  5628.      +---------------+----------------+-------------------------+--------+
  5629.      +---------------+----------------+-------------------------+--------+
  5630.      |   jsr label   |  bsr.w label   |   $8000<=Offset<=$7fff  |        |
  5631.      +---------------+----------------+-------------------------+  -OD7  |
  5632.      |   jsr label   |  bsr.s label   |     $80<=Offset<=$7f    |        |
  5633.      +---------------+----------------+-------------------------+--------+
  5634.  
  5635.      Attention! This optimizing methid is unsafe when you use
  5636.      JSR-Tables.  You should switch off the optimize method over this
  5637.      area.
  5638.  
  5639.  
  5640.    * `Jmp'
  5641.  
  5642.      +---------------+----------------+-------------------------+--------+
  5643.      | Addressmode   |   Optimizing   |         Note            | Option |
  5644.      +---------------+----------------+-------------------------+--------+
  5645.      +---------------+----------------+-------------------------+--------+
  5646.      |   jmp label   |  bra.w label   |$ffff8000<=Offset<=$7fff |        |
  5647.      +---------------+----------------+-------------------------+  -OD8  |
  5648.      |   jmp label   |  bra.s label   |$ffffff80<=Offset<=$7f   |        |
  5649.      +---------------+----------------+-------------------------+--------+
  5650.  
  5651.    * `Asl'
  5652.  
  5653.      +---------------+----------------+-------------------------+--------+
  5654.      | Addressmode   |   Optimizing   |         Note            | Option |
  5655.      +---------------+----------------+-------------------------+--------+
  5656.      +---------------+----------------+-------------------------+--------+
  5657.      |  asl.? #1,dn  |  add.? dn,dn   |                         |  -OD9  |
  5658.      +---------------+----------------+-------------------------+--------+
  5659.  
  5660.    * `Or' This optimizing method isn't safe because of the changed
  5661.      condition flags.
  5662.  
  5663.      +---------------+----------------+-------------------------+--------+
  5664.      | Addressmode   |   Optimizing   |         Note            | Option |
  5665.      +---------------+----------------+-------------------------+--------+
  5666.      +---------------+----------------+-------------------------+--------+
  5667.      |  or.? #x,dn   |  bset #y,dn    | x=y^2                   |  -ODa  |
  5668.      +---------------+----------------+-------------------------+--------+
  5669.  
  5670.    * `Eor' This optimizing method isn't safe because of the changed
  5671.      condition flags.
  5672.  
  5673.      +---------------+----------------+-------------------------+--------+
  5674.      | Addressmode   |   Optimizing   |         Note            | Option |
  5675.      +---------------+----------------+-------------------------+--------+
  5676.      +---------------+----------------+-------------------------+--------+
  5677.      |  eor.? #x,dn  |  bchg #y,dn    | x=y^2                   |  -ODb  |
  5678.      +---------------+----------------+-------------------------+--------+
  5679.  
  5680.    * `Mulu'
  5681.  
  5682.      Be very careful with this optimizing.
  5683.  
  5684.      +---------------+----------------+-------------------------+--------+
  5685.      | Addressmode   |   Optimizing   |         Note            | Option |
  5686.      +---------------+----------------+-------------------------+--------+
  5687.      +---------------+----------------+-------------------------+--------+
  5688.      | mulu.w #x,dn  | swap dn        | x=2^y                   |  -ODc  |
  5689.      |               | clr.w dn       | y=y1+y2                 |        |
  5690.      |               | swap dn        | y=1,add.l dn,dn         |        |
  5691.      |               | lsl.l #y1,dn   |                         |        |
  5692.      |               | lsl.l #y2,dn   |                         |        |
  5693.      +---------------+----------------+-------------------------+        |
  5694.      | mulu.l #x,dn  | lsl.l #y1,dn   | x=2^y                   |        |
  5695.      |               | lsl.l #y2,dn   | y=y1+y2                 |        |
  5696.      |               |                | y >= 16                 |        |
  5697.      |               |                | swap dn , y-16          |        |
  5698.      +---------------+----------------+-------------------------+--------+
  5699.  
  5700.    * `Muls'
  5701.  
  5702.      Be very careful with this optimizing.
  5703.  
  5704.      +---------------+----------------+-------------------------+--------+
  5705.      | Addressmode   |   Optimizing   |         Note            | Option |
  5706.      +---------------+----------------+-------------------------+--------+
  5707.      +---------------+----------------+-------------------------+--------+
  5708.      | muls.w #x,dn  | ext.l dn       | x=2^y                   |  -ODd  |
  5709.      |               | asl.l #y1,dn   | y=y1+y2                 |        |
  5710.      |               | asl.l #y2,dn   | y=1 , add.l dn,dn       |        |
  5711.      +---------------+----------------+-------------------------+        |
  5712.      | muls.l #x,dn  | asl.l #y1,dn   | x=2^y                   |        |
  5713.      |               | asl.l #y2,dn   | y=y1+y2                 |        |
  5714.      |               |                | y >= 16                 |        |
  5715.      |               |                | swap dn ,y-16           |        |
  5716.      +---------------+----------------+-------------------------+--------+
  5717.  
  5718.    * `Jsr+Rts'
  5719.  
  5720.      +--------------+---------------+------------------------+-------+
  5721.      | Addressmode   |   Optimizing   |         Note            |
  5722.      Option |
  5723.      +--------------+---------------+------------------------+-------+
  5724.      +--------------+---------------+------------------------+-------+
  5725.      | jsr EA        | jmp EA         | No optimizing if there's|  -ODe
  5726.      | | rts           |                | a label before RTS      |
  5727.         |
  5728.      +--------------+---------------+------------------------+-------+
  5729.  
  5730.    * `Bsr+Rts'
  5731.  
  5732.      +--------------+---------------+------------------------+-------+
  5733.      | Addressmode   |   Optimizing   |         Note            |
  5734.      Option |
  5735.      +--------------+---------------+------------------------+-------+
  5736.      +--------------+---------------+------------------------+-------+
  5737.      | jmp EA        | jmp EA         | No optimizing if there's|  -ODf
  5738.      | | rts           |                | a label before RTS      |
  5739.         |
  5740.      +--------------+---------------+------------------------+-------+
  5741.  
  5742.    * `MovemNoRegister'
  5743.  
  5744.      +---------------+----------------+-------------------------+--------+
  5745.      | Addressmode   |   Optimizing   |         Note            | Option |
  5746.      +---------------+----------------+-------------------------+--------+
  5747.      +---------------+----------------+-------------------------+--------+
  5748.      |  movem.l ,EA  |     Removed    |                         |        |
  5749.      +---------------+----------------+-------------------------+  -ODh  |
  5750.      |  movem.l EA,  |     Removed    |                         |        |
  5751.      +---------------+----------------+-------------------------+--------+
  5752.  
  5753.    * `MovemOneRegister'
  5754.  
  5755.      +---------------+----------------+-------------------------+--------+
  5756.      | Addressmode   |   Optimizing   |         Note            | Option |
  5757.      +---------------+----------------+-------------------------+--------+
  5758.      +---------------+----------------+-------------------------+--------+
  5759.      | movem.l Xn,EA |  Move.l Xn,EA  | Alter the status flags! |        |
  5760.      +---------------+----------------+-------------------------+  -ODi  |
  5761.      | movem.l EA,Xn |  Move.l EA,Xn  | Alter the status flags! |        |
  5762.      +---------------+----------------+-------------------------+--------+
  5763.  
  5764. Register Optimizing
  5765. -------------------
  5766.  
  5767.    * `#xxx' is switched off.
  5768.  
  5769.         * An address register is set free by `trashreg'.
  5770.  
  5771.           +---------------+--------------------+-------------------------+--------+
  5772.           | Addressmode   |   Optimizing       |         Note            | Option |
  5773.           +---------------+--------------------+-------------------------+--------+
  5774.           +---------------+--------------------+-------------------------+--------+
  5775.           |move.? EA,label| lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5776.           |               | move.? EA,(an)     |                         |  -OAR  |
  5777.           +---------------+--------------------+-------------------------+        |
  5778.           |  tst.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5779.           |               | tst.? (an)         |                         |        |
  5780.           +---------------+--------------------+-------------------------+        |
  5781.           |  not.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5782.           |               | not.? (an)         |                         |        |
  5783.           +---------------+--------------------+-------------------------+        |
  5784.           |  neg.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5785.           |               | neg.? (an)         |                         |        |
  5786.           +---------------+--------------------+-------------------------+        |
  5787.           |  negx.? label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5788.           |               | negx.? (an)        |                         |        |
  5789.           +---------------+--------------------+-------------------------+        |
  5790.           |  nbcd label   | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5791.           |               | nbcd (an)          |                         |        |
  5792.           +---------------+--------------------+-------------------------+        |
  5793.           |   scc label   | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5794.           |               | scc (an)           |                         |        |
  5795.           +---------------+--------------------+-------------------------+--------+
  5796.  
  5797.    * `#x' Optimizing on.
  5798.  
  5799.         * A data register is set free by `trashreg'.
  5800.  
  5801.           +---------------+--------------------+-------------------------+--------+
  5802.           | Addressmode   |   Optimizing       |         Note            | Option |
  5803.           +---------------+--------------------+-------------------------+--------+
  5804.           +---------------+--------------------+-------------------------+--------+
  5805.           | move.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5806.           |               | move.l dn,EA       |                         |  -OAR  |
  5807.           +---------------+--------------------+-------------------------+        |
  5808.           | ori.l  #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5809.           |               | or.l   dn,EA       |                         |        |
  5810.           +---------------+--------------------+-------------------------+        |
  5811.           | eori.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5812.           |               | eor.l  dn,EA       |                         |        |
  5813.           +---------------+--------------------+-------------------------+        |
  5814.           | andi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5815.           |               | and.l  dn,EA       |                         |        |
  5816.           +---------------+--------------------+-------------------------+        |
  5817.           | addi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5818.           |               | add.l  dn,EA       |                         |        |
  5819.           +---------------+--------------------+-------------------------+        |
  5820.           | subi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5821.           |               | sub.l  dn,EA       |                         |        |
  5822.           +---------------+--------------------+-------------------------+        |
  5823.           | cmpi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5824.           |               | cmp.l  EA,dn       |                         |        |
  5825.           +---------------+--------------------+-------------------------+        |
  5826.           | move.? #0,EA  | moveq  #0,dn       | Time optimizing         |        |
  5827.           |               | move.l dn,EA       | must be on              |        |
  5828.           +---------------+--------------------+-------------------------+--------+
  5829.  
  5830. How does Optimizing work ?
  5831. --------------------------
  5832.  
  5833.    In single-pass Optimizing the assembler can only optimize commands
  5834. where it can resolve the reference in the first pass.  This means the
  5835. label or symbol has to be known before.  In multi-pass Optimizing it
  5836. can optimize every command without bothering where the label is defined.
  5837. The Assembler keeps all labels each pass but increases a change counter
  5838. if the old contents differs with the new contents.  The exception is
  5839. that the assembler can't optimize commands that depend on symbols that
  5840. are defined after the command.  The reason is that the Assembler has to
  5841. remove each pass every symbol to avoid problems with `IFD' and `IFND'
  5842. that can cause that certain areas aren't assembled in multi-pass mode.
  5843. You probably noticed that i assume that nobody used `IFD' or `IFND'
  5844. with labels because that would also break multi-pass.
  5845.  
  5846.    An example for a construct that can't be optimized.
  5847.  
  5848.           move.l #1,NULL(a0)
  5849.      NULL=0
  5850.  
  5851. Problems...
  5852. -----------
  5853.  
  5854.    You should always be careful with optimizing because it can cause
  5855. bugs in certain source areas.  Branch optimizing for example has to be
  5856. switched off if you use JMP-Towers.
  5857.  
  5858.  
  5859.           lsl.w #1,d0
  5860.           jmp   Tower(pc,d0.w)
  5861.      
  5862.       Tower:
  5863.           bra.w func1
  5864.           bra.w func2
  5865.           bra.w func3
  5866.      
  5867.       could be be optimized to
  5868.      
  5869.       Tower:
  5870.           bra.w func1
  5871.           bra.s func2
  5872.           bra.s func3
  5873.      
  5874.       that leads to program bugs.
  5875.      
  5876.       Solution:
  5877.      
  5878.       bopt OD6-
  5879.      
  5880.       Tower:
  5881.           bra.w func1
  5882.           bra.w func2
  5883.           bra.w func3
  5884.      
  5885.       bopt OD6+
  5886.  
  5887. Preassembled Includes
  5888. =====================
  5889.  
  5890.    If you want to assemble a program that needs to load a lot includes
  5891. it's useful to preassemble the includes and load one file because  the
  5892. real slowdown factor is the need loading time.   You can only use
  5893. absolut symbols and macros in a preassembled file.   All relative and
  5894. symbols defined by `set' aren't written into  a preassembled file.
  5895. The created file isn't compress to avoid any slowdown but if  the file
  5896. size is critical you can compress the file by xpk and  load it through
  5897. the xfh filesystem.
  5898.  
  5899.      basm -p Source.S creates the preassembled file Source.p
  5900.  
  5901.  
  5902.      An error location could be absolut symbols that are calculated  by
  5903.      relative symbols. You should avoid these symbols.
  5904.  
  5905.      Symbol=Label1-Label2
  5906.  
  5907.  
  5908. Resident includes
  5909. =================
  5910.  
  5911.    `BASM' can control an Include and Incbin database by the library
  5912. `cachefile.library' to get rid of the loading delays.  The files in the
  5913. database can be shown and deleted.
  5914.  
  5915. Basm Assembler System
  5916. =====================
  5917.  
  5918. Cli Calling Convention
  5919. ----------------------
  5920.  
  5921.    `Format:'
  5922.  
  5923.      BASM [-Option] Name
  5924.  
  5925.  
  5926.    This is the commandline version of the assembler and can be easy
  5927. integrated in own development system, for example `Make' and `CED'.  An
  5928. assembler error is indicated by the result 20 and the result 10 is used
  5929. if no source file were specified.
  5930.  
  5931.    * `Option'
  5932.  
  5933.      The same options are accepted that are described in the assembler
  5934.      command *Note BOPT: MI_BOPT.  The following options are accepted
  5935.      additionally.
  5936.  
  5937.         * A[+,-] Turns ARexx mode on/off
  5938.  
  5939.         * C <Configuration> loads a configuration file
  5940.  
  5941.         * d <Symbol=Value> defines a symbol
  5942.  
  5943.    * `Standard-Optionen'
  5944.  
  5945.  
  5946.           ;All other options are deactivated.
  5947.           
  5948.           c+,e+,m1000,wo+,ws+,wm+,w2+,w4+,wp+
  5949.           b1+,B0+,n1+
  5950.           OC0+,OC1+,OC2+,OC3+,OC4+,OC5+,OC6+,OC7+,
  5951.           ODD+,OD0+,OD1+,OD2+,OD3+,OD4+,OD5+,OD6+,OD7+,OD8+,
  5952.           OD9+,ODc+,ODe+,ODf+,ODg+
  5953.           OAP+,OAL+,OAX+,OAY+,OAZ+,OAR+
  5954.  
  5955. Configuration
  5956. -------------
  5957.  
  5958. Global
  5959. ......
  5960.  
  5961.    You can define the global configuration through the file
  5962. `ENV:BASMOption'. The internal standard configuration  is not replaced
  5963. but can only be changed.
  5964.  
  5965.    File `ENV:BASMOption'
  5966.  
  5967.  
  5968.       -v
  5969.       -f
  5970.       -c-
  5971.       -iASM:
  5972.  
  5973.      If a line doesn't start with - it's ignored.
  5974.  
  5975.  
  5976. WB Tooltypes
  5977. ............
  5978.  
  5979.    Additionally you can also define the above described configuration
  5980. options in the tooltypes of the source file icon.   Furthermore `BASM'
  5981. allows a special tooltype to define  an output window.
  5982.  
  5983.    o Window= <Window Defintion>
  5984.  
  5985. ARexx
  5986. =====
  5987.  
  5988.    The `BASM' ARexx Port Name is `rexx_BASM' and the  ARexx Script
  5989. suffix `.basm'.   To activate the `BASM' ARexx mode you have to start
  5990. `BASM' with the option -A.
  5991.  
  5992. BASM
  5993. ....
  5994.  
  5995.    `BASM [-Option] Name'
  5996.  
  5997.    This ARexx command starts the assembler and coincides with the
  5998. CLI-syntax structure.
  5999.  
  6000. BEND
  6001. ....
  6002.  
  6003.    `BEND'
  6004.  
  6005.    This ARexx command closes the ARexx port and shuts down the
  6006. assembler.
  6007.  
  6008. BGETERROR
  6009. .........
  6010.  
  6011.    `BGETERROR'
  6012.  
  6013.    With this ARexx command you will receive an explanation of the actual
  6014. errors. If no errors exist it will return a status code 20.
  6015.  
  6016.    Error Format String
  6017.  
  6018.    OFFSET|FILE|<Error Description>
  6019.  
  6020. BNEXTERROR
  6021. ..........
  6022.  
  6023.    `BNEXTERROR'
  6024.  
  6025.    This ARexx command will cause a jump to the next error in the list.
  6026. If there are no further errors in the list it will return a status
  6027. code 20.
  6028.  
  6029. BINITERROR
  6030. ..........
  6031.  
  6032.    `BINITERROR'
  6033.  
  6034.    This ARexx command will cause a jump to the first entry in the error
  6035. list. If no error exists it will return a status code 20.
  6036.  
  6037. BGETWARNING
  6038. ...........
  6039.  
  6040.    `BGETWARNING'
  6041.  
  6042.    works like `BGETERROR' only for Warnings.
  6043.  
  6044. BNEXTWARNING
  6045. ............
  6046.  
  6047.    `BNEXTWARNING'
  6048.  
  6049.    works like `BNEXTERROR' only for Warnings.
  6050.  
  6051. BINITWARNING
  6052. ............
  6053.  
  6054.    `BINITWARNING'
  6055.  
  6056.    works like `BINITERROR' only for Warnings.
  6057.  
  6058. Compatibility
  6059. =============
  6060.  
  6061. to other assemblers...
  6062. ----------------------
  6063.  
  6064.  
  6065.      Unfortunately `BASM' can't be 100% compatible to every assembler
  6066.      on the amiga market.  Thus you can expect problems with different
  6067.      sources.  In general you can expect problems with commands that
  6068.      don't belong to a standard like option commands.  Furthermore you
  6069.      should also be careful with sources that directly depend on the
  6070.      assembler implementation.  Because `BASM' is a 1-Pass Assembler in
  6071.      the normal mode with an additional backpatch phase you shouldn't
  6072.      define symbols that can't be resolved at once.  An ideal example
  6073.      for this practice is the `Xoper2.2' Source that was developed with
  6074.      the PD Assembler A68k.  While assembling with `BASM' the assembler
  6075.      detects that a not defined symbols is accessed through the `SET'
  6076.      command.  Generally this should cause an error at once but
  6077.      unfortunately `A68k' doesn't show anything and uses the last value
  6078.      of `cmdnum'.
  6079.  
  6080.  
  6081.  
  6082.           ADDCMD        MACRO
  6083.           cmdnum        set     cmdnum+1
  6084.                   dc.b    \1,0
  6085.                   ENDM
  6086.                       .
  6087.                       .
  6088.                       .
  6089.           ;Here it's using `cmdnum' although
  6090.           ;the symbol wasn't defined yet
  6091.                   addq    #1,d2
  6092.                   cmp.w   #cmdnum,d2
  6093.                   bne.s   1$
  6094.                       .
  6095.                       .
  6096.                       .
  6097.           
  6098.           ;Here the cmdnum is first defined
  6099.           cmdnum        set      0
  6100.           commds        ADDCMD  'time'
  6101.                   ADDCMD  'taskpri'
  6102.                   ADDCMD  'info'
  6103.                   ADDCMD  'pri'
  6104.                   ADDCMD  'flush'
  6105.  
  6106.      Because the A68k is a 2-Pass Assembler he can assemble this Source
  6107.      without problems.
  6108.  
  6109.  
  6110.      Another Problem is that the assembler argument parser doesn't
  6111.      detect Overflow because of speed reasons. I don't think it's worth
  6112.      it...if you differ tell me your opinion.
  6113.  
  6114.  
  6115.      The assembler doesn't support the following motorola syntax bugs
  6116.      because of the internal structure of the parser it would cause
  6117.      major problems in the multi-pass mode.
  6118.  
  6119.  
  6120.           symbol: equ 0
  6121.           symbol: equr d0
  6122.  
  6123. C-Compiler Assembler
  6124. --------------------
  6125.  
  6126. Dice
  6127. ....
  6128.  
  6129.    If you use Basm as a `DASM' replacement you have to run `Basm' with
  6130. the option -OAS to activate the Smalldata mode.  If you want to emulate
  6131. the advanced `Link', `UnLink', `Movem' optimizing `DASM' supports you
  6132. have to use the options -O, -OG, -ODh, -ODi and -ODj.  The option -OG
  6133. is needed because the link stackframe register list symbols are defined
  6134. after the commands so the assembler doesn't know them in 1 pass mode.
  6135. Sorry...i had to disable this mode because i later detected that i have
  6136. to keep track of the used registers.  I'll try to fix this in a later
  6137. version
  6138.  
  6139. Literature
  6140. **********
  6141.  
  6142.    * [Addison Wesley] RKM Libraries 2.04,CATS
  6143.  
  6144.    * [Addison Wesley] RKM Devices 2.04,CATS
  6145.  
  6146.    * [Addison Wesley] RKM Autodocs\&Includes 2.04,CATS
  6147.  
  6148.    * [Addison Wesley] RKM Hardware 2.04,CATS
  6149.  
  6150.    * [Addison Wesley] RKM Styleguide,CATS
  6151.  
  6152.    * [Addison Wesley] RKM Libraries 1.1,CATS
  6153.  
  6154.    * [Addison Wesley] RKM Intuition 1.1,CATS
  6155.  
  6156.    * [Addison Wesley] RKM Exec 1.1,CATS
  6157.  
  6158.    * [Addison Wesley] RKM Hardware 1.1,CATS
  6159.  
  6160.    * [Edotronik] Kommentiertes Rom-Listing 1,Dr. Ruprecht
  6161.  
  6162.    * [Edotronik] Kommentiertes Rom-Listing 2,Dr. Ruprecht
  6163.  
  6164.    * [Edotronik] Kommentiertes Rom-Listing 3,Dr. Ruprecht
  6165.  
  6166.    * [Ralph Babel] Guru Book,Selbstvertrieb
  6167.  
  6168. Software
  6169. ********
  6170.  
  6171.    For the development of Barfly the following programs were used:
  6172.  
  6173.    * [CATS] Developer CD V2.0
  6174.  
  6175.    * [B.Hawes] WShell V2.0
  6176.  
  6177.    * [M.Sinz] Enforcer
  6178.  
  6179.    * [R.Schmidt] CyberGuard
  6180.  
  6181.    * [C.Scheppner] Mungwall
  6182.  
  6183.    * [SAS Institute] SAS/C
  6184.  
  6185.    * [GNU] GCC
  6186.  
  6187.    * [ASDG] CED
  6188.  
  6189.    * [Georg Hessmann] PasTex
  6190.  
  6191.    * [Stefan Stuntz] MFR 2.0d
  6192.  
  6193.    * [Mathias Scheler] Filer
  6194.  
  6195.    * [Matthew Dillon] DNet
  6196.  
  6197.    * [Brian Cerveny] Grapevine
  6198.  
  6199.    * [Ezy] MLink
  6200.  
  6201. Assembler Addressmodes
  6202. **********************
  6203.  
  6204.      +--------------+------------------------+
  6205.      |   Notation   | Description            |
  6206.      +--------------+------------------------+
  6207.      +--------------+------------------------+
  6208.      |      EA      | Effective Address      |
  6209.      |      Dn      | D0...D7                |
  6210.      |      An      | A0...A7                |
  6211.      |      Xn      | D0...D7, A0...A7       |
  6212.      |      .b      | Operand Width  8Bit    |
  6213.      |      .w      | Operand Width 16Bit    |
  6214.      |      .l      | Operand Width 32Bit    |
  6215.      |     size     | w,l                    |
  6216.      |     Size     | b,w,l                  |
  6217.      |     Scale    | 1,2,4 or 8             |
  6218.      | Xn.size*Scale| 68000-10 only Scale 1. |
  6219.      +---------------------------------------+
  6220.  
  6221. `Data register direct'
  6222.      Syntax: Dn
  6223.  
  6224. `Address register direct'
  6225.      Syntax: An
  6226.  
  6227. `Address register indirect'
  6228.      Syntax: (An)
  6229.  
  6230. `Address register indirect with postincrement'
  6231.      Syntax: (An)+
  6232.  
  6233. `Address register indirect with predecrement'
  6234.      Syntax: -(An)
  6235.  
  6236. `Address register indirect with offset'
  6237.      Syntax: bd.w(An)
  6238.  
  6239. `Address register indirect with index and offset'
  6240.      Syntax: bd.b(An,Xn{.Size*Scale})
  6241.  
  6242. `Address register indirect with index and offset'
  6243.      Syntax: (bd,An,Xn{.Size*Scale})
  6244.  
  6245. `Address register indirect with index and offset'
  6246.      Syntax: (bd.b,An,Xn{.Size*Scale})
  6247.  
  6248. `Address register indirect with index and base displacement'
  6249.      Syntax: ({bd.size{,An{,Xn{.Size{*Scale}}}}})
  6250.  
  6251. `Indirect Memory Addressierung mit postindex'
  6252.      Syntax: ({[{bd.size{,An}}]}{Xn{.Size{*Scale}{,od.size}}})
  6253.  
  6254. `Indirect Memory Addressierung mit preindex'
  6255.      Syntax: ({[{bd.size{,An}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6256.  
  6257. `PC Indirect'
  6258.      Syntax: (PC)
  6259.  
  6260. `PC Indirect with offset'
  6261.      Syntax: bd.w(PC)
  6262.  
  6263. `PC Indirect with index and offset'
  6264.      Syntax: bd.b(PC,Xn{.Size*Scale})
  6265.  
  6266. `PC Indirect with index and offset'
  6267.      Syntax: bd.b(ZPC,Xn{.Size*Scale})
  6268.  
  6269. `PC Indirect with index and base displacement'
  6270.      Syntax: ({bd.size{,PC{,Xn{.Size{*Scale}}}}})
  6271.  
  6272. `PC Indirect with index and base displacement'
  6273.      Syntax: ({bd.size{,ZPC{,Xn{.Size{*Scale}}}}})
  6274.  
  6275. `PC Indirect memory Addressing with post-index'
  6276.      Syntax: ({[{bd.size{,PC}}]}{,Xn{.Size{*Scale}{,od.size}}})
  6277.  
  6278. `PC Indirect memory Addressing with post-index'
  6279.      Syntax: ({[{bd.size{,ZPC}}]}{,Xn{.Size{*Scale}{,od.size}}})
  6280.  
  6281. `PC Indirect memory Addressing with pre-index'
  6282.      Syntax: ({[{bd.size{,PC}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6283.  
  6284. `PC Indirect memory addressing with pre-index'
  6285.      Syntax: ({[{bd.size{,ZPC}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6286.  
  6287. `Absolut short'
  6288.      Syntax: bd.w
  6289.  
  6290. `Absolut long'
  6291.      Syntax: bd[.l]
  6292.  
  6293. `Immediate Data'
  6294.      Syntax: #xxx
  6295.  
  6296. Addressmode Examples
  6297. ====================
  6298.  
  6299.    To avoid some problems here are some small examples how addressmode
  6300. have to build up.
  6301.  
  6302.  
  6303.      x=$40
  6304.      y=$400
  6305.        move.b (x,A0,D2.W),D0
  6306.        move.b x(A0,D2.W),D0
  6307.      
  6308.      ;Both lines are correct
  6309.      ;(x,a0,d2.w) is optimized internal to (x,a0,d2.w).
  6310.      ;For more information please check the chapter about
  6311.      ;Optimizing Direct Addressmodes.
  6312.      
  6313.        move.b (y,A0,D2.W),D0
  6314.        move.b y(A0,D2.W),D0
  6315.      
  6316.      ;Now you get 2 errors, because y is not an 8bit word.
  6317.      ;These 2 lines shows the correct version.
  6318.      
  6319.        move.b (y.w,A0,D2.W),D0
  6320.        move.b (y.w,A0,D2.W),D0
  6321.      
  6322.      ;or
  6323.      
  6324.        move.b (y.l,A0,D2.W),D0
  6325.        move.b (y.l,A0,D2.W),D0
  6326.  
  6327. 680xx Opcode Overview
  6328. *********************
  6329.  
  6330.      +----------+---------+-------------------------------------------+
  6331.      |  Opcode  |  Size   | 68000 68010 68020 68030 68040 68060 6888x |
  6332.      +----------+---------+-------------------------------------------+
  6333.      +----------+---------+-------------------------------------------+
  6334.      | abcd     | b       |   x     x     x     x     x     x         |
  6335.      | add      | b,w,l   |   x     x     x     x     x     x         |
  6336.      | addq     | b,w,l   |   x     x     x     x     x     x         |
  6337.      | adda     | w,l     |   x     x     x     x     x     x         |
  6338.      | addi     | b,w,l   |   x     x     x     x     x     x         |
  6339.      | addx     | b,w,l   |   x     x     x     x     x     x         |
  6340.      | and      | b,w,l   |   x     x     x     x     x     x         |
  6341.      | andi     | b,w,l   |   x     x     x     x     x     x         |
  6342.      | asr      | b,w,l   |   x     x     x     x     x     x         |
  6343.      | asl      | b,w,l   |   x     x     x     x     x     x         |
  6344.      | bcc      | b,w,l   |   x     x     x     x     x     x         |
  6345.      | bchg     | b,l     |   x     x     x     x     x     x         |
  6346.      | bclr     | b,l     |   x     x     x     x     x     x         |
  6347.      | bfchg    | unsized |               x     x     x     x         |
  6348.      | bfclr    | unsized |               x     x     x     x         |
  6349.      | bfext    | unsized |               x     x     x     x         |
  6350.      | bfffo    | unsized |               x     x     x     x         |
  6351.      | bfins    | unsized |               x     x     x     x         |
  6352.      | bfset    | unsized |               x     x     x     x         |
  6353.      | bftst    | unsized |               x     x     x     x         |
  6354.      | bkpt     | unsized |         x     x     x     x     x         |
  6355.      | bset     | b,l     |   x     x     x     x     x     x         |
  6356.      | btst     | b,l     |   x     x     x     x     x     x         |
  6357.      | callm    | unsized |               x                           |
  6358.      | cas      | b,w,l   |   x     x     x     x     x     x,2       |
  6359.      | cas2     | b,w,l   |   x     x     x     x     x     x,2       |
  6360.      | chk      | b,w,l   |   x     x     x     x     x     x         |
  6361.      | chk2     | b,w,l   |               x     x     x     2         |
  6362.      | cinv¹    | unsized |                           x     x         |
  6363.      | clr      | b,w,l   |   x     x     x     x     x     x         |
  6364.      | cmp      | b,w,l   |   x     x     x     x     x     x         |
  6365.      | cmpa     | w,l     |   x     x     x     x     x     x         |
  6366.      | cmpi     | b,w,l   |   x     x     x     x     x     x         |
  6367.      | cmpm     | b,w,l   |   x     x     x     x     x     x         |
  6368.      | cmp2     | b,w,l   |               x     x     x     2         |
  6369.      | cpush¹   | unsized |                           x     x         |
  6370.      | dbcc     | w       |   x     x     x     x     x     x         |
  6371.      | divs     | w,l     |   x     x     x     x     x     x,2       |
  6372.      | divsl    | l       |               x     x     x     x         |
  6373.      | divu     | w,l     |   x     x     x     x     x     x,2       |
  6374.      | divul    | l       |               x     x     x     x         |
  6375.      | eor      | b,w,l   |   x     x     x     x     x     x         |
  6376.      | eori     | b,w,l   |   x     x     x     x     x     x         |
  6377.      | eori/ccr | b       |   x     x     x     x     x     x         |
  6378.      | eori/sr¹ | w       |   x     x     x     x     x     x         |
  6379.      | exg      | l       |   x     x     x     x     x     x         |
  6380.      | ext      | w,l     |   x     x     x     x     x     x         |
  6381.      | extb     | l       |               x     x     x     x         |
  6382.      | fabs     |         |                           x     x     x   |
  6383.      | fsabs    |         |                           x     x         |
  6384.      | fdabs    |         |                           x     x         |
  6385.      | facos    |         |                           2     2     x   |
  6386.      | fadd     |         |                           x     x     x   |
  6387.      | fsadd    |         |                           x     x         |
  6388.      | fdadd    |         |                           x     x         |
  6389.      | fasin    |         |                           2     2     x   |
  6390.      | fatan    |         |                           2     2     x   |
  6391.      | fatanh   |         |                           2     2     x   |
  6392.      | fbcc     |         |                           x     x     x   |
  6393.      | fcmp     |         |                           x     x     x   |
  6394.      | fcos     |         |                           2     2     x   |
  6395.      | fcosh    |         |                           2     2     x   |
  6396.      | fdbcc    |         |                           x     2     x   |
  6397.      | fdiv     |         |                           x     x     x   |
  6398.      | fsdiv    |         |                           x     x         |
  6399.      | fddiv    |         |                           x     x         |
  6400.      | fetox    |         |                           2     2     x   |
  6401.      | fetoxm1  |         |                           2     2     x   |
  6402.      | fgetexp  |         |                           2     2     x   |
  6403.      | fgetman  |         |                           2     2     x   |
  6404.      | fint     |         |                           2     x     x   |
  6405.      | fintrz   |         |                           2     x     x   |
  6406.      | flogn    |         |                           2     2     x   |
  6407.      | flognp1  |         |                           2     2     x   |
  6408.      | flog2    |         |                           2     2     x   |
  6409.      | flog10   |         |                           2     2     x   |
  6410.      | fmod     |         |                           2     2     x   |
  6411.      | fmove    |         |                           x     x     x   |
  6412.      | fsmove   |         |                           x     x         |
  6413.      | fdmove   |         |                           x     x         |
  6414.      | fmovecr  |         |                           2     2     x   |
  6415.      | fmovem   |         |                           x     x,2   x   |
  6416.      | fmul     |         |                           x     x     x   |
  6417.      | fsmul    |         |                           x     x         |
  6418.      | fdmul    |         |                           x     x         |
  6419.      | fneg     |         |                           x     x     x   |
  6420.      | fsneg    |         |                           x     x         |
  6421.      | fdneg    |         |                           x     x         |
  6422.      | fnop     |         |                           x     x     x   |
  6423.      | frem     |         |                           2     2     x   |
  6424.      | frestore¹|         |                           x     x     x   |
  6425.      | fscc     |         |                           2     2     x   |
  6426.      | fsub     |         |                           x     x     x   |
  6427.      | fssub    |         |                           x     x         |
  6428.      | fdsub    |         |                           x     x         |
  6429.      | fsave¹   |         |                           x     x     x   |
  6430.      | fscale   |         |                           2     2     x   |
  6431.      | fsglmul  |         |                           2     2     x   |
  6432.      | fsgldiv  |         |                           2     2     x   |
  6433.      | fsin     |         |                           2     2     x   |
  6434.      | fsinh    |         |                           2     2     x   |
  6435.      | fsincos  |         |                           2     2     x   |
  6436.      | fsqrt    |         |                           x     x     x   |
  6437.      | fssqrt   |         |                           x     x         |
  6438.      | fdsqrt   |         |                           x     x         |
  6439.      | ftan     |         |                           2     2     x   |
  6440.      | ftanh    |         |                           2     2     x   |
  6441.      | ftentox  |         |                           2     2     x   |
  6442.      | ftrap    |         |                           x     2     x   |
  6443.      | ftst     |         |                           x     x     x   |
  6444.      | ftwotox  |         |                           2     2     x   |
  6445.      | illegal  | unsized |   x     x     x     x     x     x         |
  6446.      | jmp      | unsized |   x     x     x     x     x     x         |
  6447.      | jsr      | unsized |   x     x     x     x     x     x         |
  6448.      | lea      | l       |   x     x     x     x     x     x         |
  6449.      | link     | w,l     |   x     x     x     x     x     x         |
  6450.      | lpstop   |         |                                 x         |
  6451.      | lsl      | b,w,l   |   x     x     x     x     x     x         |
  6452.      | lsr      | b,w,l   |   x     x     x     x     x     x         |
  6453.      | move     | b,w,l   |   x     x     x     x     x     x         |
  6454.      | movea    | w,l     |   x     x     x     x     x     x         |
  6455.      | moveq    | l       |   x     x     x     x     x     x         |
  6456.      | movec¹   | l       |         x     x     x     x     x         |
  6457.      | movem    | w,l     |   x     x     x     x     x     x         |
  6458.      | movep    | w,l     |   x     x     x     x     x               |
  6459.      | moves¹   | b,w,l   |         x     x     x     x     x         |
  6460.      | move16   |         |                           x     x         |
  6461.      | muls     | w,l     |   x     x     x     x     x     x         |
  6462.      | mulu     | w,l     |   x     x     x     x     x     x         |
  6463.      | nbcd     | b       |   x     x     x     x     x     x         |
  6464.      | neg      | b,w,l   |   x     x     x     x     x     x         |
  6465.      | negx     | b,w,l   |   x     x     x     x     x     x         |
  6466.      | nop      | unsized |   x     x     x     x     x     x         |
  6467.      | not      | b,w,l   |   x     x     x     x     x     x         |
  6468.      | or       | b,w,l   |   x     x     x     x     x     x         |
  6469.      | ori      | b,w,l   |   x     x     x     x     x     x         |
  6470.      | pack     | unsized |               x     x     x     x         |
  6471.      | pea      | l       |   x     x     x     x     x     x         |
  6472.      | pflush¹  | unsized |                     x     x     x         |
  6473.      | pflusha¹ | unsized |                     x                     |
  6474.      | plpa¹    | unsized |                                 x         |
  6475.      | pload¹   | unsized |                     x                     |
  6476.      | pmove¹   | w,l,q   |                     x                     |
  6477.      | ptest¹   | unsized |                     x     x               |
  6478.      | reset¹   | unsized |   x     x     x     x     x     x         |
  6479.      | rol      | b,w,l   |   x     x     x     x     x     x         |
  6480.      | ror      | b,w,l   |   x     x     x     x     x     x         |
  6481.      | roxl     | b,w,l   |   x     x     x     x     x     x         |
  6482.      | roxr     | b,w,l   |   x     x     x     x     x     x         |
  6483.      | rtd      | unsized |         x     x     x     x     x         |
  6484.      | rte¹     | unsized |   x     x     x     x     x     x         |
  6485.      | rtr      | unsized |   x     x     x     x     x     x         |
  6486.      | rts      | unsized |   x     x     x     x     x     x         |
  6487.      | rtm      | unsized |               x                           |
  6488.      | sbcd     | b       |   x     x     x     x     x     x         |
  6489.      | scc      | b       |   x     x     x     x     x     x         |
  6490.      | stop¹    | unsized |   x     x     x     x     x     x         |
  6491.      | sub      | b,w,l   |   x     x     x     x     x     x         |
  6492.      | subq     | b,w,l   |   x     x     x     x     x     x         |
  6493.      | suba     | w,l     |   x     x     x     x     x     x         |
  6494.      | subi     | b,w,l   |   x     x     x     x     x     x         |
  6495.      | subx     | b,w,l   |   x     x     x     x     x     x         |
  6496.      | swap     | w       |   x     x     x     x     x     x         |
  6497.      | tas      | b       |   x     x     x     x     x     x         |
  6498.      | trap     | unsized |   x     x     x     x     x     x         |
  6499.      | trapcc   | ? ,w,l  |               x     x     x     x         |
  6500.      | trapv    | unsized |   x     x     x     x     x     x         |
  6501.      | tst      | b,w,l   |   x     x     x     x     x     x         |
  6502.      | unlk     | unsized |   x     x     x     x     x     x         |
  6503.      | unpk     | unsized |               x     x     x     x         |
  6504.      +----------+---------+-------------------------------------------+
  6505.      
  6506.      ¹ Supervisor instruction
  6507.      2 These are software-supported instructions on the 68040 and 68060
  6508.  
  6509.