Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.os.msdos.programmer,alt.os.development Subject: Re: Smaller C compiler Date: Tue, 03 Dec 2013 16:26:27 -0500 Organization: Aioe.org NNTP Server Lines: 108 Message-ID: References: NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.os.msdos.programmer:1099 On Tue, 03 Dec 2013 12:23:45 -0500, Rod Pemberton wrote: > On Sun, 01 Dec 2013 11:15:37 -0500, Alexei A. Frounze > wrote: >> Opinions? > > [snip] Opinion set #2: The readme.txt file seems to have LF's while the license.txt file seems to have CRLF's. DOS needs CRLF's. The DOS environment I'm using no longer is able to access the internet. So, I would've preferred the build information in the .zip, instead of a link to the website. If the website changes or goes offline in the future, the .zip doesn't have any instructions. I'd suggest a simple cleaned up text only version of the following sections on the Wiki as build.txt in the .zip: How do I compile Smaller C on/for x86? How do I compile Smaller C for MIPS? How do I run Smaller C? How do I compile Smaller C with itself? The "options" section of the run section could be omitted, optionally. A note that cgx86.c and cgmips.c are included by smlrc.c for those confused about why neither are mentioned in the wiki build instructions would be nice. >> Testers/test-drivers? ;) > > That's coming up next... I was going to try compiling it > with DJGPP, perhaps OpenWatcom. The code does NOT like the '-ansi' GCC option... '-pedantic' and '-Wall' are fine. NASM 0.98.39 has thousands of these errors: smlrcdj.asm:: error: short jump is out of range I have a number of other versions of NASM. The next oldest is 2.06rc8. It and all other more recent versions compile the .o without warnings. These errors can be fixed for all versions of NASM by adding a 'near' keyword for conditional jumps or branches. E.g., jne LXXXX becomes jne near LXXXX I'm not sure if that causes problems with the other supported assemblers or not. Support for 0.98.39 would be nice though. There is a line which tells how to compile with OpenWatcom. However, the section for how to compile Smaller C with itself has nothing for OpenWatcom... For 16-bit OpenWatcom: wcl/l=dos -wx smlrc.c smlrc -seg16 smlrc.c smlrc.asm nasm -f obj -o smlrc.obj smlrc.asm That seems to work. I'm not sure what the wlink line is for OpenWatcom. I've been trying this which fails to link: wlink system dos name smlrc.exe file smlrc.obj For 32-bit OpenWatcom, this gives an error: wcl386/l=dos4g -wx smlrc.c smlrc -seg32 smlrc.c smlrc.asm Error in "smlrc.c" (383:36) Constant too big for 32-bit type So, I didn't make it to nasm on that one. I tried adding -unsigned-char but it still has the same error. -flat32 errors also the same. I'm assuming that's line 383 position 36. If so, thats '+': char TokenIdentName[MAX_IDENT_LEN + 1]; where MAX_IDENT_LEN is #defined as 31. HTH, Rod Pemberton