Version 2.6.3 - Some fixes
This version fixes some errors:
- 6809: corrected opcode for CLR 128,X
- 6809: corrected opcode for LEAY 65535,Y
- all: proper using %%M placeholder in nested macros
This version fixes some errors:
This version adds some new features - see left menu, item “Settings”:
This version fixes some errors:
A new directives for defining numbers, like DB and DW:
0.5
error is fixed, so no 7f 7f ff ff ff
)There is just one update: enable floating point (FP) numbers in the expressions.
It brings three new PRAGMAs:
pragma | meaning |
---|---|
.pragma nofloat | all float numbers are stripped down to the integer (just drop all the digits after the decimal point) |
.pragma float | leave FP numbers intact |
.pragma roundfloat | all FP numbers are rounded to their nearest integer |
This version brings you a two big news. The first is the possibility of nested IFs. So you can write constructions like:
IF foo
...something
IF bar
...something
ELSE
...something else
ENDIF
ELSE
...something
ENDIF
The second improvement is the slightly enriched syntax for the macros.
Old form is .macro name
. New macro can be defined as name: .macro
or name .macro
.
Now you can name formal parameters too. For example - assume a macro cpymem for copy memory content. Such macro has three arguments - source, destination and length. The old form of macro has mute parameters, just referenced by its number:
.macro cpymem
LD HL,%%1
LD DE,%%2
LD BC,%%3
LDIR
.endm
New formal parameters, introduced in revision 2.5.2, allows to write this:
.macro cpymem, src, dst, len
LD HL,src
LD DE,dst
LD BC,len
LDIR
.endm
Preprocessor also check if the number of given parameters is sufficient for the macro, i.e. you cannot specify less parameters than formal, like cpymem 100, 200
.
All those named parameters are strictly local (in fact, they are replaced with its values before assembly phase).
This version fixes a bunch of errors, as reported by Keith Howell (thanks!)
LABEL EQU 123 ;strips comments from listing
fixedFCC "string"
was not implemented. fixedDS "something"
was silently done, totally disrupted the code. fixedEQU something
without a label now throw an exception.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.
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
.
Now you can nest a macro in another macro:
.macro one
ld c,%%1
.endm
.macro two
one 1
add a,c
.endm
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