Sbic SOMEPIN(PIN) Expands to 'sbic PINC,2', and then to 'sbic 0x#,2' #define SOMEPIN(p) CONCAT(p,C,2) Define as xC,2 ![]() Something along the lines of: #define CONCAT(a,b,c) a#b#,#c Helper for concatenation You could even go for something more advanced to deal with being able to use input, output, and direction registers. You can simply use a define like in C: #define SOMEPIN PINC,2 Given you are writing in pure assembly, the code is not going to be portable, so you might as well leverage the capabilities of AVR Studio (and in fact anything using AVR libc). ![]() This does similar things to the C/C++ Preprocessor, but works on assembly. Using #definesĪVR Studio passes the code through the AVR ASM Preprocessor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |