This is my Sega assembler, disassembler, and some simple source code to test
the assembler. The source code prints a text message to the screen, sets up
the VBL to redraw a sprite. The sprite is moved with the joystick. Includes
Sprites for RPG1 from VILEWRATH.

The Assembler. (Oddly named asm.exe) (Version .3)
====================================
This assembler is based on A68k, but A68k only generated S-Records. I
converted it to generates binary files. It accepts all valid 68000
instructions. The assembler now assembles instructions after an include.
The assembler doesn't allow a file to be included from an included file. This
fixes all problems I know of. The assembler now allows binary files to
be included.

Options available in the assembler:

-a Shows Assembled Stuff on screen.
-c Adds Checksum to header.
-f Sets Forward References to Long. (Not sure if this is really needed for
                                    Sega Code. May be removed by next update.)
-s Show Symbol Table
-? Get Help

Assembler Directives.

dc.? (b,w,l)   Declares data elements. Use (') for Strings and ($) for Hex
               numbers.
ds.? (b,w,l) # Creates blank areas of memory. (#) is the number of bytes to
               create.
org ####       Sets address to ####. Blank areas filled with -1 ($ff). This
               seems to be a Sega practice.
Var equ ####   Sets a variable equal to a constant. The assembler replaces
               all instances with the value.
(*)            Defines a comment (Can appear anywhere on a line.)
include        Includes a file for assembly. The assembler now correctly
               assembles instructions after the include. The assembler doesn't
               allow a file to be included from an included file.
incbin         Includes a binary file. The binary file puts in the bytes at
               the current location in the file.
start          Places Address (of current location) in PC position of Sega
               Header.
hbl            Places Address (of current location) in HBL position of the
               Sega Header.
vbl            Places Address (of current location) in VBL position of the
               Sega Header.
int2           Places Address (of current location) in Level 2 interrupt
               position of the Sega Header.

The assembly line must be done as follows.

(Label or Space)Instruction Operand Comment

Labels don't require colons (:).



The Disassembler. (Equally Oddly named disasm.exe)  (Version .1)
==================================================
The disassmbler is based on an Amiga disassembler. I converted it to handle
Sega Headers and to dump data. If the (-a) and (-x) options aren't used the
code can be assembled by asm. The disassembler only accepts decimal values
on the command line. I think it sometimes goes past the lookup table on when
disassembling data as code.

Options available in the disassembler:
-a      Displays Address of Disassembled Instruction on Left of Screen or Page.
-d[bwl] Dumps Data as Bytes, Words or Longs.
-e ###  Ending address of Disassembly or Dump. Address must be in Decimal.
-h      Dumps header. Disassembly Starts at 512.
-s      Start Address. Address must be in Decimal.
-x      Displays Hex value for Assembly Instructions.
-?      Gets Help.



The Source Code. (Simple Text Message)
==========================================================
It prints a text message to the screen, sets up the VBL to redraw a sprite.
The sprite is moved with the joystick. Hopefully I'll post a file that'll
describe the necessary steps to get a Genesis program up and running.


Changes
=======
Disasm -

       Version .1
       ==========
       Didn't put ($) sign in front of Moveq operand.
       Only accepted 16 bit values for command line options.
       Would sometimes put $ffffxxxx in header when value was $0000xxxx.
       Didn't dump correct numbers of bytes, words, or longs.

Asm
       Version .1
       ==========
       - Puts in Correct Rom End Size in $01a4.
       - Doesn't require (dc.b) after (org) at end of program.
       - (-c) command line option adds checksum to header.

       Version .2
       ==========
       - Added START, HBL, VBL, and INT2 assembler directives. Puts addressed
         in Sega Header.

       Version .3
       ==========
       - Added INCBIN assembler directives. Includes binary files.
       - Fixed include bug.
       - Changed include so that a file can't be included from an included
         file.


Please send any bugs you find to cdoty@host.yab.com. I believe the assembler
is bug free. (I'm not promising though.) The disassembler needs work, but it
may take me awhile to do it since I rarely use the disassembler anymore.

