You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under cygwin, git is doing an end-of-line conversion in the "Windows" convention. Result: the ASM files under src/hw/ all have the windows "\r\n" convention for end of lines. So far everything is good.
convert, via xxd, ASM files to a character array so that they can be written "as is" in ASM files so we find a trace of the "\r\n" in this binary "dump" of the text files.
Further in the code when we have to write these modules we ultimately use the macro outembedded0, which roughly makes a fwrite () of the "bulk" array.
Since the "asmFile" is a file opened in text mode, and contrary to popular belief, fwrite() performs (again!) a line conversion on this type of file. Result is that the final "\n" of "\r\n" is itself output as "\r\n". This is very surprising since fwrite()rite binary, including text files. But under cygwin we got a different behaviour.
Solutions:
the C library should be told not to interpret line endings in fwrite();
we define outembedded0(e) to jump over the '\r', and so '\n' can be extended by the routines;
Original comment:
Compiling one of the test file under asm6809 generates the following error:
Summarized from forum.system-cfg.com
Under cygwin,
git
is doing an end-of-line conversion in the "Windows" convention. Result: the ASM files undersrc/hw/
all have the windows "\r\n" convention for end of lines. So far everything is good.Then in the makefile the rules like
convert, via
xxd
, ASM files to a character array so that they can be written "as is" in ASM files so we find a trace of the "\r\n" in this binary "dump" of the text files.Further in the code when we have to write these modules we ultimately use the macro
outembedded0
, which roughly makes a fwrite () of the "bulk" array.Since the "asmFile" is a file opened in text mode, and contrary to popular belief,
fwrite()
performs (again!) a line conversion on this type of file. Result is that the final "\n" of "\r\n" is itself output as "\r\n". This is very surprising sincefwrite()
rite binary, including text files. But under cygwin we got a different behaviour.Solutions:
fwrite()
;outembedded0(e)
to jump over the '\r', and so '\n' can be extended by the routines;Original comment:
Compiling one of the test file under asm6809 generates the following error:
By examing the source code:
By using the
od -tc /tmp/out.asm
command, it shows that the file contains double\r
:By removing it:
now it assembles correctly.
The text was updated successfully, but these errors were encountered: