Difference between revisions of "SNASM68K"

From Sega Retro

(Spiny Norman (https://montypython.fandom.com/wiki/Spiny_Norman) the giant hedgehog from Monty Python's Flying Circus (https://en.wikipedia.org/wiki/Monty Python's Flying Circus ; https://www.youtube.com/watch?v=C-FDW1shmqA) .)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''SNASM68K''' is a command-line assembler for the [[68000|Motorola 68000]] created by British programmer Ian Oliver of [[Realtime Games Software]] while working on [[M-1 Abrams Battle Tank]],later mass produced by Cross Products.
+
{{rewrite|remove first-person writing, consolidate focus, correct formatting, and others.}}
 
+
[[File:SNASM68K Console Interface.jpg|thumb|right|320px]]
It was used as the assembler for a number of [[Sega Mega Drive]] games, including ''[[Flashback]]'' (which explicitly says so in its staff roll, thanking Cross Products). It may have also been used with:
+
'''SNASM68K''' (Spiny Norman's Assembler 68K{{intref|Interview: Realtime Games Software (1989-08-12) by ST NEWS Disk Magazine}}) is a command-line assembler for the [[68000|Motorola 68000]] created by British programmer [[Ian Oliver]] of [[Realtime Games Software]] while working on ''[[M-1 Abrams Battle Tank]]'', later mass produced by [[Cross Products]]. It can be used with either [[wikipedia:GNU Assembler|GNU Assembler]] code or [https://segaretro.org/Sierra_68000_C_Compiler Sierra C].
*''[[Instruments of Chaos Starring Young Indiana Jones]]'' (debug text in the prototype mentions SNASM)
 
*''[[The Lawnmower Man (Mega Drive)|The Lawnmower Man]]'' (one of the error strings is JUMP TO SNASM)
 
*the Japanese build of ''[[Mega lo Mania]]'' (which contains parts of the SNASM68K help text in otherwise unallocated space in ROM)
 
*''[[TNN Bass Tournament of Champions]]'' (has help text from an associated linker, SnLink, which mentions SNASM)
 
  
 
==Usage==
 
==Usage==
 
 
===Options===
 
===Options===
 
Options are preceded by either a dash (-) or a forward slash (/).
 
Options are preceded by either a dash (-) or a forward slash (/).
Line 198: Line 193:
 
These are the arguments that come directly after the options. They specify files to use for various purposes.
 
These are the arguments that come directly after the options. They specify files to use for various purposes.
  
====The Source File====
+
*'''Source:''' The source file is, quite simply, the source file to assemble.
This, quite simply, is the source file to assemble.
+
 
 +
*'''Object:''' This is the assembly destination. It tells the assembler where to put the assembled object files, or binary if the -p option is set.
 +
 
 +
*'''Map:''' This file's use is unknown but may relate to debugging. It is unknown whether it is an input or output file.
 +
*'''Listing:''' If specified, this file will contain the offsets of every label and the assembled hex dump of every instruction, alongside the source listing. This is very useful for debugging, or hex hacking after you've assembled everything. Note that this file can be very large - when used on the ''[[Sonic the Hedgehog 2 (Mega Drive)|Sonic 2]]'' disassembly, the listing file is about 12 megabytes.
  
====The Object File====
+
==History==
This is the assembly destination. It tells the assembler where to put the assembled object files, or binary if the -p option is set.
+
[[File:MD SoA devboard IanOliver.png|[[Ian Oliver]]'s prototype [[SNASM68K]] hardware built during development of ''[[M-1 Abrams Battle Tank]]''.<ref>K Horowitz (2016). ''Playing at the Next Level: A History of American Sega Games''</ref>|thumb|right|320px]]
 +
{{PAGENAME}} is a follow-up to the original SNasm, an assembler created by Martin Day{{magref|one|21|23}} (a.k.a Spiny Norman) of [[SN Systems]]. [[Cross Products]]' developers [[Ian Oliver]] and Andy Craven were reportedly co-developers on the system{{magref|one|8|28}}{{magref|one|20|85}}{{magref|one|20|86}}, with Cross acquiring an official license to the hardware.{{ref|https://web.archive.org/web/19970709123924/http://www.snsys.com:80/snsys.htm}} Initially purchased for developing software for [[Atari ST]] and [[Amiga]] computers, Oliver's development studio [[Realtime Games Software]] soon found themselves contracted by [[Sega of America]] to produce ''[[M-1 Abrams Battle Tank]]'' for the early [[Genesis]] market.
  
====The Map File====
+
The programmer initially found himself struggling to fit the original game's larger [[wikipedia:C (programming language)|C  language]] code into the limited cartridge size and RAM of the Genesis. To address this, he created SNASM68K, a prototype command-line assembler inspired by the original SNasm which automatically translated the code for use with Sega's 16-bit home system<ref>K Horowitz (2016). ''Playing at the Next Level: A History of American Sega Games''</ref>, greatly reducing the difficulty in porting games to the Genesis. Reportedly, while SNasm required some modifications made in order to use with Genesis games, Sega's new home system was relatively similar to the [[Atari ST]] home computer (save for a lack of RAM for screen buffering) - something which Oliver was already familiar with. ''M-1 Abrams Battle Tank'' would eventually be released in 1991, and despite unimpressive sales, Sega of America was pleased with the studio's work.
I think this has something to do with debugging. I don't know if it's an input file or an output file, though.
 
  
====The Listing File====
+
==List of developed games==
If specified, this file will contain the offsets of every label and the assembled hex dump of every instruction, alongside the source listing. This is very useful for debugging, or hex hacking after you've assembled everything. Note that this file can be very large - when used on the Sonic 2 disassembly, the listing file is about 12 megabytes.
+
{{IncompleteList}}
 +
*''[[Flashback]]''<ref>Explicitly states SNASM68K usage in its credits, thanking [[Cross Products]]</ref>
 +
*''[[Instruments of Chaos Starring Young Indiana Jones]]''<ref>Prototype debug text mentions SNASM68K usage</ref>
 +
*''[[The Lawnmower Man (Mega Drive)|The Lawnmower Man]]''<ref>An error string consists of JUMP TO SNASM</ref>
 +
*''[[Mega lo Mania]]'' (NTSC-J)<ref>Contains portions of help text from SNASM68K in otherwise unallocated ROM space</ref>
 +
*''[[TNN Bass Tournament of Champions]]''<ref>Contains portions of help text from SnLink, an associated SMASK68K linking program, which mentions SNASM68K</ref>
  
==Gallery==
+
==Photo gallery==
 
<gallery>
 
<gallery>
 +
MD SoA devboard IanOliver.png|[[Ian Oliver]]'s prototype [[SNASM68K]] hardware built during development of ''[[M-1 Abrams Battle Tank]]''.<ref>K Horowitz (2016). ''Playing at the Next Level: A History of American Sega Games''</ref>
 +
MD SoA devboard IanOliver1.png
 
SNASM68K Console Interface.jpg|SNASM68K Console Interface Front
 
SNASM68K Console Interface.jpg|SNASM68K Console Interface Front
 
SNASM68K Console Interface Back.jpg|SNASM68K Console Interface Back
 
SNASM68K Console Interface Back.jpg|SNASM68K Console Interface Back
 +
SNASM68KConsoleInterface Front.jpg
 +
SNASM68KConsoleInterface Back.jpg
 +
SNASM68K SCSI Bus.jpg|SNASM68K SCSI Bus
 +
</gallery>
 +
 +
==Physical scans==
 +
<gallery>
 +
SNASM68K 68000 Cross Assembler System Manual.pdf|SNASM68K 68000 Cross Assembler System Manual - 8 August 1991
 +
SNASM68K Console and Z80 Notes.pdf|SNASM68K Console and Z80 Notes
 
</gallery>
 
</gallery>
  
Line 219: Line 234:
 
{{Download|version=2.02Ex|file=SNASM68K.7z|filesize=116KB}}
 
{{Download|version=2.02Ex|file=SNASM68K.7z|filesize=116KB}}
 
'''Note:''' This program is not compatible with 64-bit systems.
 
'''Note:''' This program is not compatible with 64-bit systems.
 +
 +
==References==
 +
<references />
  
 
[[Category:Development tools]]
 
[[Category:Development tools]]

Latest revision as of 05:17, 8 June 2024

Rewrite.svg
This article needs to be rewritten to remove first-person writing, consolidate focus, correct formatting, and others..
This article needs to be rewritten to conform to a higher standard of article quality. After the article has been rewritten, you may remove this message. For help, see the How to Edit a Page article.
SNASM68K Console Interface.jpg

SNASM68K (Spiny Norman's Assembler 68K[1]) is a command-line assembler for the Motorola 68000 created by British programmer Ian Oliver of Realtime Games Software while working on M-1 Abrams Battle Tank, later mass produced by Cross Products. It can be used with either GNU Assembler code or Sierra C.

Usage

Options

Options are preceded by either a dash (-) or a forward slash (/).

Switches

Option Description
? Show help text. A nice quick reference.
b # Set input buffer size to #. # is an integer between 1 and 64. If this option is not specified, 16 is assumed fo #.
dmax # Specify maximum data size for DS and DCB directives to #. # is an integer between 1 and 32. If this option is not specified, # is 16.
ef file Specify an external error file. The format for this file is completely unknown, and it doesn't seem to be necessary for our purposes anyway.
err List all error messages the assembler would use. This includes messages imported by ef. Note that the output will be huge, so you should redirect it to a file.
errw Same as above, but warn if no external error message for an error condition is available.
errb List all error messages that are built into the assembler. Ignore non-native messages for an error condition.
emax # Quit assembly after # nonfatal errors. # is a positive integer. If # = 0, assembly will not quit, no matter how many errors are encountered. Default is 30.
hex # Show # hex words in the listing file. # is an integer between 2 and 8. Default is 4.
lnos If set, print source line numbers in listing file.
coff Change endian-ness of COFF object file. Don't bother with it.
d Debug mode. Used for testing make scripts and such. No assembly is actually done.
e s[=val]{;s[=val]}... Equate symbol s to value val. I haven't messed around with this, but I assume that it's for macros.
g Write non-global symbols to object file. Applicable only if -l is set.
i Show an information window while assembling. Only compatible with pure 16-bit MSDOS.
im Import undefined symbols. Applicable only if -l is set.
j path Add path to the include file search list.
k Allow use of certain macro commands like IFEQ.
l Make a linkable output file. Don't bother with it.
o opts Use assembler options opts. See below.
p Make a flat binary output file. Required for use with emulators and final ROMs, omit for use with SNBUG68K debugger.
q quirks Use special features specified by quirks.
s Write s-record output. I have no clue.
sdb Include source debug info in the COFF file for source debugging with the SNBUG68K debugger. Not compatible with emulators.
w Write all equates to the listing file.

Assembler options

These options follow the -o switch. They are succeeded by a + or -, to signify on or off, respectively. Here, we'll append the default status of the option, the one that is used if the option is not specified. Descriptions say what happens if the option is set.

Option Description
bin- Show the full binary output in the listing file.
ae+ Align word and longword data on even boundaries.
an- Allow alternate numeric formats. This means that you can add B, H, or D at the end of data to signify the base, rather than % or $ at the front.
c- Make labels case sensitive.
d- Descope local labels on EQU, EQUR, EQUS, and SET directives.
l- Set a new local label intro character. Takes a single character as a subargument - if this character is used, it counts as a +. Using l+ changes the intro character to a dot (.) rather than an @.
lf- Put conditioned source lines in the listing file. This means that if the assembler was directed to skip certain parts of code, they will still appear in the listing file.
m- Expand macro statements in the listing file.
mc- Print macro calls to the listing file.
mj-

Allow comma streams at the end of macro parameters. I've no clue.

pic- Give errors for position-dependent code.
s- Treat EQU symbols as labels.
t- Truncate bytes and words without issuing errors. I'm not sure what "truncate" means in this case.
w+ Show warning messages.
ws- Allow white space in operands.
v- Export all local symbols to map file.
op- Enable PC relative optimizations. Switch to PC relative addressing when absolute long addressing is used and the code allows such a switch.
os- Enable short branch optimizations. Backwards relative branches will use the short form if possible.
ow- Enable absolute word addressing optimizations. If absolute long addressing is specified, but the address will fit in a word, the shorter form is used. Optimization is not made if the size is specified.
oz- Enable zero displacement (offset-zero) optimizations. If an instruction uses the Indirect Addressing with Displacement addressing mode and the displacement is zero, the instruction will be assembled to Indirect Addressing mode.
oaq- Enable ADDQ optimizations. ADD instructions that can be coded as ADDQ instructions will be assembled as ADDQ instructions.
osq- Enable SUBQ optimizations. Like above.

Quirks

Yes, quirks. That's what the help text calls 'em. They're the special features that the assembler takes. They tend to break compatibility with other assemblers, which is why they're all disabled by default. Syntax is exactly the same as the assembler options above.

Option Description
fl- Force function and predefined constants to lowercase. I have no idea.
mp- Make macro parameters lowercase if case insensitive. Again, no clue, though it would seem to essentially make the parameters case-sensitive.
mc- Allow \ as a continuation character on macro lines.
or- . I don't know why this would be necessary. Maybe for compatibility with other assemblers?
sa- Align with section boundaries. Sections aren't used on current disassemblies (unless Hivebrain used them in his Sonic 1 disassembly), so this isn't necessary... yet.
sc- Use SIERRA C SDB format. This is a complete mystery to me.

Known issues

SNASM68K.EXE is a 16-bit MSDOS executable, which means:

  • It's not compatible with 64 bit Windows (Microsoft dropped support for backwards compatibility with 16-bit programs), but seems to be fully usable with DOSBox
  • Filenames are limited to 8.3 format (both files passed as arguments, and included in source using INCLUDE or INCBIN)
  • The program has a 1024 character line buffer, and will either segfault or assemble garbage when attempting to read lines of code longer than this (watch your data sections)

Files

These are the arguments that come directly after the options. They specify files to use for various purposes.

  • Source: The source file is, quite simply, the source file to assemble.
  • Object: This is the assembly destination. It tells the assembler where to put the assembled object files, or binary if the -p option is set.
  • Map: This file's use is unknown but may relate to debugging. It is unknown whether it is an input or output file.
  • Listing: If specified, this file will contain the offsets of every label and the assembled hex dump of every instruction, alongside the source listing. This is very useful for debugging, or hex hacking after you've assembled everything. Note that this file can be very large - when used on the Sonic 2 disassembly, the listing file is about 12 megabytes.

History

Ian Oliver's prototype SNASM68K hardware built during development of M-1 Abrams Battle Tank.[2]

SNASM68K is a follow-up to the original SNasm, an assembler created by Martin Day[3] (a.k.a Spiny Norman) of SN Systems. Cross Products' developers Ian Oliver and Andy Craven were reportedly co-developers on the system[4][5][6], with Cross acquiring an official license to the hardware.[7] Initially purchased for developing software for Atari ST and Amiga computers, Oliver's development studio Realtime Games Software soon found themselves contracted by Sega of America to produce M-1 Abrams Battle Tank for the early Genesis market.

The programmer initially found himself struggling to fit the original game's larger C language code into the limited cartridge size and RAM of the Genesis. To address this, he created SNASM68K, a prototype command-line assembler inspired by the original SNasm which automatically translated the code for use with Sega's 16-bit home system[8], greatly reducing the difficulty in porting games to the Genesis. Reportedly, while SNasm required some modifications made in order to use with Genesis games, Sega's new home system was relatively similar to the Atari ST home computer (save for a lack of RAM for screen buffering) - something which Oliver was already familiar with. M-1 Abrams Battle Tank would eventually be released in 1991, and despite unimpressive sales, Sega of America was pleased with the studio's work.

List of developed games

px
This list is incomplete.
The following list has been marked as incomplete. If you can, please complete it.

Photo gallery

Physical scans

Downloads

Download.svg Download SNASM68K
File: SNASM68K.7z (116 kB) (info)
Current version: 2.02Ex

Note: This program is not compatible with 64-bit systems.

References

  1. Interview: Realtime Games Software (1989-08-12) by ST NEWS Disk Magazine
  2. K Horowitz (2016). Playing at the Next Level: A History of American Sega Games
  3. The One, "June 1990" (UK; 1990-05-28), page 23
  4. The One, "May 1989" (UK; 1989-04-xx), page 28
  5. The One, "May 1990" (UK; 1990-04-xx), page 85
  6. The One, "May 1990" (UK; 1990-04-xx), page 86
  7. http://www.snsys.com:80/snsys.htm (Wayback Machine: 1997-07-09 12:39)
  8. K Horowitz (2016). Playing at the Next Level: A History of American Sega Games
  9. Explicitly states SNASM68K usage in its credits, thanking Cross Products
  10. Prototype debug text mentions SNASM68K usage
  11. An error string consists of JUMP TO SNASM
  12. Contains portions of help text from SNASM68K in otherwise unallocated ROM space
  13. Contains portions of help text from SnLink, an associated SMASK68K linking program, which mentions SNASM68K
  14. K Horowitz (2016). Playing at the Next Level: A History of American Sega Games