In the case you do not know SPASM...
First, SPASM is an z80 assembler and linker to calculators. It can output .83p, .8xp and .8xk files, for example. It is also useful for OS programming, SPASM can output .bin (binary files) and there are linkers that convert .bin into a signed .8xu files.
It has many interesting features like importing binary and .bmp picture files, powerful macros and fast assembling.

For now you can find the latest build here:
http://wabbit.codeplex.com/releases/view/45088
and source code here: (along with wabbitemu and wabbitcode)
http://wabbit.codeplex.com/SourceControl/list/changesets

There is some incomplete but essential documentation of SPASM in this pages:
http://svn.revsoft.org/spasm/docs/
http://wabbit.codeplex.com/documentation

Any discussion more directly related to SPASM (assembler bugs and suggestions) and not to macros or documentation should be redirected to here (click).

In the attachments you find a macros pack preferably to SPASM and a document with extra documentation like things you might not know or undocumented until I released.
I still need to polish the macros pack (bug fixes, better usage syntax, documentation or examples) and the extra documentation (possibly to HTML or PDF).
Well Cemetech has no attachments so download here:
http://www.mediafire.com/?sharekey=92b84ab69e90bf797432d3c9683f450a125e63d5ee174940416b94653a3044fd

I hope this is useful. Leave any suggestions, doubts, errors or criticisms.
Good stuff, Galandros. I've of course heard of SPASM before, but right now I use Brass for assembling Doors CS, and TASM + BinPac8x for assembling programs. What does SPASM offer to me over those assembler/linker sets?
Spasm is essentially a drop in replacement for TASM (and much faster), with fewer limitations and very powerful macro features. I'm not sure how it stacks up against Brass (which has always annoyed me with its slow .Net startup times), but it was designed for assembling Zelda quickly...
elfprince13 wrote:
Spasm is essentially a drop in replacement for TASM (and much faster), with fewer limitations and very powerful macro features.
I hear that, that part's good.
elfprince13 wrote:
I'm not sure how it stacks up against Brass (which has always annoyed me with its slow .Net startup times), but it was designed for assembling Zelda quickly...
Slow? It never seems to slow to me...


Code:
C:\Users\CHRIST~1\Documents\DCS7Dev>asmappPrhh dcs7
C:\Users\CHRIST~1\Documents\DCS7Dev
----- Assembling dcs7 for TI-83 Plus APP...
Brass Z80 Assembler 1.0.4.11 - Ben Ryves 2005-2006
--------------------------------------------------
Assembling...
Pass 1 complete. (1606ms).
[...snip...]
Page 0 is 15659 bytes long (725 bytes to spare)
Page 1 is 15133 bytes long (1251 bytes to spare)
Page 2 is 13248 bytes long (3136 bytes to spare)
Pass 2 complete. (967ms).
Writing output file...
Signing application...
Errors: 0, Warnings: 0.
Writing list file...
Done!
I think I can live with 2.6 seconds for my 48KB app to be assembled, signed, and output. Smile
It's the startup time BEFORE it gets to pass 1 that has always bugged me.
elfprince13 wrote:
It's the startup time BEFORE it gets to pass 1 that has always bugged me.
Ah, I could definitely see that as being a big pain. The startup time is definitely less than half a second for me, based on a few tests I just did, so that's not an issue (for me). I'm intrigued by the macro stuff, though, I think that'll be worth checking out.
spasm compiled and signed for me a 12KB APP in 0,120 seconds.
SPASM really helps when you assemble for various calculators and fast debugging.

It is more important to finish stuff than the tools you use but this can help a bit.

For macros the most nifty I have done or found are:

#include "var.inc"
; allocates vars in a much friendlier syntax and much easier to maintain to various safe ram locations
varloc(appbackupscreen)
playerx = var(1)
playery = var(1)
savesp = var(2)
varloc(statsvars)
map = var(100)
enemy = var(50)

#include "relocate.inc"
relocate($8000)
; code
end_relocate()

#include "breakpoints.inc"
ld a,1
breakpoint() ; outputs to a file the addresses of breakpoints in hexadecimal
xor a

#include "convhex.inc"
.echo convhex(appbackupscreen) ; outputs in hexadecimal form, I made a recursive fun macro for the conversion Wink
; I have also done a binary and arbitrary base conversion

Mess with the macros that are in the package. Thinking in this I need to make a option to echo to a file or to the message the assembler delivers in command line (stdout? I think).

;It is also very cool to import b/w or gs bitmaps into the source code. You can even import with masks.
#include "tiles.bmp"
Very nice, those would indeed be handy macros. And I'm impressed with the ability to directly import bitmaps! That would be extremely helpful for a lot of my games, for instance.
KermMartian wrote:
And I'm impressed with the ability to directly import bitmaps! That would be extremely helpful for a lot of my games, for instance.

It is really one of those relatively simple concepts but hard to remember them. Very Happy Most assembly programmers remember first to code/find a tool to convert images to .db directives.

Importing .bin files can have great uses too. Like calc84maniac's TI-BoySE.
I realize this thread is several years old, but I've been using SPASM-NG and was wondering if there is any good documentation on macro capabilities. For instance, can a macro accept a string as a parameter and then output a label? As in mymacro(this) causes the label "this:" to be included at that point in the code?
It's a straight-up text replacement.


Code:
#macro label(name)
name:
#endmacro

label(foo)
    jr foo
What is the rule for macro arguments?

I have this code:
Code:
#macro Subtract outreg inreg0 inreg1
;supposed to be equivalent to: outreg = inreg0 - inreg1
   ld a,inreg0
   sub inreg1
   ld outreg,a
#endmacro

;...

ld b,10
Subtract a b 5

But when I assemble, get this error, and I don't know why:

Code:
error SE106: Could not find label or macro 'inreg0'

What am I doing wrong here? (yes i know this post is like 13 years old i am just smol brain rn)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement