Closed rkujawa closed 8 years ago
.macro CALLWOS .ifne \2="" mr r3,\2 .endif lwz r0,\1+2(r3) mtlr r0 blrl .endm
But the latest vasm does not handle this correctly anymore (it borks on stuff like /1. /2 ... /9 at least here), so maybe
.macro CALLWOS function, register .ifne \register="" mr r3,\register .endif lwz r0,\function+2(r3) mtlr r0 blrl .endm
I was thinking about something very similar, but it does not seem to work:
error 10 in line 1 of "CALLWOS": number or identifier expected
called from line 217 of "exchandler.s"
> .ifne \register=""
It seems like \register
does not exist at all if the marco is called with one argument.
Maybe I'll have to ask Frank to add NARGS to std
syntax module.
I know there is also a problem with " What if you use ' ?
I tried that. The result is exactly the same, in my opinion it's a problem with \register in this situation, it's not that it is empty, it just does not exist when marco is called with one argument. So the macro syntax does not parse correctly because it became: .ifne =""
.
It used to work with \1 and \2 (look at the old versions of the sonnet macros) I still think something broke during an code update/change.
How about .ifne \register (so without the ="")
Tried that too ;). I wrote to Frank asking him what would be the correct way to solve this.
The thing is that every call of CALLWOS has a second parameter as far as I can see. Especially at line 64 of asmdebugger.s.
Sooo, strange thought but maybe use CALLWOS function,'r31' instead of CALLWOS function,r31. So use the macro as described above (my second post) and adjust the .s files where the CALLWOS macro is being executed.
I had the same error when trying to pass parameters using "parameter" or parameter, but it worked using 'parameter'. Again, it was less strict with version of end 2014.
Frank suggested using .ifnb
to check for emptiness and indeed it was the correct solution.
Fxied in 45fedb515bf04577366316d413cce4103f2cc539.
Did you check whether /1 /2 etc works? It's easier to read the way it is now, but it would confirm a bug if it doesn't work.
2016-02-03 13:01 GMT+01:00 Radosław Kujawa notifications@github.com:
Closed #28 https://github.com/Sakura-IT/SonnetAmiga/issues/28.
— Reply to this email directly or view it on GitHub https://github.com/Sakura-IT/SonnetAmiga/issues/28#event-537429988.
Made a separate issue #29 for this.
Now that we have C compiler producing mostly good executables for Sonnet, I'm slowly working on integrating wosdb into our build system (issue #9).
I've ran into a problem with macro while assembling PPC parts of wosdb. There's a
CALLWOS
macro inwosdb/warpos_lvo.i
(similar to ourCALLPOWERPC
) that usesNARG
variable to extract the number of parameters passed to the macro. However, it seems thatNARG
is not supported forstd
syntax in vasm (orignally wosdb used pasm).This results in the following error:
Any ideas with what this
NARG
construct can be replaced? In worst case I can just split this macro into two separate macros but I feel that would be less elegant.