asm error when assigning LinkedList to structure field

Everything else that doesn't fall into one of the other PB categories.
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

asm error when assigning LinkedList to structure field

Post 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.
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Post 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()
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post 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.
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post 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.
Post Reply