I use this SDCC version
C:\Users\ragozini_a\Documents\SDCC\bin>sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02 4.1.14 #12979 (MINGW64)
published under GNU General Public License (GPL)
I get this kind of warnings while mixing ASM and C
mytest.c:1249: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.rept 2'
mytest.c:1249: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'outi'
mytest.c:1249: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.endm'
mytest.c:1258: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.endm'
mytest.c:1258: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.rept 16'
The outi will be easy to fix. Not sure about the macro stuff.
Anyway, the bug will not result in bad code; the worst that can happen is that SDCC uses a few jp where it could have used jr instead.
In case of need, you can find in attach the whole files generating the warning and the bat file used to run the compiler
The .h files included are here, but to have a full working binary you need the specific LIB files
Let me know if you need a complete project
Related to [#3310] and others.
We currently focus on the mnemonics emitted by sdcc, since peephole rules do not officially support inline assembly.
But it’s probably better to support as much as possible of the syntax accepted by sdasz80.
It’s different with general syntax of sdas, since that would need to be handled at a central point. Including simpler directives like
.strzmight be possible. But with.reptit starts to get complicated, we would need more asm interpretation then is done currently. It can be nested and.endmalso ends other macro blocks, which again could be nested inside.rept.Minimal reproduction code should be: (not working code)
Related
Bugs:
#3310Last edit: Maarten Brock 2022-03-07
I'm getting the same warning also in these cases:
src\mytestrom.c:152: warning 158: overflow in implicit constant conversion
src\mytestrom.c:873: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
src\mytestrom.c:914: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.include "data\metadatamap.asm"'
src\mytestrom.c:967: warning 158: overflow in implicit constant conversion
src\mytestrom.c:1118: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.rept 2'
src\mytestrom.c:1118: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'outi'
src\mytestrom.c:1118: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.endm'
src\mytestrom.c:1127: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.endm'
src\mytestrom.c:1127: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'.rept 16'
src\intro.c:20: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'b_intro = 42'
This time some statements are generated by the compiler itself (e.g the last label b_intro).
The version now is this
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502 4.2.0 #13081 (MINGW32)
published under GNU General Public License (GPL)
I can attach the sources if needed.
Interestingly, I have other .include in other ASM segments where I do not get any warning
Last edit: Ragozini Arturo 2022-03-07
Most of these will get fixed with [patches:#428] (
.reptand direct assignment)And I will look into accepting mnemonic alternatives.
But
.includewon’t be supported as well as.incbin,.irp, macro definitions and macro calls. I tried to support what can be easily calculated or where a worst case maximum size is known.Again, this function is only used to determine the distance between a
jpand a label, if it fails that just means your code uses lessjrthan what would be optimal.Yes,
__bankedgenerates direct assignments, which aren’t understood currently and are the main reason why I wrote [patches:#428]If there is no code that tries to jump over it, it won’t be parsed by this function.
Related
Patches:
#428Last edit: Sebastian Riedel 2022-03-07
ok, thanks!
outi should work now [r13137] in next/
Related
Commit: [r13137]
Finally fixed in [r13187]
Related
Commit: [r13187]