****************************************************** * * * S N M A V1.39 * * ~~~~~~~~~~~~~~~~~~~~~~ * ****************************************************** ***************************************************************** * $Id: snma.doc,v 1.2 94/01/02 22:15:56 spn Exp Locker: spn $ * ***************************************************************** SNMA is 680x0 conditional macro assembler. Copyright © 1993,1994 Samu Nuojua. This document is plain text conversion of the AmigaGuide version of the SNMA documents. AmigaGuide version (SNMA.guide) is recommended to be used as a SNMA document, if possible. This documents holds about the same things, expect that I have shortened some not so important parts of it. Contents of the SNMA.doc ~~~~~~~~~~~~~~~~~~~~~~~~ 1. Introduction 1.1 Copyright stuff 1.2 Requirements 1.3 How to Install 1.4 Good & Bad things 2. Usage 3. Features 3.1 Source code format 3.2 Symbols 3.3 Expressions 3.4 Addressing modes 3.5 Directives 3.6 Data types 3.7 Things to note 3.7.1 About Bcc 3.7.2 The Check of the data sizes 3.8 Error Messages 4. Author How to contact To search chapter it is best to use the find feature of your reader (or whatever) and search the number of the chapter. Here we go... [insert your favorite solo here] 1.Introduction to Samu Nuojua's Macro Assembler ,SNMA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SNMA is 680x0/6888x macro assembler. At present, it is used from the shell. SNMA requires AmigaDOS 2.0+. If you are familiar with the a68k you are at home with the SNMA (take a look at the "Features.Things to note"). 1.1 Copyright stuff ~~~~~~~~~~~~~~~~~~~ SNMA stands for Samu Nuojua's Macro Assembler. SNMA is © copyright 1993,1994 by Samu Nuojua. All SNMA documents are © copyright 1993,1994 by Samu Nuojua. SNMA is FREEWARE. I reserve all rights to SNMA. You can copy it as long you don't ask payment (small fee is allowed to cover the expenses of the possible disk/postage fee). Permission is granted to upload SNMA to the bulletin boards and FTP sites. Also, you must provide all the files supplied when you are copying SNMA to somewhere/somebody (including all the documents). SNMA software and documents are provided 'as is'. No guarantee of any kind is given what SNMA does or that information in files is correct in any way. You are using this software at your own risk, author of the SNMA is in NO WAY responsible for any losses or damage caused by SNMA. 1.2 Requirements ~~~~~~~~~~~~~~~~ What you need to use SNMA to produce stand alone programs. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Required: AmigaOS 2.04 or higher (V37) Linker (to produce executables) Text editor (to write/edit programs) Recommended: Hard Disk Manuals, manuals .... Time (heh)... Debugger 1.3 How to Install ~~~~~~~~~~~~~~~~~~ Installing SNMA is not a difficult task. To use macro assembler I assume you have some experience with the shell. Simply copy SNMA file somewhere which is under the search path (like c: directory). Documents you can put wherever you want. There is so little to copy that sure you can do it yourself, can't you ? 1.4 Good & Bad things ~~~~~~~~~~~~~~~~~~~~~ My personal view from this assembler. There are currently more bad things but I tend to be critical to me. Good: - It's free. - Most common directives are supported. - Macros are supported. - All 680x0, 6888x, 68851 and 68030 PMMU instructions are supported - Does normal optimizations, including forward branches. - It's not terribly slow. - It's coded with assembler. (See below, Bad things). - Enforcer was in duty all the time I coded, checked, debugged... - Supports all the data types of 680x0 6888x family (I think). (FFP conversions not supported). Bad: - 68040 instructions (those couple of) are not yet supported. - Listing file not supported - Movem optimizing is not implemented (yet) - address to address(pc) optimizing not supported, yet. - All source files must fit to the memory at the same time. - Is not coded very space-effeciently. (Space versus time). - Is coded with assembler. 8>).( - Document sucks...(As always). - Code size is huge, especially because I coded this with the assembler (a68k v2.71) (about 75kB). - Won't support any small data model. - Beginners help would be nice. - Only outputted format is Amiga object code. - No LINE DEBUG HUNK (how it is implemented ?). - This document is a translators nightmare!!!! (From the one who tried to fix all the bugs in the english of this document...) (Hey! Don't accuse me........eeeee. Urgh.) Things to do: Some Bad things away arexx, gui (may take some time) 2. How to use ~~~~~~~~~~~~~~ SNMA is currently used from the shell. It parses its arguments using dos function ReadArgs(). Command Line interface: SNMA [OBJ ] [INCLUDE ] [HEADER
] [EQUATE ] [LISTING ] * [Q] [P] [A] [B] [S] Where: is the name of the source file is the name of the object file. Shortcut: O . is the list of the directories where INCLUDE directive searches include files Shortcut: I .
is file to be included before any lines from source file are assembled. Only one is allowed. Shortcut: H
is equate file name to be created. Empty string is allowed, produces name from the source file name. Q Quick optimizing flag, default: on P pc-relative optimizing, default: off (not done) A effective address optimizing default: on B Auto-force (Bd,An)->(disp16,An) default: on S Write symbol data hunk default: off * Listing file is not implemented I have tried SNMA with the stack size of 4000 bytes without problems. If you have problems, try with the bigger stack. (I use stack size of 20000 bytes because RevisonControlSystem requires it). 3. The features of the SNMA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This section covers all the features of the SNMA. 3.1 Source code format ~~~~~~~~~~~~~~~~~~~~~~ The format of the source code is 'standard'. Take a look for some assembly source code to examine what all the stuff below means in real life. One source code line may have following components: