The subject of making a BASIC for the msp430 came up on the msp430 list. My reply was to make an assembler with some BASIC-like augmented commends. Here is what I posted. I think it would be valid for an AVR assembler, too.
> Here is what you should do, if it was up to me to decide what you
> should do with your time. :-)
> I used an assembler for the z80 once that was 'augmented' for lack of
> a better term. It was a macro assembler that had some nice macro
> functions to it.
> It still let you write plain assembly language code: (I'm making up a
> little syntax here)
> Load A, 15
> Mov A, PortB
> But it also let you write loops that translated into assembly: (I
> don't remember the exact syntax.)
> DB loopy
> For loopy = 1 to 100
> Load A, loopy
> Mov A, PortB
> Next loopy
> A register was pushed/popped to support the macro.
> It had string functions and other "high level" constructs that would
> assist in writing assembly. It was an assembly/BASIC mix. I can't tell
> you how easy it became to write a lot of assembly. The output of this
> actually fed into a 'regular' assembler. This was all DOS-based, mind
> you, because it was about a hundred years ago when I wrote z80 code
> for money. My DOS text editor shelled out to run a batch file that
> called both the macro converter and assembler.
> I used this z80 basic/macro program a lot and I think I only utilized
> half of what it could do. IIRC you could use the macro language to
> manipulate 8/16/32 bits. Also single bit functions. I used the
> for/next and other constructs a lot. I think there was a limit on the
> depth that you could nest them, like 8 or so. It actually taught me
> structured programming - somewhat. I had to at least plan...
> I remember it was easy to make a subroutine that passed parameters, so
> I made a lot more subroutines because of that. And reading data out of
> an array (therefore incrementing pointers) was so easy that my code
> there never had bugs.