ASM80.com News

A log of new features

View on GitHub

Version 2.5.0 - partial includes

Now you can include not only the whole file, but only a part of file. This is achieved by the concept of “named block”.

Let’s have a file “library.a80”:

.block serout
; a routine for serial output
@putchar:
...
.endblock

.block serin
;a routine for serial input
@getchar
...
.endblock

In your file, e.g. “main.a80”, you can include the whole file with .include library.a80. Now you can include only the needed parts using a special naming convention file:block.

.include library.a80:serout
call putchar:
...

It includes only the block “serout” (with a global label putchar, in our case). Other blocks will be omitted.

Include local block

You can reference the actual included file by the placeholder this. Let’s add a “serial init” to our library:

...
.block serinit
;serial port init
@uart_init:
...
.endblock

Now you can add the “dependency” with a little bit modification of our library:

.block serout
; a routine for serial output
.include this:serinit
@putchar:
...
.endblock

.block serin
;a routine for serial input
.include this:serinit
@getchar:
...
.endblock

.block serinit
;serial port init
@uart_init:
...
.endblock

Don’t worry, the init code will be included only once! If you need include the block twice or more, you can overrule the check with the dual colon: .include file::block.

Version 2.4.2 - Macro nesting

Now you can nest a macro in another macro:

.macro one
 ld c,%%1
.endm

.macro two
 one 1
 add a,c
.endm

Version 2.4.0 - Macro compound parameter

Let’s imagine a macro:

.macro test
 db %%1
 dw %%2
.endm

If you use this macro in such form, everything is OK:

 test $12, $3456

Two parameters is OK. But what if you need the first DB is something like db $de,$ad,$be,$ef? You can use the compound parameter:

 test {$de,$ad,$be,$ef}, $3456

Version 2.3.0 - Function ISNEAR

Useful for some macros, where you need to decide between near and far jump.

.macro jeq
 .if isnear(%%1-$)
  beq %%1
 .else
  bne $+5
  jmp %%1
 .endif
.endm

Version 2.2.0 - A HD6309 support added

You can use all undocumented features of the HD6309 CPU. Just write as for the 6809 (.a09 extension etc.) and use this:

.pragma 6309

Version 2.1.0 - ANSI sequences in a terminal

Version 2.0.1 - Compile and Send to Terminal

Version 2.0.0 - Terminal