asm6809 2.2 released

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
sixxie
Posts: 1344
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

asm6809 2.2 released

Post by sixxie »

http://www.6809.org.uk/dragon/asm6809.shtml

Windows build.

Since 2.1:
  • Speed improvements.
  • Fix crash on empty input.
  • Fix crash on bad indexed operand.
  • Minor memory leak fixes.
  • Added simple manpage.
The speed increases are significant on larger input files.
sorchard
Posts: 529
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: asm6809 2.2 released

Post by sorchard »

Excellent :) This has rapidly become my favourite assembler.

Incidentally I've been using the following in a macro to do alignment:

org * + ((-*) & (&1-1))

I wondered if anyone knows of a less ugly way of doing it. I've seen a couple of examples that look nicer but fail when the pc is already aligned.
Stew
sixxie
Posts: 1344
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: asm6809 2.2 released

Post by sixxie »

No and I might have to nick your approach in future ;)
User avatar
Bosco
Posts: 330
Joined: Tue Mar 04, 2014 11:49 pm
Location: Nottingham, UK

Re: asm6809 2.2 released

Post by Bosco »

Thanks sixxie. It's great to have a choice of supported assemblers. :D
sorchard wrote:Incidentally I've been using the following in a macro to do alignment:
org * + ((-*) & (&1-1))
Sounds very useful but I'm not sure I understand the calculation. Is the asterisk a substitute for the address following ORG?

I should say, I'm not familiar with macros either. :oops:
sorchard
Posts: 529
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: asm6809 2.2 released

Post by sorchard »

Macros take all the misery out of making tea...

align macro
org * + (-* & (&1-1))
endm

If you have the above macro defined in your source then you can have statements like the following:

align 32

This will advance the pc (program counter) to the next 32 byte boundary or leave it where it is if already aligned.

* is simply the current value of the program counter. &1 represents the first parameter passed to the macro, 32 in the example, so the macro call becomes the following code:

org * + (-* & 31)

All it is doing is adding just the right amount to the pc to achieve the required alignment. Note that the formula is really only useful for aligning to powers of 2.
Stew
User avatar
Bosco
Posts: 330
Joined: Tue Mar 04, 2014 11:49 pm
Location: Nottingham, UK

Re: asm6809 2.2 released

Post by Bosco »

Cool, thanks for the info sorchard. I'm learning something new everyday. :D
Post Reply