{Documentation for Barfly

{

Ralph Schmidt

Kleiner Hellweg 4 D-33154 Salzkotten Germany Internet: laire@mises.uni-paderborn.de IRC: laire

{

{Version 1.0


[ < ] [ > ]   [Contents] [Index] [ ? ]

Barfly 1.0

An Intuition controled Debugger and Optimizing Assembler

Copyright (c) 1989-94 Ralph Schmidt

- Shareware -


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 Basic Informations


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Copyright and other legal stuff

Copyright (c) 1989-94 Ralph Schmidt

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

No guarantee of any kind is given that the programs described in this document are 100% reliable. You are using this material at your own risk. The author can not be made responsible for any damage which is caused by using these programs.

Permission is granted to include this package in Public-Domain collections, especially in Fred Fishs Amiga Disk Library (including CD-ROM versions of it). The distribution file may be uploaded to Bulletin Board Systems or FTP servers. If you want to distribute this program you must use the original distribution archive ‘Barfly.lha’.

None of the programs may be included or used in commercial programs unless by written permission from the author.

None of the programs may be modified in any way. This especially includes changing the copyright notices or removing any of the Shareware restrictions.

None of the programs may be used on any machine which is used for the research, development, construction, testing or production of weapons or other military applications. This also includes any machine which is used for training persons for any of the above mentioned purposes.

None of the programs may be used by more than the registrated owner.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Registration

As you may have noticed in the copyright I’m working for five years at Barfly. It has always consumed and will continue to consume a large amount of my time.

I cannot afford just working for fun. Thus, I decided to release Barfly as Shareware. I had already tried to release Barfly as a commercial product but the story behind it is more than sad. To sum it…german Amiga software companys aren’t worth any time...‘they suck’. Some people may think the price is too high for a Shareware product but i think that BAsm is as powerful as the 2 main available commercial Assemblers…if not more powerful if you compare the speed and the optimize functions;there’s no commercial Debugger available that can compete with BDebug. I’ve used Barfly myself for commercial Amiga applications. Cyberstorm 060, Z3-Fastlane device, CDRive, SCSIConfig,...

The unregistered version of Barfly pops up the About requester at the start and has some functions disabled:

Assembler:
 o only 8192Bytes large code possible
 o the Section commands aren't available
Debugger:
 o Only 1 Window per Object
 o Enforcer,CyberGuard Catch not available
 o Task Catch not available
 o Crashed Task Catch not available
 o Limited Step count(about 150-200 Steps)

Registered users will be shipped a disk with the newest public release of Barfly, along with a personalized, so-called “keyfile”. It enables all the missing features and disables the Shareware reminders. This keyfile will work with all future releases of Barfly, so you can simply download the latest version from your local bulletin board without having to wait weeks for your update passing through the slow mail channels. The keyfile ‘must not’ be distributed in any way.

The fee for a Barfly registration is

 70.- DM  (D-Mark),
 70.- SFr (Schweizer Franken),
230.- FF  (French Francs),
 50.- US$ (US Dollar)

The fastest, cheapest and easiest way to register is put the money together with the filled registration form into a letter and send it to

Please allow 2-8 weeks delivery for the registrated version. Currently I am very busy with my civil service and working for Phase5 so please be patient.

Ralph Schmidt
Kleiner Hellweg 4
33154 Salzkotten
FR Germany
Phone: +49-5258-5637
E-Mail: laire@mises.uni-paderborn.de
   Irc: Laire on #amiga,#amigager


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2 Introduction


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Purpose

BDebug is an Intuition controled multi-task system Debugger for OS 2.04 and newer.

You can use BDebug to debugging your programs, catching tasks, reseach Enforcer and CyberGuard hits, follow Source-Level Informations and other advanced functions. The Debugger supports assemblers, SAS C, Dice and GCC.

Some of BDebug’s features are:

BAsm is a very fast optimizing Assembler for OS 2.04 and newer.

Some of BAsm’s features are:


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 System requirements

Barfly requires Amiga operating system version 2.04 or better.

Kickstart 1.3 is not supported; this operating system is considered obsolete.

Barfly requires at least one megabyte of RAM to run. A hardisk or a faster CPU is not required but increase performances and comfort, of course.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Installation

It is really easy to install Barfly:

1. Copy the the binary and the icon (called “BDebug” and “BDebug.info”) to any directory.

2. Copy the the binary and the icon (called “BAsm” and “BAsm.info”) to any directory.

Then copy the supplied configuration files from “s/Barfly/#?” to “S:” directory of your system partition or create env:Barflypath with the path to a directory that contains Barfly/#?.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3 Other topics


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Updates

Whenever a new release of Barfly gets released, I will post some information in the appropriate newsgroups of some electronic networks. The new archive will soon be available on many bulletin boards and on all ‘AmiNet’ FTP servers. Major releases will also come with some PD disks, especially on Fred Fish’s collection.

As mentioned above, registered users will neither need a new keyfile nor a special personalized program version. They can use all new features immediately.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Support

If you have some questions, comments, suggestions or even flames, please feel free to contact me at one of the following addresses. If you send your letter via e-mail, there’s a good chance for getting a quick reply.

Snailmail: Ralph Schmidt
           Kleiner Hellweg 4
           33154 Salzkotten
           FR Germany

    Phone: +49-5258-5637

�  E-Mail: laire@mises.uni-paderborn.de
      Irc: Laire on #amiga, #amigager


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 History


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Future

Here are some ideas for future versions of BDebug:

Important:

There is absolutely NO guarantee that these features will ever be
implemented. So don't be disappointed, if they aren't in the next
version.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5 Acknowledegments

Thanks must go to:

And of course to all the other Beta testers and registered users.

The V40 Includes can be ftp’ed from the FTP-Server.

ftp.rz.uni-wuerzburg.de: pub/amiga/frozenfish/bbs/com

A superb Linker "lk" by Alex Wilke should be soon availble on Aminet.

BDebug 1.0

An Intuition controled Debugger

Copyright (c) 1989-94 Ralph Schmidt

- Shareware -


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 The Command Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 Debugger Philosophy

BDebug is a multitasking Debugger that supports the Motorola processors 68000…68060 and 68881…68882. The Debugger allows to debug unlimited tasks parallel. Because of the Debugger’s complexity BDebug was designed in an object-oriented way to allow an easy and comfortable way to use it. The register window ‘REGWindow’ is the Root class of the task object that can be expanded by several subclass windows. Every subclass window has privat menus and inherits the public menus of its father object.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 Debug Methods

The Debugger offers a variety of different Debug methods that can be activated by menu or gadget.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.1 Debug Task

is used to select a task you wann to debug. If you doubleclick on a task a ‘REGWindow’ and a couple of information windows opens. Which type and how many are opened depends on the current configuration. After the task could be stopped the contents of the ‘REGWindow’ and all other information windows gets refreshed. If the task is in the ‘Wait’ state the task is stopped when it gets a signal.

Task Listview Layout

Taskaddress & Priority & Status & Name

Process Listview Layout

Taskaddress & Priority & Status & Name[CLI Number,CLI Name]

You should know what task you can stop and what kind of task should never be stopped. For example the Input.device should never be stopped.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.2 Debug File

is used to load and stop a program. This function is equal to the bdebug cli startup with the exception that you can enter the parameter in a requester. If no error occur all configurated windows are opened and the PC stops at the defined programstart breakpoint that normally points to the first command of the program.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.3 Debug Next Task

is used to debug the next task that is opened. The Debugger waits until another task is created by AddTask and a couple of information windows opens. Which type and how many are opened depends on the current configuration. After the new task was caught the pc points to the beginning of the task and ‘Catch Next Task’ is disactivated. To catch a program that is started from the WV you have to use ‘Debug Next Task’ to catch the WB Startup Task ‘WBL’ that starts the program. Now you have to activate ‘Debug Next Task’ again and let the current task run. After a short time the task ‘WBL’ ends and the program’s task is caught.

You should avoid to start a new task between the 2 ‘Debug Next Task’ phases because it’s easy to catch the wrong one.

You should notice that ‘AddTask’ is patched and points to a new routine. Thus you should be careful with programs that also patch ‘AddTask’. Furthermore it’s useful to know in what sequences these patches have to be removed. The Debugger can only be closed when all patched system function that were installed after the Debugger was started are removed.

If you start a program in the shell without ‘c:Run’ no new task is created. Instead the program is run as a subroutine in shell’s task so you can’t catch the task that easy.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.4 Debug Crashed Task

is used to catch tasks that crash so you track down the bug location a lot easier. If the system itself doesn’t run anymore you shouldn’t expect that bdebug still runs because it depends on a working system. If a task crashes and the option ‘Debug Crashed Task’ is activated a couple of information windows opens. Which type and how many are opened depends on the current configuration. ‘Task Held Requester’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.5 Catch Enforcer Hit

is used to tell the Debugger to stop the task it controls when an Enforcer or CyberGuard hit happens. Unfortunately the Debugger can’t always stop the task at exactly the same location where the hit happened. Mostly the hit command is 1-2 instructions above the stopped task’s PC.

This function needs Enforcer V37.x by M. Sinz or CyberGuard V1.x and it must be installed before BDebug is launched. Please read the documentation.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.0.6 Select Display Mode

This function allows you to choose Screen Mode for the Debugger.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 How to start ?

If you only want to debug a program you have to start bdebug with the program’s name and parameters or by using ‘Debug Program’ in the command window. Another method is to move a program’s icon on the command window or specify BDebug as in the icon as the ‘DefaultTool’.

Name:

BDEBUG - The CLI Startup

Synopnis:

BDEBUG [?] [<Program> [Argument] ]

Function:

BDebug activates the Debugger, loads and stops the optionally entered program. If it can find a local config file with the suffix *.bdebug it loads it.

Inputs


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 The Register Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1.1 Register Window

The register window is the most important control layer of the Debugger and every debugged task has one. You can link unlimited other information windows to the ‘REGWindow’ or you can tell the Debugger to give up controling the task. In the title line of the window you can see the ID number of the task, so you can recognize what information window belongs to this task. Furthermore the title line also contains the task address, the state, ‘RUN’, ‘WAIT’ or ‘STOP’ and the name of the task. The task is in the ‘RUN’ state if the task has the control at the moment instead of the traphandler; the task is in the ‘STOP’ state when the task waits and the traphandler controls what happens. The task is the ‘WAIT’ state only when the Debugger has to wait to catch a task by a ‘Debug Task’. In the upper area of the window you see the normal data and address registers where the address register also have additional information fields. To change a register or to watch memory where the register points to you only need to doubleclick on the register or on the register’s memory contents. Furthermore you may change other usermode registers by this method. Supervisor register can’t be changed because that doesn’t make much sense for a system Debugger.

68000 Registers

D0=xxxxxxxx yyyy A0=xxxxxxxx Arg1 Arg2 [!]

D1=xxxxxxxx yyyy A1=xxxxxxxx Arg1 Arg2 [!]

D2=xxxxxxxx yyyy A2=xxxxxxxx Arg1 Arg2 [!]

D3=xxxxxxxx yyyy A3=xxxxxxxx Arg1 Arg2 [!]

D4=xxxxxxxx yyyy A4=xxxxxxxx Arg1 Arg2 [!]

D5=xxxxxxxx yyyy A5=xxxxxxxx Arg1 Arg2 [!]

D6=xxxxxxxx yyyy A6=xxxxxxxx Arg1 Arg2 [!]

D7=xxxxxxxx yyyy A7=xxxxxxxx Arg1 Arg2 [!]

USP=xxxxxxxx SSP=xxxxxxxx PC=xxxxxxxx SR=xxxx

68010 Registers

VBR=xxxxxxxx SFC=xxxxxxxx DFC=xxxxxxxx

68020 Registers

VBR=xxxxxxxx SFC=xxxxxxxx DFC=xxxxxxxx

MSP=xxxxxxxx ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx

68030 Registers

VBR=xxxxxxxx SFC=xxxxxxxx DFC=xxxxxxxx

MSP=xxxxxxxx ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx

CRP=xxxxxxxxxxxxxxxx SRP=xxxxxxxxxxxxxxxx

TT0=xxxxxxxx TT1=xxxxxxxx TC=xxxx PSR=xxxxxxxx

68040 Registers

VBR=xxxxxxxx SFC=xxxxxxxx DFC=xxxxxxxx

MSP=xxxxxxxx ISP=xxxxxxxx CACR=xxxxxxxx

URP=xxxxxxxx SRP=xxxxxxxx TC=xxxx PSR=xxxxxxxx

ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx

68060 Registers

VBR=xxxxxxxx SFC=xxxxxxxx DFC=xxxxxxxx

CACR=xxxxxxxx PCR=xxxxxxxx BUSCR=xxxxxxxx

URP=xxxxxxxx SRP=xxxxxxxx TC=xxxx PSR=xxxxxxxx

ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx

Type Information

xxxxxxxx [Symbol] Mnemonic operand1[,…]]

(EA): [Address1=Contents]…[Address2=Contents]

In the ‘(EA)’ line you can see the addresses and their contents the current command accesses. The contents of illegal addresses aren’t shown.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1.3 Public Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 The FPU Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1.1 FPU Window

The FPU Window shows the FPU register FP0 to FP7 in the 96Bit Extended format and the registers FPCR, FPSR and FPIAR in hexadecimal. You can only open this window if a FPU is available.

Register Window Layout

FP0=FloatingPoint

FP1=FloatingPoint

FP2=FloatingPoint

FP3=FloatingPoint

FP4=FloatingPoint

FP5=FloatingPoint

FP6=FloatingPoint

FP7=FloatingPoint

FPCR=xxxxxxxx FPSR=xxxxxxxx

FPIAR=xxxxxxxx


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 The Disassembler Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1.1 Disassembler window

The ‘DissWindow’ shows the memory contents in assembler mnemonics. The address of the window’s view can be absolute or relative. In absolut mode, the window shows the contents of a fixed address, indicated by the window title ‘No Link’. In relative mode the window is connected to a register causing the window to update when the the register value changes. This is indicated by the window title which reads ‘Link to *’, where * represents the register name. The PC is shown by the colour pen 2. If the linked register value is outside of the window’s view area the whole contents of the window will be refreshed. You can change size of the window and scroll through the memory area by using the cursors. In the title you see an ID-String with the format ‘\#x.y’ where ‘X’ represents the ‘REGWindow’ number and ‘y’ the number of the ‘MemWindow’. Doubleclicking a line of the window sets or remove a breakpoint. You can disable this function in the configuration.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 The Memory Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1.1 Memory window

The ‘MemWindow’ shows the memory contents hexadecimal and in ascii.You can change size of the window and scroll through the memory area whith the cursor keys. In the title you see an ID-String with the format ‘\#x.y’ where ‘X’ represents the ‘REGWindow’ number and ‘y’ the number of the ‘MemWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1 The Copper Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.1 CopperWindow

The ‘CopperWindow’ shows the memory contents as copper commands. The window is sizeable, and you can use the cursor keys to scroll through the memry area. In the title you see an ID-String with the format ‘\#x.y’ where ‘X’ represents the ‘REGWindow’ number and ‘y’ the number of the ‘CoppWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1 The Structure Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1.1 StructWindow

opens window which can be connected with a structure. You can use new structure entries by expanding the the ‘<BarflyPath>/Barfly/Barfly.Include’ file or loading a new custom file. By a doubleclick on a structure window entry you can cause several actions depending on the datatype. Every datatype is connected with an action that is normally started automaticlly. With the configuration command ‘NoAutoStructAction’ you can change this behaviour so that an action type requester is opened.

The following datatypes are available.

The following action types are available.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1.2 Structure Macro Fileformat

This section describes the file format of structure macros. In the beginning you define the root directory entries with the first Macro ‘Menudir’. The first parameter is the name of the entry, then the address of the parent directory and then the address of the subdirectory. In the root directory the parent address is obviously NULL. The last entry of the directory is defined by the Macro ‘MENUDIREND’.

Label                   ListViewMacro           Link’
RootDir:
                        .
                        .
                        MENUDIR                 exec,0,Exec_Dir
                        .
                        .
MYCUSTOMENTRY:							
                        MENUDIREND              CUSTOM,0,0	

The design of a subdirectory only differs from the root directory entries only by a parent directory address.

Label                   ListViewMacro           Link’
Exec_Dir:
                        .
                        .
                        MENUDIR                 nodes.i,RootDir,Nodes_Dir
                        .
                        .
                        MENUDIREND              tasks.i,RootDir,Tasks_Dir

to define the structure directory entries you have to use ‘MENUITEM’ and ‘MENUITEMEND’. The first parameter in the Item Macros is the name of the entry and also the name of the structure. The second parameter defines the address of the parent directory.

Label                   ListViewMacro           Link’
                        .
                        .
Nodes_Dir:
                        MENUITEM                LN,Exec_Dir	
                        .
                        .
                        MENUITEMEND

To define a structure you can use the normal assembler syntax that you probably have to adjust to your custom needs. For example you can tell BDebug more informations about the datatype an entry represents. By redefining ‘APTR’ to a ‘CSTR’ you can tell the Debugger that the entry is a stringpointer. Another example is defining that ‘APTR’ points to a structure by ‘APTR LN_SUCC,Node’.

Label                   IncludeTypeMacro        Name,Link’
LN_Struct:
                        STRUCTUREB              LN,0
                        APTR                    LN_SUCC,LN
                        APTR                    LN_PRED,LN
                        UBYTE                   LN_TYPE
                        BYTE                    LN_PRI
                        CCSTR                   LN_NAME
                        LABEL                   LN_SIZE

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1.3 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1 The Structure Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1.1 Source window

The ‘SourceWindow’ shows the source line that belongs to the window address. If the program file doesn’t have the needed debug informations the ‘Source window’ can’t be opened. If the address points to an area with no relevant debug information, for example the Kickstart or beyond the program hunks, all you see is a small message.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.1 The Snoop Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.1.1 Snoop Window

The ‘SnoopWindow’ snoops the task’s allocations.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1 The Breakpoint Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1.1 Breakpoint window

The ‘BreakWindow’ handles all breakpoints and contains the functions that are needed with breakpoints. In general, breakpoints are addresses in the program where the task should be stopped. The breakpoints are handled globally so they aren’t deleted when close the window.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14.1 The Watchpoint Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14.1.1 Watchpoint window

The ‘Watchwindow’ allows to set breakpoints that aren’t depending on a certain PC address but on other conditions. Every watchpoint has a condition, data width and can have one of 3 different watchpoints states. The ‘Memory’ watchpoint compares the saved contents of the address with the current contents and dependent on the condition the program is stopped or not. The ‘Register’ watchpoint compares the saved contents of a register with the current contents and dependent on the condition the program is stopped or not. The ‘Argument’ watchpoint compares the saved value of an argument with the current contents and dependent on the condition the program is stopped or not. The last watchpoint type is the most powerful because it can simulate the first two types with the cost of a slowdown. The use of watchpoints is very time consuming because the whole program is run in single step mode. In order to use watchpoi you have to run the task with ‘Run Watched Task’.

If an error occurs in the exception handler during the evaluation of a dynamic arugment, the screen flashes.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.1 The Checksum Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.1.1 Checksum Window

The ‘ChecksumWindow’ controls all checksum areas that are controlled each time the task stops. Helpful to find illegal random writes bugs. The checkpoints are controled globally so they aren’t deleted when you close the window.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.1.2 Local Menus


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16.1 Requester Arguments


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16.1.1 Argument Structur

An argument can use absolut values, symbols and registers as operands and the operators +,-,*,/,|,!,&,<<,>>,~. Additionally to the normal symbols, some special symbols are available.

If you have the following Enforcer or CyberGuard hit output ‘Hunk 0:$11c’ you can calculate the address by entering the argument #h0+$11c.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1 Technical Informations


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1.1 Exceptions

The Debugger can catch all exceptions if the system is still working. If an exception is caused, the traphandler catches the exception and tells the Debugger what went on so it can react on the exception. If the exception wasn’t caused by the Debugger, the type and the possible reason for the exception is shown. The ‘Return-address’ of the debugged task points on an internal ‘ILLEGAL’. If the processor encounters this ‘ILLEGAL’ the task is closed and all windows are removed. You shouldn’t step over this ‘ILLEGAL’ because it increases the possibility of a system crash. If a task is caught by ‘Debug Next Task’ and notices a custom ‘finalPC’ routine in the ‘Addtask()’ function, the ‘Return-address’ isn’t set on the internal ‘ILLEGAL’ cleanup function because the ‘finalPC’ pointer is sometimes used for parsing an argument. In this case the Debugger notices that the task ends by using the ‘RemTask()’ function.

If the task changes the ‘Return-address’ the Debugger tries to determine the taskend by ‘RemTask’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1.2 Exception Handler

Every task has a pointer in its task structure that points to its exception handler, named ‘TC_TRAPCODE’. When you load a program through the Debugger, the Debugger’s standard exception handler is installed. It works basicly the same for ‘Catch Next Task’ and ‘Debug Task’. The only difference is the ‘Debug Crashed Task’ mode where the Debugger sets a special catch exception handler in each task that isn’t controlled by the Debugger. When an exception occurs and the Debugger’s exception handler is called the Debugger first checks if it knows the task that caused it. If this is not the case something seriously is broken and the Deadend Alert 35000000 will be popped up. If all goes well the registers are saved, the Debugger task gets a message and the exception handler waits for a message by the Debugger to go on. When the Debugger gets the message it causes the appropriate function. For example refreshing the windows. If the Debugger gets a step command it sends the exception handler the appropriate message and the handler does a step.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1.3 Debug Informations

Currently the following formats are supported.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1.4 GCC Compiler and BDebug

Unfortunately you can’t debug programs that are using the current ‘ixemul.library’ because in Openlibrary() initroutine the Task field TC_TRAPCODE is changed. Hopefully there’ll be soon an ‘ixemul.library’ available that doesn’t change the traphandler. If you’re using GCC with the link lib ‘gerlib’ that is available on Aminet FTP Servers you shouldn’t experience any problems with BDebug.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1 Configuration

The default configuration file is named ‘BDEBUG.Config’ and is located in the directory ‘<BarflyPath>/’ or ‘s:Barfly/’. Obviously it’s not optimal to be forced to use the same config file for different programs. Therefore you can also specify a local config file with program name and the suffix ‘.BDebug’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.1 ToolTypes

The following tooltypes are supported to activate the basic functions of the commandwindow.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.2 Barfly.FD

Following steps are necessary to create a new ‘Barfly.FD’ file with new library functions. First the assign ‘FD:’ must point to the directory containing the FD files that should be included in the new ‘Barfly.FD’. Make sure that every FD file contains the Library, Resource and Device name in the first line in following format: ‘* "foobar.libary"’. If necessary, add the name yourself, so that a correct FD database can be build up. If you’re more experienced with FD files, you can yourself add new entries to the ‘Barfly.FD’ file. The layout of the ‘Barfly.FD’ file pretty obvious.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.3 Configuration Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.4 Register window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.4.1 RegWindow=x/y/width/height/register

This command defines the position of a ‘REGWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.4.2 RegFlags=flag[|flags…]

This command defines certain flags in the ‘REGWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.5 FPU Window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.5.1 FpuWindow=x/y/width/height/register

This command defines the position of a ‘FPUWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.5.2 OpenFPUWindows=Count

This command tells the Debugger to open a ‘FPUWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.6 Disassembler window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.6.1 DissWindow=x/y/width/height/register

This command defines the position,the dimension and linked register of the ‘DissWindow’.

Example: DISSWINDOW=0/0/300/100/PC


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.6.2 DissFlags=flag[|flags…]

This command defines certain flags in the ‘DISSWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.6.3 OpenDissWindows=Count

This command tells the Debugger to open a number of ‘DissWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.7 Memory window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.7.1 MemWindow=x/y/width/height/register

This command defines the position, the dimension and linked register of the ‘MemWindow’.

Example: MEMWINDOW=0/0/300/100/A0


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.7.2 OpenMemWindows=Count

This command tells the Debugger to open a number of ‘MemWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.7.3 MemoryOffsetStep=Count

This command defines the Offset-Step of the ‘MemWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.8 Copper window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.8.1 CoppWindow=x/y/width/height/register

This command defines the position, the dimension and linked register of the ‘CoppWindow’.

Example: COPPWINDOW=0/0/300/100/A0


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.8.2 OpenCoppWindows=Count

This command tells the Debugger to open a number of ‘CoppWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.9 StructWindow


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.9.1 StructWindow=x/y/width/height/register

This command defines the position, the dimension and linked register of the ‘StructWindow’.

Example: StructWINDOW=0/0/300/100/A0


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.9.2 StructFlags=flag[|flags…]

This command defines certain flags for the ‘StructWindow


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.9.3 OpenStructWindows=Count

This command tells the Debugger to open a number of ‘StructWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.10 Source window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.10.1 SourceWindow=x/y/width/height/register

This command defines the position, the dimension and linked register of the ‘SourceWindow’.

Example: SOURCEWINDOW=0/0/300/100/A0


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.10.2 OpenSourceWindows=Count

This command tells the Debugger to open a number of ‘SourceWindows’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.11 Breakpoint window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.11.1 BreakWindow=x/y/width/height

This command defines the position of a ‘BreakPointWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.11.2 OpenBreakWindows=Count

This command tells the Debugger to open a ‘BreakPointWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.12 Watchpoint window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.12.1 WatchWindow=x/y/width/height

This command defines the position of a ‘WatchpoinzWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.12.2 OpenWatchWindows=Count

This command tells the Debugger to open a ‘WatchPointWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.13 Checksum window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.13.1 ChecksumWindow=x/y/width/height

This command defines the position of a ‘ChecksumWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.13.2 ChecksumWindows=Count

This command tells the Debugger to open a ‘ChecksumWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14 SnoopMemory window


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14.1 SnoopMemWindow=x/y/width/height/register

This command defines the position of a ‘SnoopMemWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14.2 OpenSnoopMemWindow=Count

This command tells the Debugger to open a ‘SnoopMemWindow’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14.3 SnoopMask=Mask

This command defines the snoop mask. The mask defines the length of memory blocks that should be recorded. Default is -1 so everything is recorded.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14.4 SnoopMax=Count

This command defines the count of snoop entries. Default is 100.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.14.5 HistoryEntrys=Count

This command defines the count of history entries. Default is 5.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.15 Information Windows


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.15.1 GlobalViewWindow=x/y/width/height

This command defines the position and dimensions of a standard information window. For example the Library Window belongs to this group.

Example: GLOBALVIEWWINDOW=0/0/300/100 GLOBALVIEWWINDOW=0/200/300/100


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.16 Other Windows


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.16.1 CommandWindow=x/y/width/height

This command defines the position of the small ‘CommandWindow’. This command has no function in local configuration files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.16.2 FileShell=<Window Specifikation>

This command defines the shell that is opened with the loaded program. You should always open the shell on the Debugger’s Public Screen. The shell parameters are the same you know from the CLI.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17 Misc


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.1 TaskStack=Count

This command defines the stack of the loaded program. Defaullt are 4096 Bytes.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.2 Priority=Count

This command defines the Debugger’s priority.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.3 SetBreak=Argument

This command can be used to define a list of breakpoints that are set before the program is started. This is useful to pass the module ‘Main.c’ for example. If no breakpoints are defined or if a parsing problem occurs the standard breakpoint ( the first program instruction ) is set.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.4 ClickBreak=State

This command can be used to define the action of the DissWindow on a doubleclick.

State=0

No Action(Default).

State=1

Set/Clear Breakpoint and pop up a Requester for a Set.

State=2

Set/Clear Breakpoint.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.5 ShowMem=Start:End

defines the address areas that are legal to the Debugger so you can look at address areas that are not in the memorylist or in the rom. Illegal address areas are shown with ‘*’ in the windows. You should ‘never’ define the custom chip areas as legal because a read access on a writeonly register can cause a deadly crash.

Example: SHOWMEM=$e80000:$f00000 defines the Zorro 2 area as free.

By this command you can overrule the internal Enforcer or CyberGuard legal memory areas so you should be free of hits.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.6 DefCommand=Key,Qualifier[|Qualifier…],Function

This commands allows to connect menu functions with key sequences. Because of the object-oriented concept of the Debugger that allows multiple instances of objects it’s not easy to decide what object is meant. Therefore if the object is active it’s used and if no object of this type is active the first entry the object-type list is used. As the key parameter every Rawkey can be used with the exception of ‘TAB’ and the functionkeys that are used internally. The key is searched first in the local and then in the global configuration.

As qualifiers you can use the following keys.

Bespiel: DEFCOMMAND=$15,CTRL,"Step 1 Position"

Defines CTRL-Z as Step 1 Position


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.7 AutoDocDir=<Path>

This command sets the path for the autodocs directory.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.8 AutoDocAlias=Library,File

This command sets an alias for Libraries, Devices or Resources to define the connected Autodocs file. There’s no other way because it’s impossible to build the autodocs file by knowing the library name.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.9 ArexxPath=<rx-path>

This command sets the Arexx-Script Start-Command. In a normal system the path should be <sys:Rexxc/rx>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.10 ArexxInput=<File>

This command sets the Arexx-Command Input-File. If you don’t specify the file, NIL: is used.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.11 ArexxOutput=<File>

This command sets the Arexx-Command Output-File. If you don’t specify the file, NIL: is used.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.12 ArexxCommand=[1…10],<Pfad>

This command sets the 10 entries in the Arexx-Menu. You specify the number and the path of the Arexx-Script.

ArexxCommand=1,"Rexx:Example.rexx"


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.13 ExecuteCommand=<File>

this command can set up a list of programs that should be run before the debugged program’s task is started. This parameter only works with programs which are loaded by the Debugger. You also have to make sure that the loaded programs have to ‘end’ otherwise the task can’t be started. For example you could use this command to set breakpoints with Arexx-Scripts.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.14 LoadInclude

tells the Debugger to load the structure information file ‘Barfly.Include’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.15 AddStructFile=Filename

tells the Debugger to load a custom structure information file and adds it into the CUSTOM/ subtree.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.16 ClicktoFront

activates the Debugger’s own ‘ClicktoFront’ handler. This function should only be used if you don’t use an own ‘Commodity’ for this task.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.17 CenterWindow

activates centering mode for all stringrequester windows.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.18 ScreenInFront

activates ‘ScreenToFront’ mode that pops the screen to front after every trace operation.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.19 OpenScreen[=width,height,depth,mode]

tells the Debugger to open its own screen. If you don’t enter dimension parameters the wb screen is cloned. For the mode string you string you can see in ‘Prefs/ScreenMode’ requester. This command has no function in local configuration files.

OPENSCREEN=1448,560,2,PAL:HighRes Interlace


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.20 OpenPubScreen=Name

tells the Debugger to open on the Pubscreen with the specified name. This command has no function in local configuration files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.21 ScreenFont=fontname/Height

defines a font for a Debugger screen. This command has no function in local configuration files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.22 QuietException=Exception Nummer

masks off certain exceptions for the exception requester so that only a ‘DisplayBeep’ is caused instead of a textrequest. With the value -1 you can mask off every exception and for example with the value 4 you mask off the ‘Illegal’ exception.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.23 DisableXPointer

deactivate the Wait-Pointer.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.24 TraceBreak

tells the Debugger to use breakpoints in the ‘Subroutine’ Traces instead of single steps. The advantage is a speed up and the disadvantage is that you can cause crashes while you step through resident/reentry code.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.25 CrashedTask

activates ‘CatchCrashedTask’ mode.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.26 CatchEnforcerHit

activates ‘CatchEnforcerHit’ mode.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.27 DoNotCacheFullFile

tells the Debugger not to cache program files while reading the Symbol/Debug informations to save memory. Obviously the parsing speed will decrease.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.28 DoNotPopPathRequest

tells the Debugger to ignore errors from opening source files and not to open a path requester.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.29 NoAutoStructAction

tells the Debugger to open a type-requester by an action in the Structure Window.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.1.17.30 NoBreakpointErrors

tells the Debugger to ignore SETBREAK= errors that cause the Debugger to always set an error on the program start.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19.1 Arexx


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19.1.1 Commands

RC : 0=Ok Result: Result-String

RC : 0=Ok Result: Result-String

RC : 0=Ok Result: Result-String

RC : 0=Ok

RC : 0=Ok

RC : 0=Ok

RC : 0=Ok Result: Filepath-String

RC : 0=Ok Result: Filepath-String


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20 Usage of BDebug


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.1 How to use BDebug ?


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.1.1 Trouble Shooting

First you should be sure that all necessary configurations file have been installed because without ‘Barfly.FD’ file you don’t see any function names in the disassembler window; and without ‘Barfly.Include’ the ‘StructWindow’ is unusable. Are these preconditions fullfilled you should analyse the problem and anticipate how the Debugger can be used. Because the debugging of programs depends heavily on the situation i can only list some general points. The reality probably looks different… as always:-)

Point of departure:

After you’ve taken the first hurdles in taking control over the task, you should think about how the problem looks like and where it could be located.

Problem Type:


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.1.2 Problems that can happen

BAsm 1.0

A cli/arexx controled Assembler

Copyright (c) 1989-94 Ralph Schmidt

- Shareware -


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21 The Assembler

The assembler understands the commands and addressmodes from the 68000 through the 68060 and both the Floating-Point Units, 68881 and 68882. It supports only the 68851 MMU commands, which are also supported by the 68030. The assembler achieves it’s speed by translating the source in a single pass, followed by a backpatch phase which corrects all unresolved references.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1 Syntax


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.1 Comments

A comment can start in several different ways. In a pure comment it starts either with a <;> or <*>. A comment can only be started after an assembler command or symbol with a <;> if an assembler command or symbol exists within that line.

	;A comment
*A comment
	move.l a0,a0	;A comment

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.2 Opcode/Instructions arrangement

[label[:]] [opcode] [operand[, operand[, operand…]]]]]


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.3 Symbol structure

A symbol can represent the following types:

Symbols can only be defined once. The exceptions are local labels and symbols defined by <Set>.

Structure rules for Symbols.

ThisIsALabel              ;That is a normal label
ThisIsALabel1.loop:       ;That is a normal label
This@_Is_@A_@Label
1$:                       ;That is a numerical local label
.ThisIsALabel             ;That is a local label
.ThisIsALael1:            ;That is a local label
\ThisIsALabel.loop:       ;That is a local label
ThisIsASymbol=10
ThisIsASymbol = 10
ThisIsASymbol equ 10


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.4 The relative label

This symbol represents an offset to the start of a program.

label
label:
label	nop
label: nop


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.5 The local Label

A local label is only valid between two normal relative labels, thus you cannot reference local labels outside of that scope. Otherwise it works similar as a normal label. There are 2 different prefixes that introduce a local label: <.> and <\> that define 2 different local labels. A special case is the Backward Reference Label that is introduced with <..>. It doesn’t depend on a certain define area between normal labels thus you can only access the symbol if it were defined earlier.

..:
label_0:
.local:
 bra.s .local
label_1:
.local:
 bra.s \local
\local:
 nop
label_end:
..:
 dbra d0,..
..:
 dbra d1,..
..Hello:
 dbra d1,..Hello

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.6 The local numerical label

Addionally to the non-numerical local label there are also the numerical labels which are based of 4 digits with the postfix <$>. <BASM> handles the number as a hash key with the consequence that there’s no difference between <001$> and <1$>.

label_0:
123$:	nop
label_1:
123$:	nop


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.7 The absolute Symbol

The absolute symbol is defined by a direct value initializing that is initiated by <=>, <equ> or <set>. If you define a symbol by <set> you can change it as often as needed.

value1=2
value2 equ value1*2
value3 set value2



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.8 The Register Symbol

The register symbol is defined by ‘equr’ or ‘fequr’ that is used for FPU registers.

Ptr	equr	a1
PI	fequr	fp2
 move.l   (Ptr),d0   ;move.l  (a1),d0
 fmove.x  PI,fp0     ;fmove.x fp2,fp0

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.9 The Register List Symbol

The register list symbol is defined by ‘reg’ and represents the register mask for ‘Movem’ and ‘fmovem’. You must not mix FPU and Integer registers with each other in a register list.

mask	reg	d0/d2/d4-d7/a0-a4/a6-a7
mask1	reg	d0-a6
mask2	reg	d0-6
fmask	reg	fp0-fp2/fp4-fp5


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.10 The Macro Symbol

By using the command ‘macro’ or ‘cmacro’ after the symbol, the symbol is defined as a macro. The macro block is terminated by the command <endm>. The Macro <cmacro> is case-insensitive and therefore useful to emulate commands that are missing from the core.


Symbol[:] macro
.
.
Symbol[:] endm


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.11 Datatypes

The assembler understands 3 distinct datatypes.

At the moment only integer datatypes are supported in arithmetic arguments so you can only use the FPU datatypes as constants.

+-------------+--------------------+
| Format      | Representation     |
+-------------+--------------------+
+-------------+--------------------+
| Decimal     | 1024               |
+-------------+--------------------+
| Hexadecimal | $400               |
+-------------+--------------------+
| Binary      | %10000000000       |
+-------------+--------------------+
| Ascii       | "OK", 'OK' or `OK` |
+-------------+--------------------+

Furthermore you can use symbols or the character ‘*’ that represents the program counter in arguments. There are limitation in the use of symbols in arguments. For example you can only add or subtract constants from an external label, Floatingpoint Values can only be used as simple constants,… By the postfix ‘k’ after decimal value the value is multply by $1000.

Floating Point Format

+-------------+-------------------------------------+
| Format      | Representation                      |
+-------------+-------------------------------------+
+-------------+-------------------------------------+
| Extended    | '[+,-]3. 145637848298628[e[+,-]123] |
+-------------+-------------------------------------+
| Packed      | ''[+,-]3. 145637848298628[e[+,-]123]|
+-------------+-------------------------------------+

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.12 Datatype Conversion

All commands are performed with these 3 datatypes and then converted into the required datatype. For example a 32Bit integer can be converted into 16Bit and 8 Bit; an extended floating point into a double or single floating point. Floating point datatypes are rounded by a convertation. If a rouding error occurs the parser returns with an error.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.13 Datatype Format

Internal Datatype Structure

+--------+---------+
| Bit 31 | 30..0   |
+--------+---------+
+--------+---------+
|    S   | Integer |
+--------+---------+
+--------+-----------------+------------+
| Bit 31 | Bits 30..23     | Bits 22..0 |
+--------+-----------------+------------+
+--------+-----------------+------------+
|  Sign  | Biased Exponent |  Fraction  |
+--------+-----------------+------------+
+--------+-----------------+------------+
| Bit 63 | Bits 62..52     | Bits 51..0 |
+--------+-----------------+------------+
+--------+-----------------+------------+
|  Sign  | Biased Exponent |  Fraction  |
+--------+-----------------+------------+
+--------+-----------------+------------+
| Bit 95 | Bits 94..80     | Bits 62..0 |
+--------+-----------------+------------+
+--------+-----------------+------------+
|  Sign  | Biased Exponent |  Mantisse  |
+--------+-----------------+------------+
+------+------+------+------+------+------+------+------+
| MEYY | EXP2 | EXP1 | EXP0 | EXP3 | 0000 | 0000 | M016 |
+------+------+------+------+------+------+------+------+
| M015 | M014 | M013 | M012 | M011 | M010 | M009 | M008 |
+------+------+------+------+------+------+------+------+
| M007 | M006 | M005 | M004 | M003 | M002 | M001 | M000 |
+------+------+------+------+------+------+------+------+

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.14 Operations


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.15 Operators

+----------+-------------------------------+
| Operator | Function                      |
+----------+-------------------------------+
+----------+-------------------------------+
|   `+'    | 32Bit signed Addition         |
+----------+-------------------------------+
|   `-'    | 32Bit signed Subtraction      |
+----------+-------------------------------+
|   `*'    | 32Bit signed Multiplication   |
+----------+-------------------------------+
|   `/'    | 32Bit signed Division         |
+----------+-------------------------------+
|   '|'    | 32Bit Or                      |
+----------+-------------------------------+
|   `!'    | 32Bit Or                      |
+----------+-------------------------------+
|   `&'    | 32Bit And                     |
+----------+-------------------------------+
|   `^'    | 32Bit Eor                     |
+----------+-------------------------------+
|   `<<'   | logic 32Bit Shift to the left |
+----------+-------------------------------+
|   `>>'   | logic 32Bit Shift to the right|
+----------+-------------------------------+
|   `~'    | 32Bit Not                     |
+----------+-------------------------------+

Basm cares for the operator priorities but be careful while porting Seka Sources because Seka doesn’t care for the priorities.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.1.16 Functions

The following functions are supported.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2 Assembler Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1 Hunk/Link Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.1 [Label] section Name[,Typ[,[RelocModus,Memtyp]

defines a new logical unit so that the DOS-Loader has the opportuntity to place smaller hunks into free memory blocks. Another use for this command is to set different memory types for the hunk to load gfx data into the chipmem. If you don’t specify the section type it assumes <"",Code,Public>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.2 [Label] code [Name[, Memtyp]]

defines a new code hunk and is equivalent to the command ‘section ?,code,?’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.3 [Label] data [Name[, Memtyp]]

defines a new data hunk and is equivalent to the command ‘section ?,data,?’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.4 [Label] bss [Name[, Memtyp]]

defines a new BSS hunk and is equivalent to the command ‘section ?,bss,?’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.5 [Label] cseg [Name[, Memtyp]]

has the same function as the command ‘code’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.6 [Label] dseg [Name[, Memtyp]]

has the same function as the command ‘data’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.7 idnt Name

defines the name of the ‘HUNK_UNIT’ hunk in the object file.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.8 identify Name

defines the name of the actual hunk.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.9 BDebugArg Argument

defines a parameter in env:BDebugProgram. It doesn’t active this function you have to activate by option "-J" in BOPT.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.10 smalldata [Register]

activates smalldata mode for the hunk. Optionally, you can also define the smalldata register. Default register is ‘A4’. The program itself must initialize the smalldata register with the address of the smalldata data hunk.

 bopt	w2-			;68020 addressmode warnings off
 mc68020			;68020 mode activated

 smalldata	a3		;Default is A4!!!
 xref	_LinkerDB		;Special linker symbol

 lea.l	_LinkerDB,a3		;Address of the smalldata data segments
 move.l	#0,(d_test.l,a3)
 move.l	#"TEST",d_test(a3)
 moveq	#0,d0
 tst.b	array(a3,d0.w)
 rts

 section	"__MERGED",BSS	;The smalldata data segments are defined
                                ;the following way
d_test:
 ds.l	1
array:
 ds.b	20



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.11 xref Symbol[, Symbol…]

imports a symbol so that you can access symbols that were exported by <XDef>. The linker resolves these reference during the link process and creates a program file. If the assembler finds a <XRef> in the source it creates an object file. This decision can be overruled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.12 xdef Symbol[, Symbol…]

exports a symbol as global so that other object files can import the symbol by <XRef>. There’s no need to define a symbol before you mark them with <XDef>. If the assembler finds a <XRef> in the source it creates an object file. This decision can be overruled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.13 global Symbol[, Symbol…]

has the same function like <XDef>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.14 public Symbol[, Symbol…]

has the same function like <XDef>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.15 output Name

sets an output filename. If you don’t specify a filename the assembler uses the source filename and adds the appropriate filetype suffix.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.16 objfile

has the same function like <Output>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.17 exeobj

writes a program file if you want to overrule the assembler.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.18 linkobj

writes an object file if you want to overrule the assembler.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.19 org Address

activates absolute mode. All command that refer to hunk related functions aren’t allowed. For example:. <section>, <xdef>, <xref>. The parameter address sets the base address of the created code.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.20 addsym

writes a symbol hunk.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.1.21 debug

writes a SAS D1 debug hunk to see source level informations while debugging the program through bdebug.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2 Symbol Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.1 CArgs [#Offset,]Symbol[,Symbol.w[,Symbol.l]

defines the symbol offsets for a stack function. The first Symbol starts with the offset 4 but if you like to use a different Offset it’s possible to specify one. Then the offset is increased according to the size of the symbol. If the symbol has no size specifier the default size is word. Sorry..i would use a longword here but to be compatible with Devpac i’m forced to use word.

 cargs Test1.w,Test2.l
 move.w	Test1(a7),d0	;Test1=4
 move.l	Test2(a7),d0	;Test2=4+2=6


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.2 Symbol rs[.width] Count

initializes the Symbol with the value of the counter __RS and increases the __RS counter afterwards by Count*Width. You can use this command as a replacement for the include <exec/types.i> macros to increase the parsing speed.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.3 Symbol so[.width] Count

This command has the same function like <rs> with the exception that the Symbol __SO is used instead of the __RS symbol. Internally both symbols are handled equal. Devpac has introduced the symbol __RS and Macro68k knows the functionality by the name __SO.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.4 Symbol fo[.width] Count

decreases the counter __FO by Count*Width and initializes the Symbol with the new value. Useful to create the negative local stackframe symbols needed by <link>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.5 rsreset

initializes the counter __RS to 0.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.6 rsset Value

initializes the counter __RS with the Value


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.7 clrso

has the same function like <rsreset>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.8 clrfo

has the same function like <foreset>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.9 setso Value

has the same function like <rsset>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.10 setrs Value

has the same function like <rsset>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.11 setfo Value

initializes the counter __FO with the Value


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.12 Symbol rsval

initializes the Symbol with the value of the __RS counter.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.13 Symbol soval

has the same function like <rsval>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.2.14 Symbol foval

initializes the Symbol with the value of the __FO counter.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3 Data Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.1 align Value

aligns the program counter to an address that can be devided by the value. Useful because certain DOS structures have to be aligned on 4 Byte boundaries. For example <FileInfoBlock>. Furthermore it’s also useful to align subroutines on longword boundaries that they fit better into the cache structure.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.2 cnop Offset,Align

aligns the program counter to an address that can be devided by the Align value and adds the value onto the address. Internally only Align values < 16 are supported.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.3 pad.Width Align[,Value]

aligns the program counter to an address that can be devided by the Align*Width and fills the aligned area by the optional mask value.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.4 quad

aligns the program counter to a 16 Byte address.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.5 even

aligns the program counter to an even address. This function is useful if you define an odd sized data area and you need a word aligned for OS data structures or assembler instructions.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.6 odd

aligns the program counter to an odd address.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.7 dc[.width] Value[,Value…]

inserts data of the Width into the code.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.8 db Value[,Value,…]

inserts a byte with a value in the valuearea -$80 <= x < $100.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.9 dw Value[,Value,…]

inserts a word with a value in the valuearea -$8000 <= x < $10000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.10 dl Value[,Value,…]

inserts a longword with a value in the valuearea -$80000000 <= x < $100000000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.11 ub Value[,Value,…]

inserts a byte with a value in the valuearea -$80 <= x < $80.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.12 uw Value[,Value,…]

inserts a word with a value in the valuearea -$8000 <= x < $8000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.13 ul Value[,Value,…]

inserts a longword with a value in the valuearea -$80000000 <= x < $80000000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.14 sb Value[,Value,…]

inserts a byte with a value in the valuearea -$80 <= x < $100.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.15 sw Value[,Value,…]

inserts a word with a value in the valuearea -$8000 <= x < $10000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.16 sl Value[,Value,…]

inserts a longword with a value in the valuearea -$80000000 <= x < $100000000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.17 pb Value[,Value,…]

inserts a byte with a value in the valuearea 0 <= x < $80.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.18 pw Value[,Value,…]

inserts a word with a value in the valuearea 0 <= x < $8000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.19 pl Value[,Value,…]

inserts a longword with a value in the valuearea 0 <= x < $80000000.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.20 nb Value[,Value,…]

inserts a byte with a value in the valuearea -$80 <= x < 0.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.21 nw Value[,Value,…]

inserts a word with a value in the valuearea -$8000 <= x < 0.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.22 nl Value[,Value,…]

inserts a longword with a value in the valuearea -$80000000 <= x < 0.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.23 ds[.width] Count[,Value]

defines a memory area with the length Count * Width and fills the area with an optional Value. Default fill value is 0. Is the Count 0 a <cnop 0,Width> is run.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.24 dsb[.width] Count[,Value]

has the same function like <ds>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.25 dsb[.width] Count[,Value]

has the same function like <ds>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.26 blk[.width] Count[,Value…]

has the same function like <ds>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.27 ascii String1[,String2,…]

inserts Strings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.28 cstring String1[,String2,…]

inserts C-Strings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.29 dstring dtype1,dtype2,dtype3

inserts the current date string.

Datentypen

 dc.b	" ("
 dstring	w,d,t
 dc.b	")"
 dc.b	$a,$d,0
;=> (Thursday 14-Okt-93 15:32:06)

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.30 pstring String[,String,…]

inserts a BCPL string.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.31 istring String[,String,…]

inserts strings that terminate with a char that has Bit 7 set.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.32 bitstream Mask

inserts a bitmask for an image object for example. The bits are aligned to bytes.

 bitstream "01001000001"


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.3.33 sprintx "Formatstring"[,Value[,...]]

inserts the resulting string into the code. The string isn’t terminated by a 0 so that you can add other strings rather easy.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4 Listing I/O Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4.1 list

activates the listing output. Has no function if the global listing output wasn’t activated.

Listing Format:

LINE ADDRESS[Flag1] COMMAND-BYTES[Flag2] SOURCE


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4.2 nolist

deactivates the listing output. Has no function if the global listing output wasn’t activated.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4.3 printx "Formatstring"[,Value[,...]]

outputs the string to the current Stdout and works similar as the known C-Printf function. Look at SPRINTF


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4.4 errfile Name

defines the filename for the error output.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.4.5 lisfile Name

defines the filename for the listing output. If no error file was defined the error output is also written into the listing file.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5 Structuring


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.1 symbol[:] macro

starts a Macro block.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.2 endm

ends a macroblock.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.3 mexit

ends a macro call.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.4 fail

creates an error.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.5 end

ends the assembling.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.6 if Symbol

checks if the symbol value is not NULL and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.7 ifd Symbol

checks if the Symbol exists and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.8 ifnd Symbol

checks if the Symbol doesn’t exist and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.9 ifv String

This is a privat command that is used for internal functionality and subject to change. Touch an burn!


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.10 ifnv String

This is a privat command that is used for internal functionality and subject to change. Touch an burn!


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.11 ifmacrod Macro

checks if the Macro exists and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.12 ifmacrond Macro

checks if the Macro doesn’t exist and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.13 ifcmacrod CMacro

checks if the CMacro exists and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.14 ifcmacrond CMacro

checks if the CMacro doesn’t exist and assembles the block depending on the success.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.15 ifc Symbol,Symbol

compares the first string with the second string and if they are equal the block is assembled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.16 ifnc ’String’,’String’

compares the first string with the second string and if they differ the block is assembled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.17 if[condition] Symbol=Symbol

compares the first symbol with the second symbol and decides according to the condition if the block is assembled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.18 else

activates the condition block if the block above wasn’t assembled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.19 elseif

activates the condition block if the block above wasn’t assembled.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.20 endc

defines the end of a condition block.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.21 endif

defines the end of a condition block.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.22 repeat Count

repeats the blocks that is located between <repeat> and <endr> by the number Count.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.23 rept Count

has the same function like <Repeat>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.24 procstart

defines a function in a Dice-C assembler output and is used to optimize <Link> and <Unlk>. This optimize method isn’t working yet.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.5.25 procend

defines a function in a Dice-C assembler output and is used to optimize <Link> and <Unlk>. This optimize method isn’t working yet.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6 File I/O Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.1 incdir Dir[,Dir[,…]]

adds directories to the include path list. <BASM> uses 2 internal path lists and the current directory to find the include and incbin files. First <BASM> checks for a <:> character in the filename and if it finds a volume the file is loaded direct instead of searching it through the pathlists. The first path list contains the paths that were defined in the commandline or BOPT by the option <-i> or through <incdir>. The second path list contains the paths that were defined in global configuration file <ENV:BASMOption>. The entries of the second list will be removed when the assembler is closed so that the paths are still correct in ARexx-Mode. The first list is removed every pass.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.2 Incpath

has the same function like <incdir>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.3 include Name

loads the external include file, for example the OS-Includes. If the file is a precompiled include file it’s detected automaticlly. Includes are loaded from the editor or <cachefile.library>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.4 include2 Name

has the same function like <include> with the exception that the <cachefile.library> isn’t ignored.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.5 incbin Name[,size]

inserts the file with the optional length at the current address into the code. Normally used for sounds and graphics.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.6 incbin2 Name[,size]

has the same function like <incbin> with the exception that the <cachefile.library> isn’t used.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.7 ibytes Name[,Length]

has the same function like <incbin>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.8 dsbin Name[,Length]

defines a memory area with the length of the file specified by the file. Optinally you can defined the maximal file length.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.9 doscmd Name

runs the program Name.

 dc.b	0,"$VER: Fubar 1.0 by Joe User"
 doscmd	"c:date >ram:Temp"
 incbin	ram:Temp
 doscmd	"c:delete ram:Temp"

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.10 filecom Name

sets the file comment of output file.

 filecom "This is a file comment"

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.6.11 pure

sets the Pure Bit while writing a program file.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.7 Miscellaneous


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.7.1 trashreg Reglist

defines the registers that are available to the optimizer.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.7.2 super

deactivates Supervisor warnings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.7.3 mc[Type]

defines the processor type to allow certain commands and addressmodes.

Processor-Type


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.7.4 bopt [opt[,…],…]

sets the assembler options.

Options

m1[+,-]

activates/deactivates 68010 mode.

m2[+,-]

activates/deactivates 68020 mode.

m3[+,-]

activates/deactivates 68030 mode.

m4[+,-]

activates/deactivates 68040 mode.

m6[+,-]

activates/deactivates 68060 mode.

mf[+,-]

activates/deactivates 68881/2 mode.

ue[+,-]

activates/deactivates writing an executable file.

uo[+,-]

activates/deactivates writing an object file.

ua[+,-]

activates/deactivates writing an absolut file.

un[+,-]

activates/deactivates writing file.

p[+,-]

activates/deactivates writing a preassembled Include file.

g[+,-]

activates/deactivates adding the prefix <_> to each exported symbol. Default is off.

sx[+,-]

activates/deactivates writing all XRef/XDef symbols to a symbol hunk. Default is off.

sl[+,-]

activates/deactivates writing all normal symbols to a symbol hunk. Default is off.

sa[+,-]

activates/deactivates writing all symbols to a symbol hunk. Default is off.

sd[+,-]

activates/deactivates writing a BASM custom format Debug Hunk. Makes only sense as a program file and it needs a lot hd space because it includes all sources. Default is off.

s1[+,-]

activates/deactivates writing a SAS D1 compatible Debug Hunk. Default is off.

sf[+,-]

activates/deactivates writing the full sourcefile path into the debug hunk. You should only use this for your own development system because other users may have different HD layouts. This option has only a meaning with in a SAS D1 Debug Hunk. Default is off.

j[+,-]

activates/deactivates setting the PURE Bit for a program file. The PURE Bit tells the Shell that this program can be loaded resident. Default is off.

J[+,-]

activates/deactivates creating the file ENV:BDebugProgram that contains the assembled filename for BDebug. Default is off.

a[+,-]

activates/deactivates creating of an .info file for each program. Useful if you use the assembler through the WB. Default is off.

A[+,-]

activates/deactivates Arexxmode. Only allowed in the commandline. Default is off.

i<DirName>

defines the include path.

o<FileName>

defines the object filename. If not specified the assembler uses the source file name without the source suffix as the output name. For object files it adds the suffix ‘.o’.

P<Priority>

sets the task priority.

c[+,-]

activates/deactivates that the assembler interpretes Upper and Lower case as 2 different chars. Default is on.

f[+,-]

activates/deactivates a faster mode that resolves all references in the 2nd pass. Fortunately this mode needs more memory and has some disadvantages like uncorrect values during the listing. This option has no effect during optimizing. Default is off.

F[+,-]

activates/deactivates a faster IO mode that keeps include paths as locks instead of strings. The older basm versions used locks to store paths but as this isn’t compatible with multi-assigns I changed that.

M<Bytes>

defines the max macro expansion size. If you get a macromemerror you should increase the size. Default 1000 Bytes.

Z<Address>

tells the assembler that the source is starts in the memory at the defined address. Useful for ARexx scripts. Option is only available in the commandline.

x[+,-]

uses the ‘cachefile.library’ to load resident Includes/Incbins or add unknown files to the <cachefile.library> database. Default is off.

X[+,-]

erases all files that are controled by the <cachefile.library>. Default is off.

y[+,-]

shows all files that are controled by the <cachefile.library>. Default is off.

l[+,-]

activates/deactivates the listing output. Default is off.

l0[+,-]

activates/deactivates the listing macro expansion. Default is on.

L<Listingfile>

defines the Listing filename.

h[+,-]

activates/deactivates the symbol listing output. Default is off.

H[+,-]

activates/deactivates the unused symbol output. Default is off.

v[+,-]

outputs a statistic after assembling. Default is off.

V[+,-]

as little status output as possible Default is off.

e[+,-]

creates an error list. Default is on.

es[+,-]

outputs the error list in the Barfly shell. This option has no meaning in BASM.

wo[+,-]

activates/deactivates Optimizing warnings. Default is on.

ws[+,-]

activates/deactivates Supervisor warnings. Default is on.

wm[+,-]

activates/deactivates Move16 warnings because the use of the move16 command is dangerous if you don’t know the problems. Default is on.

wp[+,-]

activates/deactivates pc-relative access to different section warnings. The linker is needed to resolve such files. Default is on.

w2[+,-]

activates/deactivates 68020 addressmode warnings. Default is on.

w4[+,-]

activates/deactivates 64k-Access warnings. It’s useful if you accidently avoid to forget the address register. Example: move.l 8,d0 instead of move.l 8(an),d0 Default is on.

b0

sets the Default Branch Length to 8-Bit. <.b> Default is off.

b1

sets the Default Branch Length to 16-Bit. <.w> Default is on.

b2

sets the Default Branch Length to 32-Bit. <.l> Default is off.

B0

sets the Default BaseDisplacement-Width to 8 Bit. <.b> Default is on.

B1

sets the Default BaseDisplacement-Width to 16 Bit. <.w> Default is off.

B2

sets the Default BaseDisplacement-Width to 32 Bit. <.l> Default is off.

n0

sets the Default OuterDisplacement-Width to 16 Bit. <.w> Default is off.

n1

sets the Default OuterDisplacement-Width to 32 Bit. <.l> Default is on.

q[+,-]

activates/deactivates align long after each rts, bra or jmp to align blocks to the cache structure. Default is off.

O[+,-]

activates/deactivates the Optimizer. Without this option no optimizing will happen besides addressmode converting. Default is off.

OG[+,-]

activates/deactivates Forward Reference Optimizing to use every possibility. In this mode the source is assembled until no further optimizing method is found. First the source is assembled normally. This is shown by the Output <Pass 1>. Afterwards the optimize passes are started and continued until no further symbol changes and length errors occur. This can take a while and depends on the source size. Default is off.

OT[+,-]

activates/deactivates Time Optimizing. Default is off.

Addressmode Converting

OC0[+,-]

bdwan

OC1[+,-]

bdwpc

OC2[+,-]

anxn

OC3[+,-]

pcxn

OC4[+,-]

bdw

OC5[+,-]

bdl

OC6[+,-]

an

OC7[+,-]

pc

ODD[+,-]

activates Direct Addressmode Optimizing

Direct Optimizing

OD0[+,-]

move

OD00[+,-]

move

OD01[+,-]

move

OD02[+,-]

move

OD03[+,-]

move

OD04[+,-]

move

OD05[+,-]

move

OD06[+,-]

move

OD07[+,-]

move

OD08[+,-]

move

OD09[+,-]

move

OD0a[+,-]

move

OD1[+,-]

clr

OD2[+,-]

add

OD3[+,-]

sub

OD4[+,-]

lea

OD5[+,-]

cmp

OD6[+,-]

bcc

OD7[+,-]

jsr

OD8[+,-]

jmp

OD9[+,-]

asl

ODa[+,-]

or ( This Optimizing is deactivated internal )

ODb[+,-]

eor ( This Optimizing is deactivated internal )

ODc[+,-]

and

ODd[+,-]

mulu

ODe[+,-]

muls

ODf[+,-]

jsr+rts

ODg[+,-]

jmp+rts

ODh[+,-]

MovemNoRegister

ODi[+,-]

MovemOneRegister

ODj[+,-]

Link

OAP[+,-]

activates PC-Relative Optimizing

OAS[+,-]

activates Smalldata Optimizing

OAL[+,-]

activates long to word Optimizing

OAX[+,-]

activates x(An) to (An) Optimizing

OAY[+,-]

activates 68020 An-EA Optimizing

OAZ[+,-]

activates 68020 PC-EA Optimizing

OAR[+,-]

activates Register Optimizing

You should be careful with the command BOPT when you activate Global-Optimize. In every parse the default config is set and therefore you should define all global options in the commandline or in the configuration file.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8 680xx Meta Commands


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.1 mb Operand1,Operand2

has the same function as <move.b>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.2 mw Operand1,Operand2

has the same function as <move.w>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.3 ml Operand1,Operand2

has the same function as <move.l>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.4 mq Operand1,Operand2

has the same function as <moveq>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.5 xor.? Operand1,Operand2

has the same function as <eor.?>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.6 xori.? Operand1,Operand2

has the same function as <eori.?>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.7 bhs.? Label

has the same function as <bcc.?>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.2.8.8 blo.? Label

has the same function as <bcs.?>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.3 Assembler Macros

Macros are meta commands that can be based of many assembler instructions to achieve an abstracter source layout. In a macro you can use several different pattern that are replaced by appropriate parameters when the macro is called. The parameter that are passed during a macro call are represented by the following patterns: <\0>,…,<\9>, <\a>,…,<\z>, <\A>,…,<\Z>. The pattern ids are using the hexadecimal format. If a pattern is used with no related parameter an empty string is inserted. Furthermore if a parameter contains tabulators or spaces it has to be placed between <<…>>. When a macro needs relative labels and is should be called more than one time you should use the special pattern <@>. This pattern is replaced by a number that is based of 4 digits and that is increased after each call. The pattern <\#> is replaced by the value of the symbol <narg> that represents the count of macro parameters. Besides the standard patterns there are some more advanced pattern functions supported that look like <\*Function-Name>. These functions don’t belong to the motorola standard thus they aren’t supported by every assembler. Another important point is that you can also call macros from from macros but you can’t define macros in macros.

The standard macro pattern

Label & [. string] & [, string] & [, string] & [,…] & [\\0] & [\\1|] & [\\2|] & [\\3|]…[\\n|]

The advanced macro pattern functions

openwind MACRO
         move.l     intbase,a6
         lea.l      \1,a0
         jsr        OpenWindow(a6)
         ENDM

start:
         openwind   newwindow

movewind MACRO
         move.l     intbase,a6
         move.l     \1,a0
         moveq      #0,d0
         move.\0    \2,d1
         IFC        `\0',`b'
         ext.w      d1
         ENDC
         jsr        MoveWindow(a6)
         ENDM

start:
         move.b     #10,d2
1$:
         movewind.b newwindow,d2
         addq.b     #1,d2
         cmp.b      #100,d2
         bne.s      1$

wait MACRO
         moveq      #-1,d0
wait\
         dbra       d0,wait\          ENDM

start:
         wait
         wait
         wait

test MACRO
         move.l     #\*upper(Hello),d0
         move.l     #\*lower(Hello),d0
         move.l     #\*strlen(1234567890123456),d0
         move.l     #\*valof(value),d0
         rts

         cstring    "\*left(abcdefgh,4)"
         even
         cstring    "\*left(abcdefgh,10)"
         even
         cstring    "\*right(abcdefgh,4)"
         even
         cstring    "\*right(abcdefgh,10)"
         even
         cstring    "\*mid(abcdefgh,2,4)"
         even
         cstring    "\*mid(abcdefgh,2,8)"
         even

         ENDM

value = 123456789
hello:
         test

 value = 123456789


hello:
         move.l     #HELLO,d0
         move.l     #hello,d0
         move.l     #16,d0
         move.l     #123456789,d0
         rts
         cstring    "abcd"
         even
         cstring    "abcdefgh"
         even
         cstring    "efgh"
         even
         cstring    "abcdefgh"
         even
         cstring    "cdef"
         even
         cstring    "cdefgh"
         even

PUTTAG MACRO
         IFC        "\2",""
PUTTAG_COUNT set 0
         ENDC

         IFNC       "\2",""
         move.l     \2,-(a7)
PUTTAG_COUNT SET PUTTAG_COUNT+4
         ENDC

         move.l     \1,-(a7)
PUTTAG_COUNT SET PUTTAG_COUNT+4

         IFC        "\1","#TAG_END"
PUTTAG_COUNT SET 4
         ENDC

         ENDM

CLEARTAG MACRO
         lea.l      PUTTAG_COUNT(a7),a7
         ENDM



         PUTTAG     #TAG_END
         PUTTAG     #WA_Width,#100
         PUTTAG     #WA_ScreenTitle,#Title
         .
         .
         move.l     a7,a1
         sub.l      a0,a0
         jsr        OpenWindowTagList(a6)
         CLEARTAG


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4 Highlevel Macros

In highlevel macros the operands are based of legal addressmodes. Arguments are based of operands and the operators <+,-,<<,>>>. Conditions are based of !,=, <,>,<=,>=,<>. By using highlevel macros you can make the programming of non critical source areas easier and more abstract. Blame Mike Schwartz for this idea...he forced me to do it:-B


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.1 .REG

sets the accumulator register that is used to calculate arguments. Default register is <D0>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.2 .BRANCH b|w|l

sets the length of branch commands that are used in the highlevel macros. Standard length is <.b>.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.3 .FOR Operand[.b|w|l] = Operand TO Operand STEP Operand

creates code for a for loop. The optional width you define after the first operand sets the width for all operations in the for loop.

  .FOR   d0.w = #1 to  STEP #2
  addq.w #1,d1
  .NEXT

  ;Compiled Code

  move.w #1,d0
__for1:
  addq.w #1,d1
  add.w  #2,d0
  cmp.w  ,d0
  blt.b  __for1


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.4 .NEXT

closes the outer .FOR loop.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.5 .IF [Argument] =,!, < , > , <> Operand

creates code for an IF-Operation. You can remove the first argument if you want to test the operand. For example <.IF <>>

  .IF    (a0) + #0 <> d1
  moveq  #0,d0
  .ELSE
  moveq  #1,d0
  .ENDIF

  ;Compiled Code

  move.l (a0),d7
  add.l  #0,d7
  cmp.l  d1,d7
  beq.b  __else1
  moveq  #0,d0
  bra.b  __endif1
__else1:
  moveq  #1,d0
__endif1:


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.6 .ELSE

starts an alternative IF-Block.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.7 .ENDIF

closes the outer .IF block.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.8 .WHILE [Argument] =,!, < , > , <> Operand

creates code for a while loop The optional width you define after the first operand sets the width for all operations in the while loop.

  .WHILE d0 <> #0
  addq.w #1,d1
  .ENDWHILE

  ;Compiled Code

__while1:
  cmp.l  #0,d0
  beq.s  __endwhile1
  addq.w #1,d1
  bra.s  __while1
__endwhile1:



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.9 .ENDWHILE

closes the outer while loop.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.10 .CALL Function [, Argument [, Argument [,…]]]

calls a C-Function by parsing the arguments through the stack. Arguments are calculated in the accumulator register.

  .CALL func , test + 0 - #20 , #test

  ;Compiled Code

  move.l test,d7
  add.l  0,d7
  sub.l  #20,d7
  move.l d7,-(a7)
  move.l #test,-(a7)
  jsr    func
  ifnc   "8","0"             ;Were there any parameters ? 
  lea.l  __CALLSize(a7),a7
  endc



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.11 .RETURN Argument

returns a result value in the accumulator register.

  .return d1 + d2 + #$100

  ;Compiled Code


  move.l d1,d7
  add.l  d2,d7
  add.l  #$100,d7



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.12 .DEF func [, Operand [, Operand [,…]]]

defines a C-Stack function and loads the defined parameters into the operands.

  .DEF func , d0.w , d1 , (a0)
  .ENDDEF

  ;Compiled Code

  XDEF   func
  link   a5,#0
  move.w $0a(a5),d0
  move.l $0c(a5),d1
  move.l $10(a5),(a0)
  unlk   a5            ;.ENDDEF
  rts


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.13 .ENDDEF

closes a function that was started by <.DEF>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.0.14 .LET [ Operand =] Argument

calculates an argument in an accumulator or moves the value to a defined operand.

  .LET + 4 - #LN_SIZE << #7
  .LET d1 = (a1) - (a0)

  ;Compiled Code

  add.l  4,d7
  sub.l  #LN_SIZE,d7
  lsl.l  #7,d7

  move.l (a1),d7
  sub.l  (a0),d7
  move.l d7,d1


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5 Predefined Symbols


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.1 NARG

represents the macro parameter count in a macro.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.2 BARFLY

represents the assembler version.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.3 680xx

represents the CPU processor type.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.4 6888x

represents the FPU processor type.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.5 _MOVEMBYTES

represents the byte count the last movem transfer used.

 lea	_MOVEMBYTES(a7),a7	;frees the stack


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.6 _MOVEMREGS

represents the last movem register mask.

 movem	(a7)+,_MOVEMREGS


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.7 __RS

represents the RS-Counter.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.8 __SO

represents the RS-Counter.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.5.0.9 __FO

represents the FO-Counter.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6 Optimizing

Optimize Methods…


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.1 Direct Addressmode Optimizing

The assembler can direct optimize certain <68020…60> Addressmodes if a faster 68000 addressmode exists. This optimizing method should always be activated because of compatibility reasons.

+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
| move. l (1000.w,an),dn | move.l 1000(an),dn |  -OC0  |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
| move. l (1000.w,pc),dn | move.l 1000(pc),dn |  -OC1  |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|  move. l (bd.w),dn     |   move.l bd.w,dn   |  -OC4  |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|  move. l (bd.l),dn     |   move.l bd.l,dn   |  -OC5  |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|     move. l (an),dn    |   move.l (an),dn   |  -OC6  |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|       Addressmode      |     Optimizing     | Option |
+------------------------+--------------------+--------+
+------------------------+--------------------+--------+
|     move. l (pc),dn    |   move.l (pc),dn   |  -OC7  |
+------------------------+--------------------+--------+

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.2 Address Optimizing

+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|     x.l,EA    |    x.w,EA      | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+  -OAL  |
|     EA,x.l    |    EA,x.l      | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|   x(an),EA    |    (an),EA     |         x=0         |        |
+---------------+----------------+---------------------+  -OAX  |
|   EA,x(an)    |    EA,(an)     |         x=0         |        |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|   label,EA    |  label(pc),EA  | $ffff8000<=x<=$7fff |  -OAP  |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|     x.l,EA    |    x(a4),EA    | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+  -OAS  |
|     EA,x.l    |    EA,x(a4)    | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|   (x.l,an)    |    (an)        | x=0                 |  -OAY  |
+---------------+----------------+---------------------+        |
|   (x.l,an)    |    x(an)       | $ffffff80<=x<=$7f   |        |
+---------------+----------------+---------------------+        |
|   (x,an,xn)   |    0(an,xn)    | x=0                 |        |
+---------------+----------------+---------------------+        |
|   (x,an,xn)   |    (x.b,an,xn) | $ffffff80<=x<=$7f   |        |
+---------------+----------------+---------------------+        |
|   (x,an,xn)   |    (x.w,an,xn) | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+        |
|   ([?],x)     |    ([?])       | x=0                 |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
| Addressmode   |   Optimizing   |         Note        | Option |
+---------------+----------------+---------------------+--------+
+---------------+----------------+---------------------+--------+
|   (x.l,pc)    |    (pc)        | x=0                 |  -OAZ  |
+---------------+----------------+---------------------+        |
|   (x.l,pc)    |    x(pc)       | $ffffff80<=x<=$7f   |        |
+---------------+----------------+---------------------+        |
|   (x,pc,xn)   |    0(pc,xn)    | x=0                 |        |
+---------------+----------------+---------------------+        |
|   (x,pc,xn)   |    (x.b,pc,xn) | $ffffff80<=x<=$7f   |        |
+---------------+----------------+---------------------+        |
|   (x,pc,xn)   |    (x.w,pc,xn) | $ffff8000<=x<=$7fff |        |
+---------------+----------------+---------------------+        |
|   ([?],x)     |    ([?])       | x=0                 |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+        |
|   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
|               |                | ? is also optimized |        |
+---------------+----------------+---------------------+--------+

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.3 #x Optimizing

+-------------------+------------------+-------------------------+--------+
| Addressmode       |   Optimizing     |         Note            | Option |
+-------------------+------------------+-------------------------+--------+
|                   |                  |                         |  -OD0  |
+-------------------+------------------+-------------------------+--------+
|  move.l #x,dn     |   moveq #x,dn    |    $ffffff80<=$7f       |  -OD00 |
+-------------------+------------------+-------------------------+        |
|  move.? #0,an     |  suba.l an,an    |      ? = w or l         |  -OD01 |
+-------------------+------------------+-------------------------+        |
|  move.l #x,dn     | moveq #y,dn      | $10000<=x<=$7f0000      |  -OD02 |
|                   | swap dn          |                         |        |
+-------------------+------------------+-------------------------+        |
|  move.l #x,dn     | moveq #y,dn      | $ff80ffff<=x<=$fffEffff |  -OD03 |
|                   | swap dn          |                         |        |
+-------------------+------------------+-------------------------+        |
|  move.l #x,dn     | moveq #y,dn      |      $80<=x<=$ff        |  -OD04 |
|                   | not.b dn         |                         |        |
+-------------------+------------------+-------------------------+        |
|  move.l #x,dn     | moveq #y,dn      |     $ffff<=x<=$ff81     |  -OD05 |
|                   | neg.w dn         |                         |        |
+-------------------+------------------+-------------------------+        |
|  move.l #x,dn     | moveq #y,dn      | $ffff0080<=x<=$ffff0001 |  -OD06 |
|                   | neg.w dn         |                         |        |
+-------------------+------------------+-------------------------+        |
|  move.? #0,EA     | clr.? EA         | ? = w or l.See Trashreg |  -OD07 |
|                   |                  | optimizing. I also check|        |
|                   |                  | if it accesses the HW   |        |
+-------------------+------------------+-------------------------+        |
| move.b #$ff,EA    | st EA            |                         |  -OD08 |
+-------------------+------------------+-------------------------+        |
| movea.l -4(an),an | movea.l -(an),an |                         |  -OD09 |
+-------------------+------------------+-------------------------+        |
| movea.w -2(an),an | movea.w -(an),an |                         |  -OD0a |
+-------------------+------------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|    clr.l dn   |   moveq #0,dn  |                         |  -OD1  |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  add.? #x,EA  |  addq.? #x,EA  |       1<=x<=8           |  -OD2  |
+---------------+----------------+-------------------------+        |
|  add.? #x,EA  |  subq.? #x,EA  |      -8<=x<=-1          |        |
+---------------+----------------+-------------------------+        |
|  add.? #x,an  | lea.l x(an),an |   $ffff8000<=x<=$7fff   |        |
+---------------+----------------+-------------------------+        |
|  add.? #0,EA  | tst.? EA       |       legal EA          |        |
+---------------+----------------+-------------------------+        |
|  add.? #0,an  | removed        |                         |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  sub.? #x,EA  |  subq.? #x,EA  |       1<=x<=8           |  -OD3  |
+---------------+----------------+-------------------------+        |
|  sub.? #x,EA  |  addq.? #x,EA  |      -8<=x<=-1          |        |
+---------------+----------------+-------------------------+        |
|  sub.? #x,an  |lea.l -x(an),an |   $ffff8000<=x<=$7fff   |        |
+---------------+----------------+-------------------------+        |
|  sub.? #0,EA  | tst.? EA       |       legal EA          |        |
+---------------+----------------+-------------------------+        |
|  sub.? #0,an  | removed        |                         |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| lea x(an),an  |  addq.w #x,an  |       1<=x<=8           |        |
+---------------+----------------+-------------------------+  -OD4  |
| lea x(an),an  |  subq.w #x,an  |      -8<=x<=-1          |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  cmp.? #0,EA  |   tst.? EA     |                         |  -OD5  |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  Bcc.l label  |  Bcc.w label   |   $8000<=label<=$7fff   |  -OD6  |
+---------------+----------------+-------------------------+        |
|  Bcc.l label  |  Bcc.s label   |     $80<=label<=$7f     |        |
+---------------+----------------+-------------------------+        |
|  Bcc.w label  |  Bcc.s label   |     $80<=label<=$7f     |        |
+---------------+----------------+-------------------------+--------+

Attention! This optimizing methid is unsafe when you use BRANCH-Tables. You should switch off the optimize method over this area.

+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|   jsr label   |  bsr.w label   |   $8000<=Offset<=$7fff  |        |
+---------------+----------------+-------------------------+  -OD7  |
|   jsr label   |  bsr.s label   |     $80<=Offset<=$7f    |        |
+---------------+----------------+-------------------------+--------+

Attention! This optimizing methid is unsafe when you use JSR-Tables. You should switch off the optimize method over this area.

+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|   jmp label   |  bra.w label   |$ffff8000<=Offset<=$7fff |        |
+---------------+----------------+-------------------------+  -OD8  |
|   jmp label   |  bra.s label   |$ffffff80<=Offset<=$7f   |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  asl.? #1,dn  |  add.? dn,dn   |                         |  -OD9  |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  or.? #x,dn   |  bset #y,dn    | x=y^2                   |  -ODa  |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  eor.? #x,dn  |  bchg #y,dn    | x=y^2                   |  -ODb  |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| mulu.w #x,dn  | swap dn        | x=2^y                   |  -ODc  |
|               | clr.w dn       | y=y1+y2                 |        |
|               | swap dn        | y=1,add.l dn,dn         |        |
|               | lsl.l #y1,dn   |                         |        |
|               | lsl.l #y2,dn   |                         |        |
+---------------+----------------+-------------------------+        |
| mulu.l #x,dn  | lsl.l #y1,dn   | x=2^y                   |        |
|               | lsl.l #y2,dn   | y=y1+y2                 |        |
|               |                | y >= 16                 |        |
|               |                | swap dn , y-16          |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| muls.w #x,dn  | ext.l dn       | x=2^y                   |  -ODd  |
|               | asl.l #y1,dn   | y=y1+y2                 |        |
|               | asl.l #y2,dn   | y=1 , add.l dn,dn       |        |
+---------------+----------------+-------------------------+        |
| muls.l #x,dn  | asl.l #y1,dn   | x=2^y                   |        |
|               | asl.l #y2,dn   | y=y1+y2                 |        |
|               |                | y >= 16                 |        |
|               |                | swap dn ,y-16           |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
|  movem.l ,EA  |     Removed    |                         |        |
+---------------+----------------+-------------------------+  -ODh  |
|  movem.l EA,  |     Removed    |                         |        |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| Addressmode   |   Optimizing   |         Note            | Option |
+---------------+----------------+-------------------------+--------+
+---------------+----------------+-------------------------+--------+
| movem.l Xn,EA |  Move.l Xn,EA  | Alter the status flags! |        |
+---------------+----------------+-------------------------+  -ODi  |
| movem.l EA,Xn |  Move.l EA,Xn  | Alter the status flags! |        |
+---------------+----------------+-------------------------+--------+

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.4 Register Optimizing


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.5 How does Optimizing work ?

In single-pass Optimizing the assembler can only optimize commands where it can resolve the reference in the first pass. This means the label or symbol has to be known before. In multi-pass Optimizing it can optimize every command without bothering where the label is defined. The Assembler keeps all labels each pass but increases a change counter if the old contents differs with the new contents. The exception is that the assembler can’t optimize commands that depend on symbols that are defined after the command. The reason is that the Assembler has to remove each pass every symbol to avoid problems with ‘IFD’ and ‘IFND’ that can cause that certain areas aren’t assembled in multi-pass mode. You probably noticed that i assume that nobody used ‘IFD’ or ‘IFND’ with labels because that would also break multi-pass.

An example for a construct that can’t be optimized.

     move.l #1,NULL(a0)
NULL=0

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.6.6 Problems...

You should always be careful with optimizing because it can cause bugs in certain source areas. Branch optimizing for example has to be switched off if you use JMP-Towers.

     lsl.w #1,d0
     jmp   Tower(pc,d0.w)

 Tower:
     bra.w func1
     bra.w func2
     bra.w func3

 could be be optimized to

 Tower:
     bra.w func1
     bra.s func2
     bra.s func3

 that leads to program bugs.

 Solution:

 bopt OD6-

 Tower:
     bra.w func1
     bra.w func2
     bra.w func3

 bopt OD6+


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.7 Preassembled Includes

If you want to assemble a program that needs to load a lot includes it’s useful to preassemble the includes and load one file because the real slowdown factor is the need loading time. You can only use absolut symbols and macros in a preassembled file. All relative and symbols defined by ‘set’ aren’t written into a preassembled file. The created file isn’t compress to avoid any slowdown but if the file size is critical you can compress the file by xpk and load it through the xfh filesystem.

basm -p Source.S creates the preassembled file Source.p

An error location could be absolut symbols that are calculated by relative symbols. You should avoid these symbols.

Symbol=Label1-Label2


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.8 Resident includes

BASM’ can control an Include and Incbin database by the library ‘cachefile.library’ to get rid of the loading delays. The files in the database can be shown and deleted.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.9 Basm Assembler System


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.9.1 Cli Calling Convention

Format:

BASM [-Option] Name

This is the commandline version of the assembler and can be easy integrated in own development system, for example ‘Make’ and ‘CED’. An assembler error is indicated by the result 20 and the result 10 is used if no source file were specified.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.9.2 Configuration


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.9.2.1 Global

You can define the global configuration through the file ‘ENV:BASMOption’. The internal standard configuration is not replaced but can only be changed.

File ‘ENV:BASMOption

 -v
 -f
 -c-
 -iASM:

If a line doesn’t start with <-> it’s ignored.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.9.2.2 WB Tooltypes

Additionally you can also define the above described configuration options in the tooltypes of the source file icon. Furthermore ‘BASM’ allows a special tooltype to define an output window.

o Window= <Window Defintion>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10 ARexx

The ‘BASM’ ARexx Port Name is ‘rexx_BASM’ and the ARexx Script suffix ‘.basm’. To activate the ‘BASM’ ARexx mode you have to start ‘BASM’ with the option -A.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.1 BASM

BASM [-Option] Name

This ARexx command starts the assembler and coincides with the CLI-syntax structure.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.2 BEND

BEND

This ARexx command closes the ARexx port and shuts down the assembler.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.3 BGETERROR

BGETERROR

With this ARexx command you will receive an explanation of the actual errors. If no errors exist it will return a status code 20.

Error Format String

OFFSET|FILE|<Error Description>


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.4 BNEXTERROR

BNEXTERROR

This ARexx command will cause a jump to the next error in the list. If there are no further errors in the list it will return a status code 20.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.5 BINITERROR

BINITERROR

This ARexx command will cause a jump to the first entry in the error list. If no error exists it will return a status code 20.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.6 BGETWARNING

BGETWARNING

works like ‘BGETERROR’ only for Warnings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.7 BNEXTWARNING

BNEXTWARNING

works like ‘BNEXTERROR’ only for Warnings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.10.0.8 BINITWARNING

BINITWARNING

works like ‘BINITERROR’ only for Warnings.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.11 Compatibility


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.11.1 to other assemblers…

Fortunately ‘BASM’ can’t be 100% compatible to every assembler on the amiga market. Thus you can expect problems with different sources. In general you can expect problems with commands that don’t belong to a standard like option commands. Furthermore you should also be careful with sources that directly depend on the assembler implementation. Because ‘BASM’ is a 1-Pass Assembler in the normal mode with an additional backpatch phase you shouldn’t define symbols that can’t be resolved at once. An ideal example for this practice is the ‘Xoper2.2’ Source that was developed with the PD Assembler A68k. While assembling with ‘BASM’ the assembler detects that a not defined symbols is accessed through the ‘SET’ command. Generally this should cause an error at once but unfortunately ‘A68k’ doesn’t show anything and uses the last value of ‘cmdnum’.

ADDCMD	    MACRO
cmdnum	    set     cmdnum+1
	    dc.b    \1,0
	    ENDM
            .
            .
            .
;Here it's using `cmdnum' although
;the symbol wasn't defined yet
	    addq    #1,d2
	    cmp.w   #cmdnum,d2
	    bne.s   1$
            .
            .
            .

;Here the cmdnum is first defined
cmdnum	    set      0
commds	    ADDCMD  'time'
	    ADDCMD  'taskpri'
	    ADDCMD  'info'
	    ADDCMD  'pri'
	    ADDCMD  'flush'

Because the A68k is a 2-Pass Assembler he can assemble this Source without problems.

Another Problem is that the assembler argument parser doesn’t detect Overflow because of speed reasons. I don’t think it’s worth it...if you differ tell me your opinion.

The assembler doesn’t support the following motorola syntax bugs because of the internal structure of the parser it would cause major problems in the multi-pass mode.

symbol: equ 0
symbol: equr d0


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.11.2 C-Compiler Assembler


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.11.2.1 Dice

If you use Basm as a ‘DASM’ replacement you have to run ‘Basm’ with the option -OAS to activate the Smalldata mode. If you want to emulate the advanced ‘Link’, ‘UnLink’, ‘Movem’ optimizing ‘DASM’ supports you have to use the options -O, -OG, -ODh, -ODi and -ODj. The option -OG is needed because the link stackframe register list symbols are defined after the commands so the assembler doesn’t know them in 1 pass mode. Sorry...i had to disable this mode because i later detected that i have to keep track of the used registers. I’ll try to fix this in a later version


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

22 Literature


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

23 Software

For the development of Barfly the following programs were used:


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24 Assembler Addressmodes

+--------------+------------------------+
|   Notation   | Description            |
+--------------+------------------------+
+--------------+------------------------+
|      EA      | Effective Address      |
|      Dn      | D0...D7                |
|      An      | A0...A7                |
|      Xn      | D0...D7, A0...A7       |
|      .b      | Operand Width  8Bit    |
|      .w      | Operand Width 16Bit    |
|      .l      | Operand Width 32Bit    |
|     size     | w,l                    |
|     Size     | b,w,l                  |
|     Scale    | 1,2,4 or 8             |
| Xn.size*Scale| 68000-10 only Scale 1. |
+---------------------------------------+
Data register direct

Syntax: Dn

Address register direct

Syntax: An

Address register indirect

Syntax: (An)

Address register indirect with postincrement

Syntax: (An)+

Address register indirect with predecrement

Syntax: -(An)

Address register indirect with offset

Syntax: bd.w(An)

Address register indirect with index and offset

Syntax: bd.b(An,Xn{.Size*Scale})

Address register indirect with index and offset

Syntax: (bd,An,Xn{.Size*Scale})

Address register indirect with index and offset

Syntax: (bd.b,An,Xn{.Size*Scale})

Address register indirect with index and base displacement

Syntax: ({bd.size{,An{,Xn{.Size{*Scale}}}}})

Indirect Memory Addressierung mit postindex

Syntax: ({[{bd.size{,An}}]}{Xn{.Size{*Scale}{,od.size}}})

Indirect Memory Addressierung mit preindex

Syntax: ({[{bd.size{,An}}{,Xn{.Size{*Scale}]}{,od.size}}})

PC Indirect

Syntax: (PC)

PC Indirect with offset

Syntax: bd.w(PC)

PC Indirect with index and offset

Syntax: bd.b(PC,Xn{.Size*Scale})

PC Indirect with index and offset

Syntax: bd.b(ZPC,Xn{.Size*Scale})

PC Indirect with index and base displacement

Syntax: ({bd.size{,PC{,Xn{.Size{*Scale}}}}})

PC Indirect with index and base displacement

Syntax: ({bd.size{,ZPC{,Xn{.Size{*Scale}}}}})

PC Indirect memory Addressing with post-index

Syntax: ({[{bd.size{,PC}}]}{,Xn{.Size{*Scale}{,od.size}}})

PC Indirect memory Addressing with post-index

Syntax: ({[{bd.size{,ZPC}}]}{,Xn{.Size{*Scale}{,od.size}}})

PC Indirect memory Addressing with pre-index

Syntax: ({[{bd.size{,PC}}{,Xn{.Size{*Scale}]}{,od.size}}})

PC Indirect memory addressing with pre-index

Syntax: ({[{bd.size{,ZPC}}{,Xn{.Size{*Scale}]}{,od.size}}})

Absolut short

Syntax: bd.w

Absolut long

Syntax: bd[.l]

Immediate Data

Syntax: #xxx


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24.1 Addressmode Examples

To avoid some problems here are some small examples how addressmode have to build up.

x=$40
y=$400
  move.b (x,A0,D2.W),D0
  move.b x(A0,D2.W),D0

;Both lines are correct
;(x,a0,d2.w) is optimized internal to (x,a0,d2.w).
;For more information please check the chapter about
;Optimizing Direct Addressmodes.

  move.b (y,A0,D2.W),D0
  move.b y(A0,D2.W),D0

;Now you get 2 errors, because y is not an 8bit word.
;These 2 lines shows the correct version.

  move.b (y.w,A0,D2.W),D0
  move.b (y.w,A0,D2.W),D0

;or

  move.b (y.l,A0,D2.W),D0
  move.b (y.l,A0,D2.W),D0



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

25 680xx Opcode Overview

+----------+---------+-------------------------------------------+
|  Opcode  |  Size   | 68000 68010 68020 68030 68040 68060 6888x |
+----------+---------+-------------------------------------------+
+----------+---------+-------------------------------------------+
| abcd     | b       |   x     x     x     x     x     x         |
| add      | b,w,l   |   x     x     x     x     x     x         |
| addq     | b,w,l   |   x     x     x     x     x     x         |
| adda     | w,l     |   x     x     x     x     x     x         |
| addi     | b,w,l   |   x     x     x     x     x     x         |
| addx     | b,w,l   |   x     x     x     x     x     x         |
| and      | b,w,l   |   x     x     x     x     x     x         |
| andi     | b,w,l   |   x     x     x     x     x     x         |
| asr      | b,w,l   |   x     x     x     x     x     x         |
| asl      | b,w,l   |   x     x     x     x     x     x         |
| bcc      | b,w,l   |   x     x     x     x     x     x         |
| bchg     | b,l     |   x     x     x     x     x     x         |
| bclr     | b,l     |   x     x     x     x     x     x         |
| bfchg    | unsized |               x     x     x     x         |
| bfclr    | unsized |               x     x     x     x         |
| bfext    | unsized |               x     x     x     x         |
| bfffo    | unsized |               x     x     x     x         |
| bfins    | unsized |               x     x     x     x         |
| bfset    | unsized |               x     x     x     x         |
| bftst    | unsized |               x     x     x     x         |
| bkpt     | unsized |         x     x     x     x     x         |
| bset     | b,l     |   x     x     x     x     x     x         |
| btst     | b,l     |   x     x     x     x     x     x         |
| callm    | unsized |               x                           |
| cas      | b,w,l   |   x     x     x     x     x     x,2       |
| cas2     | b,w,l   |   x     x     x     x     x     x,2       |
| chk      | b,w,l   |   x     x     x     x     x     x         |
| chk2     | b,w,l   |               x     x     x     2         |
| cinv�    | unsized |                           x     x         |
| clr      | b,w,l   |   x     x     x     x     x     x         |
| cmp      | b,w,l   |   x     x     x     x     x     x         |
| cmpa     | w,l     |   x     x     x     x     x     x         |
| cmpi     | b,w,l   |   x     x     x     x     x     x         |
| cmpm     | b,w,l   |   x     x     x     x     x     x         |
| cmp2     | b,w,l   |               x     x     x     2         |
| cpush�   | unsized |                           x     x         |
| dbcc     | w       |   x     x     x     x     x     x         |
| divs     | w,l     |   x     x     x     x     x     x,2       |
| divsl    | l       |               x     x     x     x         |
| divu     | w,l     |   x     x     x     x     x     x,2       |
| divul    | l       |               x     x     x     x         |
| eor      | b,w,l   |   x     x     x     x     x     x         |
| eori     | b,w,l   |   x     x     x     x     x     x         |
| eori/ccr | b       |   x     x     x     x     x     x         |
| eori/sr� | w       |   x     x     x     x     x     x         |
| exg      | l       |   x     x     x     x     x     x         |
| ext      | w,l     |   x     x     x     x     x     x         |
| extb     | l       |               x     x     x     x         |
| fabs     |         |                           x     x     x   |
| fsabs    |         |                           x     x         |
| fdabs    |         |                           x     x         |
| facos    |         |                           2     2     x   |
| fadd     |         |                           x     x     x   |
| fsadd    |         |                           x     x         |
| fdadd    |         |                           x     x         |
| fasin    |         |                           2     2     x   |
| fatan    |         |                           2     2     x   |
| fatanh   |         |                           2     2     x   |
| fbcc     |         |                           x     x     x   |
| fcmp     |         |                           x     x     x   |
| fcos     |         |                           2     2     x   |
| fcosh    |         |                           2     2     x   |
| fdbcc    |         |                           x     2     x   |
| fdiv     |         |                           x     x     x   |
| fsdiv    |         |                           x     x         |
| fddiv    |         |                           x     x         |
| fetox    |         |                           2     2     x   |
| fetoxm1  |         |                           2     2     x   |
| fgetexp  |         |                           2     2     x   |
| fgetman  |         |                           2     2     x   |
| fint     |         |                           2     x     x   |
| fintrz   |         |                           2     x     x   |
| flogn    |         |                           2     2     x   |
| flognp1  |         |                           2     2     x   |
| flog2    |         |                           2     2     x   |
| flog10   |         |                           2     2     x   |
| fmod     |         |                           2     2     x   |
| fmove    |         |                           x     x     x   |
| fsmove   |         |                           x     x         |
| fdmove   |         |                           x     x         |
| fmovecr  |         |                           2     2     x   |
| fmovem   |         |                           x     x,2   x   |
| fmul     |         |                           x     x     x   |
| fsmul    |         |                           x     x         |
| fdmul    |         |                           x     x         |
| fneg     |         |                           x     x     x   |
| fsneg    |         |                           x     x         |
| fdneg    |         |                           x     x         |
| fnop     |         |                           x     x     x   |
| frem     |         |                           2     2     x   |
| frestore�|         |                           x     x     x   |
| fscc     |         |                           2     2     x   |
| fsub     |         |                           x     x     x   |
| fssub    |         |                           x     x         |
| fdsub    |         |                           x     x         |
| fsave�   |         |                           x     x     x   |
| fscale   |         |                           2     2     x   |
| fsglmul  |         |                           2     2     x   |
| fsgldiv  |         |                           2     2     x   |
| fsin     |         |                           2     2     x   |
| fsinh    |         |                           2     2     x   |
| fsincos  |         |                           2     2     x   |
| fsqrt    |         |                           x     x     x   |
| fssqrt   |         |                           x     x         |
| fdsqrt   |         |                           x     x         |
| ftan     |         |                           2     2     x   |
| ftanh    |         |                           2     2     x   |
| ftentox  |         |                           2     2     x   |
| ftrap    |         |                           x     2     x   |
| ftst     |         |                           x     x     x   |
| ftwotox  |         |                           2     2     x   |
| illegal  | unsized |   x     x     x     x     x     x         |
| jmp      | unsized |   x     x     x     x     x     x         |
| jsr      | unsized |   x     x     x     x     x     x         |
| lea      | l       |   x     x     x     x     x     x         |
| link     | w,l     |   x     x     x     x     x     x         |
| lpstop   |         |                                 x         |
| lsl      | b,w,l   |   x     x     x     x     x     x         |
| lsr      | b,w,l   |   x     x     x     x     x     x         |
| move     | b,w,l   |   x     x     x     x     x     x         |
| movea    | w,l     |   x     x     x     x     x     x         |
| moveq    | l       |   x     x     x     x     x     x         |
| movec�   | l       |         x     x     x     x     x         |
| movem    | w,l     |   x     x     x     x     x     x         |
| movep    | w,l     |   x     x     x     x     x               |
| moves�   | b,w,l   |         x     x     x     x     x         |
| move16   |         |                           x     x         |
| muls     | w,l     |   x     x     x     x     x     x         |
| mulu     | w,l     |   x     x     x     x     x     x         |
| nbcd     | b       |   x     x     x     x     x     x         |
| neg      | b,w,l   |   x     x     x     x     x     x         |
| negx     | b,w,l   |   x     x     x     x     x     x         |
| nop      | unsized |   x     x     x     x     x     x         |
| not      | b,w,l   |   x     x     x     x     x     x         |
| or       | b,w,l   |   x     x     x     x     x     x         |
| ori      | b,w,l   |   x     x     x     x     x     x         |
| pack     | unsized |               x     x     x     x         |
| pea      | l       |   x     x     x     x     x     x         |
| pflush�  | unsized |                     x     x     x         |
| pflusha� | unsized |                     x                     |
| plpa�    | unsized |                                 x         |
| pload�   | unsized |                     x                     |
| pmove�   | w,l,q   |                     x                     |
| ptest�   | unsized |                     x     x               |
| reset�   | unsized |   x     x     x     x     x     x         |
| rol      | b,w,l   |   x     x     x     x     x     x         |
| ror      | b,w,l   |   x     x     x     x     x     x         |
| roxl     | b,w,l   |   x     x     x     x     x     x         |
| roxr     | b,w,l   |   x     x     x     x     x     x         |
| rtd      | unsized |         x     x     x     x     x         |
| rte�     | unsized |   x     x     x     x     x     x         |
| rtr      | unsized |   x     x     x     x     x     x         |
| rts      | unsized |   x     x     x     x     x     x         |
| rtm      | unsized |               x                           |
| sbcd     | b       |   x     x     x     x     x     x         |
| scc      | b       |   x     x     x     x     x     x         |
| stop�    | unsized |   x     x     x     x     x     x         |
| sub      | b,w,l   |   x     x     x     x     x     x         |
| subq     | b,w,l   |   x     x     x     x     x     x         |
| suba     | w,l     |   x     x     x     x     x     x         |
| subi     | b,w,l   |   x     x     x     x     x     x         |
| subx     | b,w,l   |   x     x     x     x     x     x         |
| swap     | w       |   x     x     x     x     x     x         |
| tas      | b       |   x     x     x     x     x     x         |
| trap     | unsized |   x     x     x     x     x     x         |
| trapcc   | ? ,w,l  |               x     x     x     x         |
| trapv    | unsized |   x     x     x     x     x     x         |
| tst      | b,w,l   |   x     x     x     x     x     x         |
| unlk     | unsized |   x     x     x     x     x     x         |
| unpk     | unsized |               x     x     x     x         |
+----------+---------+-------------------------------------------+

� Supervisor instruction
2 These are software-supported instructions on the 68040 and 68060


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

Short Table of Contents


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on July 1, 2022 using texi2html 5.0.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated on July 1, 2022 using texi2html 5.0.