Hi folks,
Finally managed to finish something I started about a month ago - a new release of BeebAsm! Just wander over to the RetroSoftware Mercurial repository,
here, and you'll be able to download the very latest version (as a .zip, .bz2 or .gz archive - whatever takes your fancy).
This is a
release candidate - it still needs a fair bit of testing, but it assembles my existing projects OK, as well as various tests I knocked up to check the new functionality.
So, what's new?
- Macros
For those who wanted them, it's now possible to define assembler macros which can use all the same high-level features of BeebAsm as regular code, including conditional assembly, FOR loops and complex expressions. Here's an example of how they can be used:
Code:
MACRO ADDI8 addr, val
IF val=1
INC addr
ELIF val>1
CLC
LDA addr
ADC #val
STA addr
ENDIF
ENDMACRO
Code:
ADDI8 &900, 1 ; increment &900
ADDI8 score, 5 ; add 5 to score
Conditional expressions are evaluated at the time of instancing, rather than at the time of definition, which means that simple optimisations (such as the one in the example above) can be implemented easily and transparently.
Macro definitions can contain other macros, and can also be called recursively, which in theory should allow for some quite complicated functional programming type constructs.
Macros are by far the biggest change to the codebase, and definitely in need of some good robust testing, so if anyone fancies trying to break BeebAsm with the macro from hell, please do try! (And add your feedback on this thread!)
- PUTFILE command
This provides a simple way of adding a file from your host OS into the current disc image. It's provided as more of a convenience than anything else (since the same result can be achieved with CLEAR/INCBIN/SAVE), but someone asked for it - I forget who now, but it is 5.00 in the morning and I'm sitting here with a sniffling away with a cold.
- PUTBASIC command
Thanks to Thomas Harte's BASIC tokenisation code from this very website, I added this feature into BeebAsm - it is similar to PUTFILE, but it takes a plain text BBC BASIC file, tokenises it, and adds it to the current disc image as a native BBC BASIC format file.
- In addition, I've fixed some almighty big bugs I had with my line parsing (I have to wonder why the code ever worked on any platform...), and tightened a few things up here and there.
Do feel free to try it, and get back to me with any cripplingly bad problems. Also, if anyone has any other small requests, I'll try and add them in before the next proper release.