The difference is subtle, the old syntax does this:
pass1:
`call` will search for both "@test.test1" and "@test1", both fails, adds into symbol table "@test.test1" as "used + undefined" symbol.
`ifused test1` will check table for `@test1`, find nothing, emit no code (and no label).
pass2 + pass3:
the same thing happens, in pass3 the `call` reports missing label "@test.test1".
New syntax:
pass1:
`call` will search for both "@test.test1" and "@test1", both fails, adds into symbol table "@test.test1" as "used + undefined" symbol.
`test1: ifused` will define "@test1" label ("unused + defined" type), will check for usage, no usage, skip block
pass2:
`call` will search for both... and find the "@test1" defined ("defined" type wins over "@test.test1" - which exist, but is "undefined" type), marking the "@test1" as "used"
`test1: ifused` will check usage flag, and emit the block, because now it is used
pass3:
same as pass2
(the "@test.test1" usage symbol is simply hanging there and being ignored, as the global "@test1" will work for all the code).
You can either change your libraries to "new" syntax, or you can do at least one usage in source with full label (`call @test1`), that will be enough to trigger the "old" syntax of IFUSED (if there will be other lines "call test1", they will still prefer @test.test1 in first pass, but since second pass those will find the global @test1 too, so they will end with correct value in pass 3).
So you can choose if you want to edit the old library or the new code.
Makes me wonder under which version your source did compile before, did it work with some older version of sjasmplus? Or did you add modules later and didn't notice until that IFUSED mystery?





Ответить с цитированием