I doubt it makes sense to even try using those IEEE macros for producing CBM style floats - they are too different in the details.
Why is macros cumbersome?
frankly dont think that .float is justified because Gunnar have used it 2 times over a few decades. but it wont hurt either. I cant think of any case I'd use it.
Quoting SlammerWhy is macros cumbersome?I guess you can't do ".float 62.23, 6.28, 1e6" analogous to .byte/.word (apart from having to define a macro/function for the purpose or including some magic library file every time you need this).
Regarding this; Why not add a command line option (Manual - Appendix A - Table A.1.) which allows importing source files? This would allow you to import f.eks. a 'magic library' fP-function as requested here (can't be that hard to write a function to do this) and then add this command line option to the KickAss.cfg file in the KA folder (Ref. 2.3. in the manual). This way these functions are always included (almost like they were internal :D) and would not have to be referenced each time you need them.
I guess you can't do ".float 62.23, 6.28, 1e6" analogous to .byte/.word (apart from having to define a macro/function for the purpose or including some magic library file every time you need this).
I dont use repository, its just a source file and an assembler and a few data files generated in vb6 or python, I dont like to overcomplicate things. but whatever floats your boat, hide the source include in some .cfg file you will forget even exists, its much nicer to be able to see it in the main source right away. but that is just my opinion, you do it as you like.
Quoting KrillI guess you can't do ".float 62.23, 6.28, 1e6" analogous to .byte/.word (apart from having to define a macro/function for the purpose or including some magic library file every time you need this). Also, now you have to write it as something like EmitFloats(List().add(1, 2, 3, 4, 5)) (short of defining all the N variants you'll ever use). If we had variadic macros, you could write EmitFloats(1, 2, 3, 4, 5) instead, which doesn't feel too bad to me. Variadic macros and functions could be generally useful to clean up some noise here and there, and their implementation could be straightforward: they would always be declared with a single List-typed argument, possibly with a dedicated keyword like .varmacro/.varfunction.
.var myList = [[ $10, $20, $30, "Hello", "World"]] .var myHashTable = {{ "Name" : "Codebase64", Message: "Support Frantic and Moloch" }}
.var myList = [[ x foreach x in range(10)]] // Fill 5 sprites in alternating colors // (Spriterange returns structs with n= spriteNo, x=xpos, y=....) .var colors = [[ %10101010, %01010101, %11111111, %10011001, %01100110 ]] .fill [[ colors.get(s.n) foreach s in spriteRange(5) ]]
.pseudocommand float f0 : f1 : f2 : f3 : f4 : f5 : f6 : f7 { .var varargs = List().add(f0,f1,f2,f3,f4,f5,f6,f7) .foreach (var f in varargs) { .if (f.getType()== AT_NONE) .return; .fill myToBasicFloatFunc(f.getValue()) } } // Use: float 1.234 : 0.000123 : -123.123