Surprisingly I just realized that a chain of IF/ELIF/ENDIF will happily assemble all sections:
org 0
v equ 5
if (v==5)
movlw 5
elif (v!=0)
movlw 0
endif
end
Both of the conditional paths are taken in gpasm-1.5.2 #1319 (Aug 1 2021)
00003 if (v==5)
0000 0C05 00004 movlw 5
00005 elif (v!=0)
0001 0C00 00006 movlw 0
00007 endif
Is this by design or a bug? It at least surprised me because I assumed that "EL" in ELIF stood for "ELSE", but after reading the documentation it is not all clear that ELIF is mutually exclusive...
Anonymous
I agree that looks like a bug - your interpretation of "elif" matches everyone else's, even if the gputils documentation is rather vague on the subject. I believe the fix is fairly simple, it just needs applying in several places. The attached patch should do it.
Fixed in svn version [r1328]. Thanks for the bug report and the patch.
Károly
Related
Commit: [r1328]