Spin Semiconductor Forum Index Spin Semiconductor
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coding with macroes ?

 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> FV-1 software questions
View previous topic :: View next topic  
Author Message
Admiral_dk



Joined: 27 Sep 2017
Posts: 9

PostPosted: Wed May 16, 2018 7:15 am    Post subject: Coding with macroes ? Reply with quote

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 ?
Back to top
View user's profile Send private message
frank



Joined: 19 Oct 2005
Posts: 988

PostPosted: Wed May 16, 2018 11:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Admiral_dk



Joined: 27 Sep 2017
Posts: 9

PostPosted: Thu May 17, 2018 12:22 am    Post subject: Reply with quote

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 .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> FV-1 software questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group