I figured something out. I think my problems were mostly down to the fact I was using a literal value as argument to the macro (e.g. "foo 6"). The assembler is not creating a new variable 'n' inside the macro, it is just substituting the argument in place of 'n'. So, of course, where there is "n = n - 2", this is turned in to "6 = 6 - 2", which cannot be done!

If I assign a variable symbol first, then use that as argument to the macro (e.g. "i = 6"; "foo i"), things work essentially as desired.

Regards,
Basil


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to