Hi all!
First post here (I hope I've posted this in the appropriate section of the forum). I've been using nasm for quite a while now for its macro features, to target it to a TTL processor I'm making. I'm positive this isn't the intention of the nasm project, but I haven't found another assembler that's as capable. I have, however, run into a slight problem with my excessive use of macros.
When I assemble the file linked below (and its included macro definitions file) I get this error:
nasm -l hello.lst hello.asm
hello.asm:32: error: parser: instruction expected
Looking at the preprocessor output, I notice this:
COUT:
db 0x43,0x43,0x5F,0x13
%line 32+0 hello.asm
dd 0x00080002
ADDCODE 0x53
%line 35+1 hello.asm
db 0x13,0x37,0,0
%line 35+0 hello.asm
It all runs fine up until that ADDCODE macro is called. It is called many times previously in the assembler file, but it appears to barf at that point. If I comment out everything past the "CFETCH" instruction it assembles correctly, producing the output I was expecting. Am I doing something wrong? Is nasm unable to handle such ridiculous macros?
A short description of my architecture is here. It's a stack architecture, not unlike the Forth language.
http://kaput.homeunix.org/~thrashbarg/sm32/sm32prelim.txtHere are my macro definitions I've created for the architecture:
http://kaput.homeunix.org/~thrashbarg/sm32/macros.incAnd the sample file ("Hello World" no less):
http://kaput.homeunix.org/~thrashbarg/sm32/hello.asmAny help is much appreciated!
-256byteram