Coding with macroes ?

Software questions and issues with the FV-1

Moderator: frank

Post Reply
Admiral_dk
Posts: 13
Joined: Wed Sep 27, 2017 8:31 am

Coding with macroes ?

Post by Admiral_dk »

I got a piece of hardware using the FV-1 that has 3 different programs where the only difference i a single coefficient in the code between the 3.

So my question ; is it possible to use something like a macro so I only have to have one source code that results in 3 programs - but only one code to maintain ?
frank
Posts: 1241
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

SpinASM does not have a macro processor built in so for simple things like a coefficient you should be able to use an EQU statement like:

coeff EQU 0.5 ; version 1 code
; coeff EQU 0.6 ; version 2 code
; coeff EQU 0.7 ; version 3 code

later in the code you could use the value of coeff like:

sof coeff, 0.5

So you would just uncomment the desired coefficient and comment out the other two.
Frank Thomson
Experimental Noize
Admiral_dk
Posts: 13
Joined: Wed Sep 27, 2017 8:31 am

Post by Admiral_dk »

Thank you Frank - that is what I do now - I just hoped that I could get away with having only one source file and a conditional assembly ….
Post Reply