zcc --c-code-in-asm for sdcc compiles

Announcements for z88dk releases
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

zcc --c-code-in-asm for sdcc compiles

Post by alvin »

An option "--c-code-in-asm" for sdcc compiles will embed C code as comments in output assembly listings. With the recent change to using sdcc's preprocessor for sdcc compiles, the C code is correctly placed in the output asm listing.

There is potential for use of this option to cause compile errros when strings containing non-ascii characters are listed in the C code comments. The error arises because one of z88dk's tools, copt (a regular expression engine), is unable to deal with non-ascii character sets. You will still get the asm listing but binary generation will fail. To get the output binary in these cases, simply compile without this option enabled.

Example use:

zcc +zx -vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 test.c -o test --c-code-in-asm --list

Among the generated files will be .lst files containing the asm output of the compiler with c code mingled in as comments.
Post Reply