THE ASSEMBLER
-------------

THE ASSEMBLER HAS ONE COMMAND:A-ASSEMBLE.

THE PROMPT OPTIONS> IS THEN DISPLAYED,AND SIMPLY TYPING <RET> TO
THIS PROMPT WILL ASSEMBLE NORMALLY WITHOUT LISTING.SEE SECTION BELOW ON
LISTING & OPTIONS.

THE ASSEMBLER "MOONLIGHTS" AS A LINKER,AND WILL (BY DEFAULT) TAKE ANY LINKER
CODE PLACED IN THE LINKER INPUT FILE,AND LINK THAT,AS WELL AS ASSEMBLING
THE SOURCE TO PRODUCE AN EXECUTABLE FILE-SEE LINKER SECTION.NORMALLY IT IS
NOT NECESSARY TO USE A LINKER,AND THIS SECTION,AND THE LINKER INPUT BUFFER
MAY BE IGNORED.

ASSEMBLY SYNTAX
---------------

ALL 68000 INSTRUCTIONS ARE AVAILABLE WITH STANDARD MOTOROLA MNEMONICS.
ALTHOUGH A SUMMARY OF THESE IS GIVEN IN APPENDIX B,THE USER IS ADVISED TO
OBTAIN A BOOK ON 68000 IF HE OR SHE IS NOT ALREADY FAMILIAR WITH
IT.(CAPTAIN CREW'S BOOK-TIP:PROGRAMIERUNG DES M68000 VON T.KING & B.KNIGHT,
ADDISON-WESLY VERLAG!)
INSTRUCTIONS MAY BE ENTERED IN FREE FORMAT,I.E. THERE IS NO NEED TO USE TABs
TO FORMAT THE CODE NEATLY-THE ASSEMBLER WILL AUTOMATICALLY DO THIS ON
LISTING.


A LINE OF CODE CAN BE CONSIDERED TO CONSIST ON 4 FIELDS:



LABLE FIELD         e.g. LOOP:      MUST END IN A COLON.



COMMENT FIELD       
OPERATOR FIELD      e.g. MOVE.B     INSTRUCTIONS ARE ALL
OPERAND FIELD       e.g. D0,(A5)    STANDARD MOTOROLA FORMAT
COMMENT FIELD       e.g. ;SETUP     MUST BEGIN WITH A SEMICOLON



THIS MAY BE ENTERED IN FREE FORMAT,WITH A SPACE ONLY REQUIRED BETWEEN THE
OPERATOR AND OPERAND FIELDS.FOR EXAMPLE THE ABOVE LINE CAN BE ENTERED:
LOOP:MOVE.B D0,(A5);SETUP
ANY OR ALL THE FIELDS MAY BE OMITTED,ALTHOUGH AN OPERAND WITHOUT AN OPERATOR
IS MEANINGLESS,AND AN ERROR MESSAGE WILL RESULT.


LABLES/SYMBOLS
--------------
A LABLE IS JUST A SPECIAL KIND OF OF SYMBOL,AND THE TWO WILL BE DESCRIBED
HERE TOGETHER.A SYMBOL IS A NAME WHICH HAS AN ASSOCIATED VALUE.UNLIKE
VARIABLES IN HIGH LEVEL LANGUAGES,THE NUMBER IS CONSTANT.SYMBOLS CAN BE
DEFINED IN TWO WAYS:
A) BY PLACING IT WITH A COLON AFTERWAEDS,AS A LABLE,IT TAKES ON THE VALUE OF
THE CURRENT LOCATION COUNTER,AND CAN BE USED TO REFER TO THAT LOCATION.
B) BY USING EQU OR = PSEUDO OPS,SEE BELOW.
SYMBOLS CONSIST OF ANY NUMBER OF ALPHANUMERIC LETTERS OR NUMBERS,UPPER
OR LOWER CASE.NO DISTINCTION IS DRAWN BETWEEN UPPER AND LOWER CASE,e.g.HELP
IS THE SAME AS HELP.THE FIRST CHARACTER OF A SYMBOL MUST BE A LETTER .
LONG SYMBOLS MAY BE TRUNCATED ON LISTING.RESERVED WORDS MAY NOT BE USED FOR
SYMBOLS.



COMMENTS
--------
COMMENTS ARE IGNORED BY THE ASSEMBLER.THEY ARE PRECEDED BY A SEMICOLON(OR
STAR),AND TERMINATED BY THE END OF LINE.

NUMERIC EXPRESSIONS
-------------------
NUMBERS MAY BE ENTERED IN ONE OR FOUR BASES,OR AS ASCII CHARACTERS.IN
ADDITION LABELS AND SYMBOLS MAY BE FREELY USED,AND ARITHMETIC OPERATORS
ADD,SUBTRACT,MULTIPLY,DIVIDE,AND,OR AND XOR (+-*/&!~) MAY BE USED TO COMBINE
THESE.PREFIX MINUS AND NOT(-~)ARE ALSO AVAILABLE.
COMPARASONS MAY BE PERFORMED WITH THE OPERATORS EQUAL TO,LESS THAN AND
GREATER THAN (=<>),WHICH RETURN A VALUE OF 0 IF FALSE AND 1 IF TRUE.SQUARE
BRACKETS [] MAY BE USED TO INDICATE ORDERING OF ARITHMETIC,OTHERWISE THE
OPERATIONS ARE PERFORMED STRICTLY IN THE ORDER IN WHICH THEY ARE ENTERED.


THE FOUR BASES ALLOWED ARE: DECIMAL,HEXADECIMAL,OCTAL,BINARY.
DEFAULT ARE DECIMAL NUMBERS ,HEX REQUIRE A $ PREFIX,OCTAL AN @ PREFIX,AND
BINARY REQUIRE A % PREFIX.


ASCII CONSTANTS NEED TO BE PLACED IN A PAIR OF SINGLE OR DOUBLE QOUTES,e.g.
'A','AB','ABC',OR 'ABCD'.WHERE MORE THAN ONE CHARACTER IS PLACED INSIDE THE
QOUTES MARKS,THE FIRST CHARACTER FILLS THE MORE SIGNIFICANT BYTE,etc.,AND
THE LAST CHARACTER IS ALLOCATED THE LEAST SIGNIFICANT BYTE. i.e. THE
CHARACTERS ARE PACKED AT THE BOTTOM OF THE WORD OR LONGWORD.
"ABC"=$00414243.THUS A MOVE.B #'A',D0 AND MOVE.L #'A',D0 WILL BOTH PLACE AN
'A' IN THE LOW BYTE OF D0.

THE LOCATION COUNTER IS REPRESENTED BY A *,AND MAY BE USED FREELY TO
REPRESENT ITS CURRENT VALUE.NB:* REPRESENT THE CURRENT LOCATION COUNTER,NOT
THE VALUE AT THE START OF INSTRUCTION!


LISTING & OPTIONS
-----------------


WHEN THE PROMPT OPTIONS> APPEARS,NONE OR MORE OPTIONS CAN BE SPECIFIED.


OPTIONS V,E AND P
-----------------

LISTING CAN BE SENT TO THE SCREEN BY ENTERING "V" FOR VIDEO. A FORMATTED
LISTING WILL BE PRODUCED. A "P" (OR "E") OPTION WILL SEND THE FORMATTED
LISTING TO THE PRINTER-A LISTING NAME WILL BE PROMPTED FOR. FOR NEATNESS,IT
IS BEST TO ASSEMBLE WITHOUT LISTING UNTIL ERRORS HAVE BEEN REMOVED.IF NO
DEVICE IS SPECIFIED,NO LISTING IS PRODUCED.


OPTION "H"
--------- WILL DIRECT THE LISTING TO HOLD BETWEEN PAGES,WHICH IS USEFUL BOTH
ON SCREEN,AND WITH MANUALLY SHEET FED PRINTERS.CONTINUE BY HITTING ANY KEY.

OPTION "O"
--------- WILL OPTIMIZE BRANCHES.ONLY BRANCHES WITH NO .S OR .L ARE
OPTIMISED,IF YOU DELIBERATLY USE .L THE ASSEMBLER ASSUMES YOU HAVE A REASON!
NOTE THAT THIS MODIFIES THE SOURCE,IT ADDS "S".NOTE THAT OPTION "O" TAKES A
LONG TIME BY SEKA STANDARDS,IT IS NOT RECOMMENDED AND CAN CAUSE STRANGE
EFFECTS SOMETIMES.

ALL SHORT BRANCHES THAT ARE OUT OF RANGE ARE AUTOMATICALLY UPGRADED BY SEKA
TO .L BRANCHES,AND A WARNING MESSAGE IS PRODUCED.THIS OCCURS WHETHER OR NOT
OPTION "O" IS SPECIFIED.

OPTION "L"
--------- WILL PRODUCE LINKABLE CODE,SEE THE LINKER SECTION LATER IN THIS
MANUAL.

A SYMBOL TABLE IS PRODUCED AS STANDARD,WHEN LISTING IS REQUESTED.ENTRIES ARE
OF THE FORM NAME...VALUE,WITH A "+" SIGN AFTER THE VALUE SIGNIFYING A
RELOCATABLE OR EXTERNAL NAME.IF THE NAME IS A MACRO NAME,-MACRO-IS DISPLAYED
INSTEAD OF A VALUE.

ERRORS RAISED IN THE ASSEMBLY(EXCEPT WARNINGS GENERATED BY CHANGING.S BRANCH
TO.L) ARE TREATED AS FATAL IF NO LISTING HAS BEEN REQUESTED,OTHERWISE ALL
THE ERRORS ARE LISTED.WHEN THE ASSEMBLER STOPS ON ERROR,THE CURRENT LINE IS
SET TO THE ONE WHICH CONTAINS THE ERROR,TO AID RAPID CORRECTION.IT IS
RECOMMENDED TO ASSEMBLE WITHOUT LISTING UNTIL ALL ASSEMBLY ERRORS HAVE BEEN
REMOVED,UNLESS A LISTING WITH ERRORS IS DELIBERATLY REQUIRED.MOST USERS FIND
THAT THE STOP-ON-ERROR-WITH-QUICK-EDIT-AND-REASSEMBLE APPROACH IS EASY AND
SIMPLE TO USE.

MORE THAN ONE OPTION CAN BE SPECIFIED ON THE OPTIONS LINE:

e.g.  SEKA>A
      OPTIONS>VH  WILL LIST TO SCREEN,HOLDING BETWEEN PAGES


PSEUDO OPERATORS
----------------

PSEUDO OPERATORS ARE ASSEBLER DIRECTIVES.THEY DO NOT USUALLY GENERATE
CODE,BUT INSTEAD AFFECT THE OPERATION OF THE ASSEMBLER.


THREE PSEUDO OPS TO GENERATE CODE:DC.B,DC.W,DC.L WILL GENERATE BYTES,WORDS
OR LONGWORDS CONTAINING THE VALUE OF THE ARGUMENTS.
BLK WILL LEAVE SPACE FOR DATA TABLES,ect.IT TAKES ONE OR TWO PARAMETERS,THE
FIRST IS THE SPACE IN BYTES (OR WORDS,OR LONGWORDS IF .W OR .L SUFFIXES ARE
ATTACHED),THE SECOND THE DESIRED FILL VALUE.


CODE GENERATEN BEGINS AT AN ORIGIN.THIS CAN BE RELATIVE CODE,AT WHICH CASE
THE CODE BEGINS AT RELATIVE 0-THE CODE AND DATA PSEUDO OP; OR ABSOLUTE
CODE,IN WHICH CASE THE CODE HAS A PRESPECIFIED START ADRESS-SPECIFIED BY THE
ORG DIRECTIVE.ASSEMBLING STRAIGHT INTO MEMORY WILL OCCUR AUTOMATICALLY WITH
RELATIVE CODE,BUT AFTER AN ORG A LOAD DIRECTIVE MUST BE INCLUDED IN THE
SOURCE CODE.THIS SPECIFIES THE ADRESS IN MEMORY TO LOAD THE CODE-AND IS
USUALLY THE SAME AS THE ORG ADRESS.

THE ASSEMBLER WILL STOP ASSEMBLING THE SOURCE FILE WHEN IT MEETS AN END
DIRECTIVE,OR AT THE END OF FILE.


TABLE OF PSEUDO OPERATORS
-------------------------

DC       DEFINES A BYTE,WORD OR LONGWORD IN THE OBJECT CODE. DEFAULT SIZE=.B

BLK      DEFINES A BLOCK OF MEMORY.THE FIRST PARAMETER DEFINES THE SIZE OF
         BLOCK,AND THE SECOND THE VALUE TO FILL IT WITH.DEFAULT SIZE=.B

ORG      TAKES A SINGLE PARAMETER -THE ADRESS TO START ASSEMBLING AT.
         SWITCHES ON ABSOLUTE CODE MODE.


LOAD     TAKES A SINGLE PARAMETER -THE ADRESS TO START LOADINGINTO MEMORY
         FROM.ONLY WORKS IN ABSOLUTE CODE MODE.


CODE     SWITCHES ON RELATIVE MODE,CODE SEGMENT.


DATA     RELATIVE MODE,DATA SEGMENT.(NOTE THAT SOME ASSEMBLERS CALL THAT
         BSS)


EVEN     FORCES THE ADRESS EVEN.IF ODD DEFINES A BYTE


ODD      FORCES THE ADRESS ODD.IF EVEN,DEFINES ABYTE.


END      ENDS THE ASSEMBLY PROCESS.


EQU      BOTH EQU AND = CAN BE USED TO SET A SYMBOL TO A VALUE.


=        SEE EQU.


LIST     TURNS LISTING ON.


NLIST    TURNS LISTING OFF.


PAGE     FORCES A NEW LISTING PAGE.THE PAGE DIRECTIVE LISTS ON THE FIRST
         LINE OF THE NEW (P)AGE.(FORGET IT!)



IF       CONDITIONAL ASSEMBLY-TAKES NUMERIC EXPRESSIONS,WHICH IF IT
         EVALUATES TO 0 (FALSE) DOES NOT ASSEMBLE THE FOLLOWING LINES,AND IF
         NON ZERO (TRUE) ASSEMBLES THE FOLLOWING LINES.


IFB      IF BLANK USUALLY TAKES A MACRO ARGUMENT,AND IS TRUE IF THE ARGUMENT
         IS BLANK, (i.e. null). e.g. IFB?2



ELSE     TOGGLES THE CONDITIONAL ASSEMBLY CONDITION,i.e. IF
         ASSEMBLING,CEASES TO ASSEMBLE AND VICE VERSA.


ENDIF    TERMINATES THE CONDITIONAL ASSEMBLY BLOCK.


MACRO    A SYMBOL GIVEN BEFORE THE MACRO OPS BECOMES THE NAME OF THE MACRO,
         AND IT MAY BE CALLED BY TYPING THAT NAME,FOLLOWED BY A LIST OF
         ARGUMENTS,SEPERATED BY COMMAS.THE CODE OF THE MACRO (ITS
         DEFINITION) FOLLOWS ON SUBSEQUENT LINES,AND ASSEMBLY IS TURNED OFF.


ENDM     ENDS A MACRO DEFINITION,AND RESTORES ASSEMBLY



?N       REQUESTS THAT THE MACRO ARGUMENT N IS USED AT THIS POINT.
         VALID ONLY IN MACRO DEFINITIONS.N=1 THRU 9



?0       GENERATES THREE DIGITS,UNIQUE FOR EVERY MACRO CALL.MAY BE USED TO
         CREATE LOCAL LABELS (e.g. X?0).VALID ONLY IN MACRO DEFINITIONS.



GLOBL    TAKES A LIST OF SYMBOLS WHICH ARE TO BE TREATED AS GLOBALS-SEE
         LINKER SECTION.MUST BE THE FIRST OPERATOR IN THE FILE.MAY ONLY BE
         USED WITH THE "L" OPTION.



PWID     SETS THE PRINTER PAGE WIDHT FOR LISTINGS.DEFAULT 80.



PLEN     SETS THE PRINTER PAGE LENGHT.DEFAULT 66 LINES.



PINIT    SETS A CODE SEQUENCE TO INITIALIZE THE PRINTER,USEFUL TO SET 132
         COLUMNS,USA FONT (WITH #),etc. e.g. FOR EPSON TO SET 132 COLUMNS...
         PINIT 15.

NOTE THE ABOVE 3 ARE IGNORED IF PRINTER LISTING NOT REQUESTED.


ILLEGAL  GENERATES AN ILLEGAL INSTRUCTION,USEFUL FOR CAUSING EXIT TO
         THE SEKA DEBUGGER (OR OTHER DEBUG SYSTEMS).IDENTICAL TO DC.W$4AFC



LINE A)  GENERATES CALLS TO EMULATOR TRAPS,e.g. LINE A$123 IS IDENTICAL TO
LINE F)  DC.W $A123



ALIGN    WILL ALIGN THE OBJECT TO AN N BYTE BOUNDARY;ALIGN 2 IS IDENTICAL TO
         EVEN,ALIGN 4 LONGWORD ALIGNS.ONLY POWERS OF 2 GIVE SENSIBLE RESULTS
         (i.e. 2,4,8,16,etc.)

END OF CHAPTER3(NO COMMENT)
(C)1987 by Captain Chaos from THE CAPTAIN CREW





