A cross-assembler for writing Super Nintendo programs on an Amiga, sending them to a Super WildCard copier sitting on top of the SNES.
Download TAsm 17 KBTAsm makes programs for the SNES (Super Famicom) using an Amiga and a copier dev kit: the file it makes is normally sent to a Super WildCard that sits on top of the console. It's also semi source-compatible with Fasm by Mr. Madness.
Kickstart/Workbench 2.04 or later and a 68020 or better, which normally rules out the A500 and A2000; an A3000, A1200 or A4000 is fine. It's been tested on an A4000/030; it should work on a 68040, but that's untested. There will never be a version for the older machines.
For an Amiga to Super WildCard cable, get a ready-made RS-232 DB25 male-to-male cable and swap the wires from pin 1 to 13 at one end. The modified end goes to the Amiga, the other to the Super WildCard.
TASM ? | General help |
TASM S sourcename | Assemble a source file; the object is sourcename.SMC unless you add O objectname |
TASM C objectname | Assemble the source loaded in CygnusEd (a great editor), straight from its memory rather than from disk |
TAsm takes as many passes as it needs to resolve an assembly, up to about 20. It assembles in one or two passes when it can, like a conventional assembler, but it will also assemble code that a normal assembler would throw out:
Label1 EQU Label2+1 ; a one-pass assembler fails here Label2 EQU Label3+1 ; a two-pass assembler fails here Label3 EQU Label4+1 Label4 EQU Label5+1 Label5 EQU 10 ; no problem for TAsm
Unused ROM space is filled with $ff, just like a real cartridge.
Keywords go before any code, and the last one of each kind wins: they're dealt with before assembly begins. Defaults are in brackets.
| Keyword | Takes | Sets |
|---|---|---|
BEST | Does CASE ON, SNES ON, S700 ON, SMC ON and NES ON | |
SIZE | number | Size of the object in 32K banks (1); the actual size is 512 bytes larger |
EMUL | number | Emulation number for the header (0) |
CASE | ON/OFF | Case sensitivity (off) |
SNES | ON/OFF | SNES constants (off) |
S700 | ON/OFF | S700 constants (off) |
SMC | ON/OFF | SMC constants (off) |
NES | ON/OFF | NES constants (off) |
LABELS | number | Number of labels (20000) |
TITLE | text | Title of the program (blank) |
MODE | number | Cartridge mode ($20) |
TYPE | number | Cartridge type (0) |
ROMSIZE | number | Size of the ROM: N is 8 × 2N (from SIZE) |
RAMSIZE | number | Size of the RAM: N is 8 × 2N (0) |
COUNTRY | number | Destination country (0) |
MAKER | number | Product maker (0) |
VERSION | number | Current version of the program (0) |
VECTORS | numbers (6) | The jump vector table from $fff4 on: COP, BRK, ABORT, NMI, RESET and IRQ |
Directives can go anywhere in the code. They aren't 65816 or S700 instructions: they control the assembly, or put data into the code.
| Directive | Also written | Does |
|---|---|---|
label EQU number | label = number | Sets the label to the number |
RSRESET | Resets the RS counter | |
RSSET number | Sets the RS counter to a value | |
label RS.B size | label RB size | Sets the label to RS, then adds 1 × size |
label RS.W size | label RW size | Sets the label to RS, then adds 2 × size |
label RS.T size | label RT size | Sets the label to RS, then adds 3 × size |
label RS.L size | label RL size | Sets the label to RS, then adds 4 × size |
ORG number | PC= number, *= number | Sets the PC |
DS.B size | DSB size | Adds 1 × size to the PC; the data is -1 |
DS.W size | DSW size | Adds 2 × size to the PC; the data is -1 |
DS.T size | DST size | Adds 3 × size to the PC; the data is -1 |
DS.L size | DSL size | Adds 4 × size to the PC; the data is -1 |
DCB.B size,number | BLK.B size,number | Adds 1 × size to the PC; the data is the number |
DCB.W size,number | BLK.W size,number | Adds 2 × size to the PC; the data is the number |
DCB.T size,number | BLK.T size,number | Adds 3 × size to the PC; the data is the number |
DCB.L size,number | BLK.L size,number | Adds 4 × size to the PC; the data is the number |
DC.B number(s),... | DB number | Puts the data byte(s) into the code |
DC.W number(s),... | DW number | Puts the data word(s) into the code |
DC.T number(s),... | DT number | Puts the data tword(s) into the code |
DC.L number(s),... | DL number | Puts the data long(s) into the code |
INCBIN filename | Includes the file's image in the object code | |
EMULATE | Inserts code to put the SNES in emulation mode | |
NATIVE | Inserts code to put the SNES in native mode | |
ACCU 8|16 | Tells TAsm the accumulator's size | |
INDEX 8|16 | Tells TAsm the index registers' size | |
INIT | Inserts the standard SNES start-up code |
? is a constant, an equate or a label. * is the current PC.$ is hexadecimal; % is binary.@ is a base from 2 to 9, written @base:number: @3:12 is 5 in decimal." or ' starts ASCII (right-justified, leading bytes zero)..b, .w (the default), .t or .l.| Bytes | as bytes |
| Words | lo-hi: $8009 is stored $0980 |
| Twords | lo-hi-bank: $018009 is stored $098001 |
| Longs | lo-hi-lo-hi: $12345678 is stored $78563412 |
Evaluated in this order: & ! ^ \ / * + -. Brackets aren't allowed, so they can't be confused with the 6502's addressing modes.
If you want brackets, write your own assembler.
> | shift right | 7>2 is 1 |
& | and | 7&2 is 2 |
! | or | 7!2 is 7 |
\ | remainder after a divide | 7\2 is 1 |
/ | integer after a divide | 7/2 is 3 |
* | multiply | 7*2 is 14 |
+ | add | 7+2 is 9 |
- | subtract | 7-2 is 5 |
TAsm has all the official SNES constants built in (see SNES ON). It has equates for the S700, the NES and the Magicom too, though as those
never had official names, the names are our own. You can replace any built-in equate by equating over it, which keeps TAsm compatible with programs that
define the system equates themselves: ROM is normally $8000, but ROM equ 5 makes it 5.
There are far too many to list here: to see them, look at the assembler with an editor. Each constant's value is the long word before the next constant in a hex dump. (If you don't know how to look at the assembler, maybe you shouldn't be using it either.)
PC and * both mean the current value of the PC, which changes with every line. They can also set it, or set labels:
*= *+40 ORG *+80 PC= PC+90 label = *+100 label EQU PC*2+100
Local labels start with _. TAsm stores each with its parent, so in an emergency you can branch to a local label from outside:
BRA Routine_Loop