spasm [-T] [-L] [-O] [-C] [-S] [-I dir] [-A] [-D] [-N] [-V] InputFile [OutputFile]


SPASM has a large number of switches to determine how to assemble your file. With one exception (-V) the switches can come in any order, and can be before or after the input and output file. The input file is the file you wish to assemble. The output file is the file you want to put your assembled code in. If it is omitted SPASM will assemble the file and place the output in a file with the same name and the extension .bin.

The extension on your output file determines the linking done by SPASM. An unknown or .bin extension indicates no linking is to be done and straight binary is outputted. Possible extensions are:
Links for the TI-83 Plus (SE) and TI-84 Plus (SE). Output is a program.
Links for the TI-83 Plus (SE) and TI-84 Plus (SE). Output is a signed application in intel hex format.
Outputs a binary file but pads to 512KB so it can be loaded as an 83 Plus ROM file.
Outputs an intel hex file.
.86p or .86s
Links for the TI 86. Output is a program or a string.
.85p or .85s
Links for the TI-85. Output is a program or a string.
Links for the TI-82. Output is a program.
Links for the TI-83. Output is a program.


All switches are optional
  • -T
This is used to specify that SPASM should output a listing file. Listing files map lines of the source code you've inputted, to binary that SPASM has assembled them to. This is useful to look at how SPASM interpreted lines of assembly, and ensure the outputted code is how you intended. The list file will be named after your input file, with the extension changed to .lst
  • -L
This is used to specify that SPASM should output a label file. Label files are just a listing of what label mapped to what address, one label per line. The label file will be named after your input file, with the extension changed to .lab. You may load these label files into Wabbitemu and use them in the debugger.
  • -O
This switch indicates that no output file should be generated. Internally SPASM does this by not running pass two, which means label references are not resolved. This means that if there are no errors, then your code is syntactically correct, but may contain forward references or missing labels. This is often used in conjunction with -C and -V.
  • -C
This switch puts SPASM in code counter mode. SPASM keeps track of the minimum and maximum amount of time and size of each instruction costs and adds them as a running total. The times and size will be outputted to the commandline. Typically this is only useful for small routines, and works well with -V.
  • -S
This switch puts SPASM in stats mode. SPASM will keep track of different statistics. The statistics will be outputted to the command line.
  • -I dir
This indicates that you want to include a directory to help resolved external files. You can have multiple include directories using multiple -Is or by separating directories with a semi colon. Directories with spaces must be either be escaped, or uses quotes.
  • -A
This switch indicates SPASM should treat labels as case sensitive. By default SPASM is case insensitive.
  • -D
This is used to include command line defines, same as the define preprocessor. -D can either be a name or a name and a value.
  • -N
Stops spasm from outputting any colors to the command line.
  • -V
This switch is used avoid using an input file and whatever input you have will be specified on the command line. This is useful if you want to do quick syntax checks, or wish to automate SPASM via an external program but don't want to write a file to disk. -V assumes that whatever comes after it is input, so it should always be the very last switch.

Last edited Dec 19, 2011 at 3:07 AM by BuckeyeDude, version 1


JamesV Sep 30, 2012 at 12:46 PM 
Sorry Buckeye, another minor thing - I'm encountering an issue with the -L label files. The .lab files generate fine, except that they also include 6 or 7 definitions which must be internal SPASM definitions, such as __BM_MSK_RGB, __LINE, FALSE, TRUE & others.

The problem is that when I go to use a .lab file (renamed to .inc and used as an include file) when compiling another part of my program, I get errors from SPASM because the above labels have already been defined in the .lab file, and SPASM is trying to define them again during the 2nd build - does that make sense?

Is there an automated way to generate a .lab label file that doesn't include the above definitions?

BuckeyeDude Sep 27, 2012 at 10:21 PM 
Nope it was a bug. I've fixed it and uploaded the new version

JamesV Sep 27, 2012 at 12:26 AM 
I'm using the latest 32-bit build of SPASM and for some reason I can't get properly linked .83p files with the generated header & checksum. I'm using the following command line:

spasm test.asm test.83p

The output file has the .83p extension, but it's contents are just a simple binary compile, without the standard .83p format header & checksum.

Am I doing something wrong? Thanks :)