Page 1 of 1
asm error when assigning LinkedList to structure field
Posted: Tue Jul 07, 2009 9:11 pm
by #NULL
Code: Select all
Structure sgxS_GADGET
design.l
EndStructure
Global Dim sgxID.sgxS_GADGET(99)
Global NewList sgxDesign()
sgxID(99 * (0 Or 1))\design = 123 ; <-- this line compiles
sgxID(99 * (0 + 1))\design = sgxDesign() ; <-- this line compiles
sgxID(99 * (0 Or 1))\design = sgxDesign() ; <-- asm error
if you comment out the last line then the error doesn't occur.
i don't know if this could be a PB bug, because the " * (.. Or ..) " is not supported by PB afaik. i didn't look in the asm code, because i don't know asm.
maybe someone knows what causes this problem?
no problem with PB 430, but with 431.
Posted: Tue Jul 07, 2009 9:49 pm
by Arctic Fox
Why not use | instead of
Or? It compiles without any problem then (but since the linked list doesn't have any elements, it crashes when it has been compiled

)
Code: Select all
sgxID(99 * (0 | 1))\design = 123
sgxID(99 * (0 + 1))\design = sgxDesign()
sgxID(99 * (0 | 1))\design = sgxDesign()
Posted: Wed Jul 08, 2009 7:37 am
by #NULL
the 'Or' stems from a bool macro. can i replace the Or by a | for this purpose?
Code: Select all
Macro sgx_bool(expression)
(0 | (expression))
EndMacro
when i do this change in the original code context, i don't get the asm error but instead an
Code: Select all
Expression is too complex (out of CPU registers). Please split it.
because i use a lot of macros. so it looks like i have to change something there anyway, and it already worked if i replace one of the macros by a procedure (with the same content as the macro, even the 'Or'). i think i will do this instead. the speed is not that vital here because that part of the code is not used without debugger.
Posted: Wed Jul 08, 2009 8:44 am
by #NULL
i just realized that some place i needed the short-circuit-evaluation of 'Or' which doesn't work with '|'. also i remember now that i used macros to throw errors in the line they are caused in and not in a procedure that trows that error. so i have to investigate a bit more to find a solution.