Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu!


devel / comp.os.cpm / Aztec-C usage?

SubjectAuthor
* Aztec-C usage?dxforth
`* Re: Aztec-C usage?Nils M Holm
 `* Re: Aztec-C usage?dxforth
  `* Re: Aztec-C usage?yeti
   +- Re: Aztec-C usage?dxforth
   `* Re: Aztec-C usage?yeti
    `* Re: Aztec-C usage?Mark Lawler
     `* Re: Aztec-C usage?Mark Ogden
      `* Re: Aztec-C usage?dxforth
       `* Re: Aztec-C usage?Mark Ogden
        +* Re: Aztec-C usage?ladislau szilagyi
        |`- Re: Aztec-C usage?Mark Ogden
        `* Re: Aztec-C usage?dxforth
         `* Re: Aztec-C usage?Mark Ogden
          `* Re: Aztec-C usage?dxforth
           `* Re: Aztec-C usage?Mark Ogden
            `- Re: Aztec-C usage?dxforth

1
Aztec-C usage?

<uatc9l$3d10b$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4399&group=comp.os.cpm#4399

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Aztec-C usage?
Date: Tue, 8 Aug 2023 22:26:29 +1000
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uatc9l$3d10b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 12:26:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ffb73633e28fe7e90650d76b2ea90b96";
logging-data="3572747"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tea3kYr2nj42+iPoPEfpO"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:BtU3QSGJ4jWXwMEjHASgJc08tAw=
Content-Language: en-GB
 by: dxforth - Tue, 8 Aug 2023 12:26 UTC

I was comparing performance against CP/M C compilers but unable to compile
for Aztec-C.

The distribution/demo EXMPL.C compiles fine:
http://www.retroarchive.org/cpm/lang/az106d.zip

How to get the following to compile? It doesn't like any of the includes
and if I remove them it chokes on FILE etc.

#include "stdio.h"
#include "string.h"
#include "stdlib.h"

main()
{ char buf[128];

FILE *fp1;
FILE *fp2;
fp1 = fopen("foo.txt","r");
fp2 = fopen("bar.txt","w");

if(fp1 == NULL || fp2 == NULL)
{
printf("\nFile error");
exit(0);
}

while(fgets(buf, sizeof(buf), fp1) !=NULL)
{
fprintf(fp2, "%s", content);
}

printf("\ndone");

fclose(fp1);
fclose(fp2);
return 0;
}

Re: Aztec-C usage?

<kjf1ifFi86sU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4401&group=comp.os.cpm#4401

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: nmh...@sraddha.invalid (Nils M Holm)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: 8 Aug 2023 14:25:19 GMT
Organization: TARFU
Lines: 8
Sender: Nils M Holm <nmh@sraddha.local>
Message-ID: <kjf1ifFi86sU1@mid.individual.net>
References: <uatc9l$3d10b$1@dont-email.me>
X-Trace: individual.net ltZIzJjPuGLY36VN+bnDzAT19gl+zfYtnscNBX6WUfsZ9iR75w
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:lESFH04lpYBDmMaXVfSOuXh3tpE= sha256:0Snzgio/VbmBsi3pDqRMJ6y0VPrtRonioELNLSeAyU0=
User-Agent: tin/2.6.1-20211226 ("Convalmore") (FreeBSD/12.4-RELEASE (amd64))
 by: Nils M Holm - Tue, 8 Aug 2023 14:25 UTC

dxforth <dxforth@gmail.com> wrote:
> How to get the following to compile? It doesn't like any of the includes
> and if I remove them it chokes on FILE etc.

Did you unpack HEADER.ARC?

--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org

Re: Aztec-C usage?

<uatqp2$3fbdj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4404&group=comp.os.cpm#4404

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Wed, 9 Aug 2023 02:33:39 +1000
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uatqp2$3fbdj$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 16:33:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ffb73633e28fe7e90650d76b2ea90b96";
logging-data="3648947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mJVoow3qFrUWSgMxinzMZ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:XYcFNcEXyc01vH7Tx5qSDyxBGsE=
In-Reply-To: <kjf1ifFi86sU1@mid.individual.net>
Content-Language: en-GB
 by: dxforth - Tue, 8 Aug 2023 16:33 UTC

On 9/08/2023 12:25 am, Nils M Holm wrote:
> dxforth <dxforth@gmail.com> wrote:
>> How to get the following to compile? It doesn't like any of the includes
>> and if I remove them it chokes on FILE etc.
>
> Did you unpack HEADER.ARC?
>

Via the undocumented ARCV.COM program? It crossed my mind but nothing I
tried worked.

Re: Aztec-C usage?

<878ral5vod.fsf@tilde.institute>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4405&group=comp.os.cpm#4405

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: yet...@tilde.institute (yeti)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Tue, 08 Aug 2023 16:46:26 +0000
Organization: Democratic Order of Pirates International (DOPI)
Lines: 22
Message-ID: <878ral5vod.fsf@tilde.institute>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="2b52221cdf41ee0fc24b2cab06d563bd";
logging-data="3661350"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19W1ETb2ncqU1LE46sFctog"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:u29mTIFGfFtqPFi2/F5uPS9FfXc=
sha1:Wg7y6GyLCDdECu0EpA0Me1jrINw=
X-Face: JB-\p%)Y0PX_,Tk+p);b-nf%:."W<D+WP_rRLg2zs=!L+TZSpg7HQXBvH=?{ND1v9$(%KP9
O-^RH(3cis(xZ,'7_)JmCC3iy[#\\TM5+T!apVL~,.]mWo$$)F:S?8#`]aj9Jae6OXxpl::RyW_ZQI
h~#P~#dWIIW-A{='NJE@{qoipjEUjVAMucw2ARUwql!Y>u(XeB(I2yy\EfMROJ^vplOD_;7%5lOB\:
z(]-BTG2FO"y$-$|NT!}F=.!e@Z/aopOc8j<hVISt
 by: yeti - Tue, 8 Aug 2023 16:46 UTC

dxforth <dxforth@gmail.com> writes:

> On 9/08/2023 12:25 am, Nils M Holm wrote:
>> dxforth <dxforth@gmail.com> wrote:
> Via the undocumented ARCV.COM program? It crossed my mind but nothing I
> tried worked.

Yes: `arcv file.arc` did it for me.
And I commented away all includes except the one for stdio.
And maybe renaming content to buf helped a bit too.

If there is as searchable A-C documentation somewhere, I'd like to get a
pointer to it.

This one looks like images in a PDF only:
<http://www.aztecmuseum.ca/docs/Aztec_C_1.06_User_Manual_Mar84.pdf>

--
Take Back Control! -- Mesh The Planet!
I do not play Nethack, I do play GNUS! o;-)
Solid facts do not need 1001 pictures.

Re: Aztec-C usage?

<uatt69$3ft9d$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4406&group=comp.os.cpm#4406

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Wed, 9 Aug 2023 03:14:50 +1000
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uatt69$3ft9d$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 17:14:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ffb73633e28fe7e90650d76b2ea90b96";
logging-data="3667245"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PZ43ZyzTiZNh6uq2pr219"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:2lsjPNkUG02OAhdTi9OVxcWJhkw=
Content-Language: en-GB
In-Reply-To: <878ral5vod.fsf@tilde.institute>
 by: dxforth - Tue, 8 Aug 2023 17:14 UTC

On 9/08/2023 2:46 am, yeti wrote:
> dxforth <dxforth@gmail.com> writes:
>
>> On 9/08/2023 12:25 am, Nils M Holm wrote:
>>> dxforth <dxforth@gmail.com> wrote:
>> Via the undocumented ARCV.COM program? It crossed my mind but nothing I
>> tried worked.
>
> Yes: `arcv file.arc` did it for me.
> And I commented away all includes except the one for stdio.
> And maybe renaming content to buf helped a bit too.

Well that's weird because now it works.

> If there is as searchable A-C documentation somewhere, I'd like to get a
> pointer to it.
>
> This one looks like images in a PDF only:
> <http://www.aztecmuseum.ca/docs/Aztec_C_1.06_User_Manual_Mar84.pdf>

The PDF file I had included only a few bookmarks. A while back I went
through and added the missing ones. It's here should anyone want it:

https://drive.google.com/drive/folders/1kh2WcPUc3hQpLcz7TQ-YQiowrozvxfGw

Re: Aztec-C usage?

<874jl95u8j.fsf@tilde.institute>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4407&group=comp.os.cpm#4407

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: yet...@tilde.institute (yeti)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Tue, 08 Aug 2023 17:17:32 +0000
Organization: My little echo chamber.
Lines: 17
Message-ID: <874jl95u8j.fsf@tilde.institute>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="2b52221cdf41ee0fc24b2cab06d563bd";
logging-data="3668215"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4rFaZQCAZaE0nbgCTtISG"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:cVkIu/bw5+M1SKMy60VsUdNSRuY=
sha1:PfkfB9iN5u66xHcy8WVH66P4VUo=
X-Face: +nC9IV-=K@L=/)p^fu]8NuY`Bg&$QfuYokvS*BweD8ItC>N)7g&<XQo[_)i,zQ0tir%%gAR
yP2tq^P-Q1/>wz?ADU)hi@vAXc>wTxV^?bFTEYdL?>%?8_+h[3r.#F
 by: yeti - Tue, 8 Aug 2023 17:17 UTC

yeti <yeti@tilde.institute> writes:

> If there is as searchable A-C documentation somewhere, I'd like to get a
> pointer to it.
>
> This one looks like images in a PDF only:
> <http://www.aztecmuseum.ca/docs/Aztec_C_1.06_User_Manual_Mar84.pdf>

Typical magic: I need to ask to trigger finding it...

That one has search ability added:
<http://bitsavers.org/pdf/manx/Aztec_C_CPM_1.06_User_Manual_Mar84.pdf>

--
Take Back Control! -- Mesh The Planet!
I do not play Nethack, I do play GNUS! o;-)
Solid facts do not need 1001 pictures.

Re: Aztec-C usage?

<fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4409&group=comp.os.cpm#4409

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:94f:b0:635:d9b4:ba20 with SMTP id dn15-20020a056214094f00b00635d9b4ba20mr16094qvb.11.1691533573668;
Tue, 08 Aug 2023 15:26:13 -0700 (PDT)
X-Received: by 2002:a05:6870:5b07:b0:1b3:ecf3:fa9a with SMTP id
ds7-20020a0568705b0700b001b3ecf3fa9amr307367oab.5.1691533573356; Tue, 08 Aug
2023 15:26:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Tue, 8 Aug 2023 15:26:12 -0700 (PDT)
In-Reply-To: <874jl95u8j.fsf@tilde.institute>
Injection-Info: google-groups.googlegroups.com; posting-host=73.11.105.60; posting-account=W8TmjQoAAAAYG_9SYHmbSqqIJZ5mHpAQ
NNTP-Posting-Host: 73.11.105.60
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute> <874jl95u8j.fsf@tilde.institute>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
Subject: Re: Aztec-C usage?
From: markslaw...@gmail.com (Mark Lawler)
Injection-Date: Tue, 08 Aug 2023 22:26:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2247
 by: Mark Lawler - Tue, 8 Aug 2023 22:26 UTC

Now you all got my curiosity up. <GRIN>

I have been using the Aztec-C 1.05c and 1.06D compilers on my IMSAI 8080 replica to write a few programs as that was what I used to use on my old Kaypro II & 4's back in the day. Since I've been running my own blinkenlights program forever on this thing, I decided to stop that program and give this a try...

Removing the references to include both string.h and stdlib.h, and fixing the fprintf() parameter error I was able to use the Manx Aztec CC.SUB submit file to compile the source into an ASM, assemble into object code, then link into a COM no errors. The program even runs correctly! Thanks for exercising my brain today and reminding me that PIP is still my favorite command of all time!!! ;)

I am curious why version 1.06D generated an ASM that then the AS command generated errors on out of the gate, yet version 1.05c generated an ASM that worked perfectly. That'll be tomorrow's project...

Best,
-Mark

Re: Aztec-C usage?

<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4418&group=comp.os.cpm#4418

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:620a:2841:b0:76c:c808:5a6a with SMTP id h1-20020a05620a284100b0076cc8085a6amr21789qkp.9.1691756579647;
Fri, 11 Aug 2023 05:22:59 -0700 (PDT)
X-Received: by 2002:a17:903:32d2:b0:1b7:f443:c807 with SMTP id
i18-20020a17090332d200b001b7f443c807mr677313plr.7.1691756579369; Fri, 11 Aug
2023 05:22:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Fri, 11 Aug 2023 05:22:58 -0700 (PDT)
In-Reply-To: <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:80d7:5be3:a0a0:4925;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:80d7:5be3:a0a0:4925
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ogde...@gmail.com (Mark Ogden)
Injection-Date: Fri, 11 Aug 2023 12:22:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mark Ogden - Fri, 11 Aug 2023 12:22 UTC

On Tuesday, 8 August 2023 at 23:26:14 UTC+1, Mark Lawler wrote:
> Now you all got my curiosity up. <GRIN>
>
> I have been using the Aztec-C 1.05c and 1.06D compilers on my IMSAI 8080 replica to write a few programs as that was what I used to use on my old Kaypro II & 4's back in the day. Since I've been running my own blinkenlights program forever on this thing, I decided to stop that program and give this a try...
>
> Removing the references to include both string.h and stdlib.h, and fixing the fprintf() parameter error I was able to use the Manx Aztec CC.SUB submit file to compile the source into an ASM, assemble into object code, then link into a COM no errors. The program even runs correctly! Thanks for exercising my brain today and reminding me that PIP is still my favorite command of all time!!! ;)
>
> I am curious why version 1.06D generated an ASM that then the AS command generated errors on out of the gate, yet version 1.05c generated an ASM that worked perfectly. That'll be tomorrow's project...
>
> Best,
> -Mark
Using the 8080 and z80 aztec 1.06D compilers on the simh altair simulator, the code compiles and runs without a problem, once the fprintf fix is done and the two header files that are not supplied with Aztec C, are removed.
The same applies using the MSDOS hosted cross compilers.
Note, using fread / fwrite / fputs rather than fprintf/ printf, reduces the executable size by nearly 15% and should be quicker. It also preserves null characters from the input file.
In terms of raw performance, using a bigger buffer size (power of 2 e.g. 4096) and using rawio, i.e. open, read, write and close is most likely to offer the best performance and probably the smallest code.

Mark

Re: Aztec-C usage?

<ub9ilr$1mn28$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4425&group=comp.os.cpm#4425

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Sun, 13 Aug 2023 13:28:58 +1000
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <ub9ilr$1mn28$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute>
<fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 03:28:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4e83c4580745025ef8b2b034777136a0";
logging-data="1793096"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j3Oyl0OrvzW9Oi/mg7z9l"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:LWXNs5BmrwWPTkfjhVXVcjUt7g0=
Content-Language: en-GB
In-Reply-To: <c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
 by: dxforth - Sun, 13 Aug 2023 03:28 UTC

On 11/08/2023 10:22 pm, Mark Ogden wrote:
> ...
> Note, using fread / fwrite / fputs rather than fprintf/ printf, reduces the executable size by nearly 15% and should be quicker. It also preserves null characters from the input file.

I know little about C. My interest was prompted after finding Forth's READ-LINE
ran slowly under CP/M. I wanted to see how C compilers under CP/M performed.
Aztec C fgets proved to be 3x faster. I concluded it was due to the buffered I/O.
In contrast READ-LINE reads chunks at a time. If too much (most of the time) the
file pointer is shifted backwards for the next read. While not a problem under
MS-DOS, it's a performance killer under CP/M.

FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
Unbeknown to me the source text file used included some 'foreign' characters
with bit 7 set. These did not pass through correctly e.g.

E2 80 99

became

62 19

bug?

Re: Aztec-C usage?

<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4426&group=comp.os.cpm#4426

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1812:b0:40f:e2a5:3100 with SMTP id t18-20020a05622a181200b0040fe2a53100mr109012qtc.6.1691912583618;
Sun, 13 Aug 2023 00:43:03 -0700 (PDT)
X-Received: by 2002:a05:6a00:851:b0:687:322c:b72e with SMTP id
q17-20020a056a00085100b00687322cb72emr3218846pfk.5.1691912583096; Sun, 13 Aug
2023 00:43:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Sun, 13 Aug 2023 00:43:02 -0700 (PDT)
In-Reply-To: <ub9ilr$1mn28$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> <ub9ilr$1mn28$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ogde...@gmail.com (Mark Ogden)
Injection-Date: Sun, 13 Aug 2023 07:43:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3188
 by: Mark Ogden - Sun, 13 Aug 2023 07:43 UTC

On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
> On 11/08/2023 10:22 pm, Mark Ogden wrote:
> > ...
> > Note, using fread / fwrite / fputs rather than fprintf/ printf, reduces the executable size by nearly 15% and should be quicker. It also preserves null characters from the input file.
> I know little about C. My interest was prompted after finding Forth's READ-LINE
> ran slowly under CP/M. I wanted to see how C compilers under CP/M performed.
> Aztec C fgets proved to be 3x faster. I concluded it was due to the buffered I/O.
> In contrast READ-LINE reads chunks at a time. If too much (most of the time) the
> file pointer is shifted backwards for the next read. While not a problem under
> MS-DOS, it's a performance killer under CP/M.
>
> FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
> Unbeknown to me the source text file used included some 'foreign' characters
> with bit 7 set. These did not pass through correctly e.g.
>
> E2 80 99
>
> became
>
> 62 19
>
> bug?
It is not a bug.
Aztec C 1.06D does not have separate open modes for text and binary, but uses special functions e.g. agetc and aputc to handle text files.
Under the covers fgets calls agetc, which removes the top bit, detects 1A as EOF and also skips null and carriage return, hence the 80h is removed, as it becomes 0 when the top bit is removed.
Using fread/fwrite should avoid this, also using raw read/write with a buffer a reasonable multiple of the sector size, would avoid too many multiple buffer copies and should be the most performant.

Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.

Mark

Re: Aztec-C usage?

<d355e18f-3b3f-42d0-9198-e3a9bde7980fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4427&group=comp.os.cpm#4427

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:8ef:b0:63f:6499:86d0 with SMTP id dr15-20020a05621408ef00b0063f649986d0mr87828qvb.5.1691914428535; Sun, 13 Aug 2023 01:13:48 -0700 (PDT)
X-Received: by 2002:a17:90a:f306:b0:268:2de3:e6b2 with SMTP id ca6-20020a17090af30600b002682de3e6b2mr1541129pjb.5.1691914428006; Sun, 13 Aug 2023 01:13:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.14.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Sun, 13 Aug 2023 01:13:47 -0700 (PDT)
In-Reply-To: <df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=86.125.83.230; posting-account=Zav8fAoAAACRqOOZYggbw7GhvvIJEzFn
NNTP-Posting-Host: 86.125.83.230
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net> <uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute> <874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com> <c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> <ub9ilr$1mn28$1@dont-email.me> <df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d355e18f-3b3f-42d0-9198-e3a9bde7980fn@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Sun, 13 Aug 2023 08:13:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: ladislau szilagyi - Sun, 13 Aug 2023 08:13 UTC

Hi Mark,

I'm using the version v3.09 of the HiTech C compiler.

> Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.
>
> Mark

.... you're right about the "t" modifier (HiTech C considers 'text' mode as the default mode), but it has the "b" binary modifier (you can open a binary file using fopen(fname, "rb")

Ladislau

Re: Aztec-C usage?

<ubac87$1plcu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4428&group=comp.os.cpm#4428

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Sun, 13 Aug 2023 20:45:28 +1000
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ubac87$1plcu$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute>
<fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
<ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 10:45:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4e83c4580745025ef8b2b034777136a0";
logging-data="1889694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3h34pgSg2QXgx/sj750sU"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:kboupjh61PgVrX6C0XPOSpaNTXU=
Content-Language: en-GB
In-Reply-To: <df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
 by: dxforth - Sun, 13 Aug 2023 10:45 UTC

On 13/08/2023 5:43 pm, Mark Ogden wrote:
> On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
>> ...
>> FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
>> Unbeknown to me the source text file used included some 'foreign' characters
>> with bit 7 set. These did not pass through correctly e.g.
>>
>> E2 80 99
>>
>> became
>>
>> 62 19
>>
>> bug?
> It is not a bug.
> Aztec C 1.06D does not have separate open modes for text and binary, but uses special functions e.g. agetc and aputc to handle text files.
> Under the covers fgets calls agetc, which removes the top bit, detects 1A as EOF and also skips null and carriage return, hence the 80h is removed, as it becomes 0 when the top bit is removed.
> Using fread/fwrite should avoid this, also using raw read/write with a buffer a reasonable multiple of the sector size, would avoid too many multiple buffer copies and should be the most performant.
>
> Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.

If clearing bit 7 isn't a bug, perhaps a dubious feature :)

Re: Aztec-C usage?

<d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4429&group=comp.os.cpm#4429

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:4c1a:b0:63c:edce:c71e with SMTP id qh26-20020a0562144c1a00b0063cedcec71emr144995qvb.3.1691938800101;
Sun, 13 Aug 2023 08:00:00 -0700 (PDT)
X-Received: by 2002:a05:6a00:1ad3:b0:687:3f7a:aea7 with SMTP id
f19-20020a056a001ad300b006873f7aaea7mr3302044pfv.0.1691938799506; Sun, 13 Aug
2023 07:59:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Sun, 13 Aug 2023 07:59:58 -0700 (PDT)
In-Reply-To: <ubac87$1plcu$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> <ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com> <ubac87$1plcu$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ogde...@gmail.com (Mark Ogden)
Injection-Date: Sun, 13 Aug 2023 15:00:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mark Ogden - Sun, 13 Aug 2023 14:59 UTC

On Sunday, 13 August 2023 at 11:45:30 UTC+1, dxforth wrote:
> On 13/08/2023 5:43 pm, Mark Ogden wrote:
> > On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
> >> ...
> >> FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
> >> Unbeknown to me the source text file used included some 'foreign' characters
> >> with bit 7 set. These did not pass through correctly e.g.
> >>
> >> E2 80 99
> >>
> >> became
> >>
> >> 62 19
> >>
> >> bug?
> > It is not a bug.
> > Aztec C 1.06D does not have separate open modes for text and binary, but uses special functions e.g. agetc and aputc to handle text files.
> > Under the covers fgets calls agetc, which removes the top bit, detects 1A as EOF and also skips null and carriage return, hence the 80h is removed, as it becomes 0 when the top bit is removed.
> > Using fread/fwrite should avoid this, also using raw read/write with a buffer a reasonable multiple of the sector size, would avoid too many multiple buffer copies and should be the most performant.
> >
> > Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.
> If clearing bit 7 isn't a bug, perhaps a dubious feature :)
I suspect is mainly due to history. It was not unknown for serial connected terminals to add a parity bit. As fgets is reading a line, rather than a binary stream, then removing the parity bit is not unreasonable. It would also have made reading Wordstar documents straightforward, removing the top bits it used. It was only later that non ascii characters i.e. (80H-FFH) were more widely supported.

Re: Aztec-C usage?

<33dacb9b-8ee5-4d40-a60f-0e1268d629bdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4430&group=comp.os.cpm#4430

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:2ca:b0:40e:b4f2:b382 with SMTP id a10-20020a05622a02ca00b0040eb4f2b382mr99299qtx.11.1691939885496;
Sun, 13 Aug 2023 08:18:05 -0700 (PDT)
X-Received: by 2002:a17:902:ce84:b0:1bb:91c9:d334 with SMTP id
f4-20020a170902ce8400b001bb91c9d334mr2990960plg.0.1691939885233; Sun, 13 Aug
2023 08:18:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Sun, 13 Aug 2023 08:18:04 -0700 (PDT)
In-Reply-To: <d355e18f-3b3f-42d0-9198-e3a9bde7980fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> <ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com> <d355e18f-3b3f-42d0-9198-e3a9bde7980fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <33dacb9b-8ee5-4d40-a60f-0e1268d629bdn@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ogde...@gmail.com (Mark Ogden)
Injection-Date: Sun, 13 Aug 2023 15:18:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mark Ogden - Sun, 13 Aug 2023 15:18 UTC

On Sunday, 13 August 2023 at 09:13:49 UTC+1, ladislau szilagyi wrote:
> Hi Mark,
>
> I'm using the version v3.09 of the HiTech C compiler.
> > Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.
> >
> > Mark
> ... you're right about the "t" modifier (HiTech C considers 'text' mode as the default mode), but it has the "b" binary modifier (you can open a binary file using fopen(fname, "rb")
>
> Ladislau
In general C compilers for CP/M, MSDOS and Windows, treat the "t" modifier as the default. For Unix variants the modifiers are ignored, however processing CP/M or Windows text files on Unix variants has its own issues as the carriage return is passed through on input.

For all compilers replicating carriage return, followed by multiple line feeds, as was common for line printer interfacing, is more challenging to implement. For CP/M, MSDOS and windows writing in binary mode is an option, however although Unix variants can write the characters to a file, if writing directly to a device, the auto expansion of "\n" to "\r\n" needs to turned off.

Re: Aztec-C usage?

<ubc3c6$216r0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4432&group=comp.os.cpm#4432

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Mon, 14 Aug 2023 12:26:15 +1000
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ubc3c6$216r0$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute>
<fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
<ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
<ubac87$1plcu$1@dont-email.me>
<d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 14 Aug 2023 02:26:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b4f947b7d038e0cd1657f3c877574121";
logging-data="2136928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19W+7yk3oZrgzWMS536tV5D"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:svYaGiDZLhyRXFX4QBfvWh3cON8=
In-Reply-To: <d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Mon, 14 Aug 2023 02:26 UTC

On 14/08/2023 12:59 am, Mark Ogden wrote:
> On Sunday, 13 August 2023 at 11:45:30 UTC+1, dxforth wrote:
>> On 13/08/2023 5:43 pm, Mark Ogden wrote:
>>> On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
>>>> ...
>>>> FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
>>>> Unbeknown to me the source text file used included some 'foreign' characters
>>>> with bit 7 set. These did not pass through correctly e.g.
>>>>
>>>> E2 80 99
>>>>
>>>> became
>>>>
>>>> 62 19
>>>>
>>>> bug?
>>> It is not a bug.
>>> Aztec C 1.06D does not have separate open modes for text and binary, but uses special functions e.g. agetc and aputc to handle text files.
>>> Under the covers fgets calls agetc, which removes the top bit, detects 1A as EOF and also skips null and carriage return, hence the 80h is removed, as it becomes 0 when the top bit is removed.
>>> Using fread/fwrite should avoid this, also using raw read/write with a buffer a reasonable multiple of the sector size, would avoid too many multiple buffer copies and should be the most performant.
>>>
>>> Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.
>> If clearing bit 7 isn't a bug, perhaps a dubious feature :)
> I suspect is mainly due to history. It was not unknown for serial connected terminals to add a parity bit. As fgets is reading a line, rather than a binary stream, then removing the parity bit is not unreasonable. It would also have made reading Wordstar documents straightforward, removing the top bits it used. It was only later that non ascii characters i.e. (80H-FFH) were more widely supported.

It'd be interesting to know whether Manx persisted with this in later versions
of the compiler. Hitech C fgets works fine with 8-bit characters.

Re: Aztec-C usage?

<85a94974-4904-4af4-a056-6d7d1aab843cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4433&group=comp.os.cpm#4433

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:620a:8a06:b0:769:89bf:c7b7 with SMTP id qt6-20020a05620a8a0600b0076989bfc7b7mr89078qkn.9.1692005956361;
Mon, 14 Aug 2023 02:39:16 -0700 (PDT)
X-Received: by 2002:a63:778f:0:b0:564:a568:5eaa with SMTP id
s137-20020a63778f000000b00564a5685eaamr1582827pgc.11.1692005956098; Mon, 14
Aug 2023 02:39:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Mon, 14 Aug 2023 02:39:15 -0700 (PDT)
In-Reply-To: <ubc3c6$216r0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:40e0:b528:9790:2fc0;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:40e0:b528:9790:2fc0
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> <ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com> <ubac87$1plcu$1@dont-email.me>
<d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com> <ubc3c6$216r0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <85a94974-4904-4af4-a056-6d7d1aab843cn@googlegroups.com>
Subject: Re: Aztec-C usage?
From: ogde...@gmail.com (Mark Ogden)
Injection-Date: Mon, 14 Aug 2023 09:39:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4076
 by: Mark Ogden - Mon, 14 Aug 2023 09:39 UTC

On Monday, 14 August 2023 at 03:26:17 UTC+1, dxforth wrote:
> On 14/08/2023 12:59 am, Mark Ogden wrote:
> > On Sunday, 13 August 2023 at 11:45:30 UTC+1, dxforth wrote:
> >> On 13/08/2023 5:43 pm, Mark Ogden wrote:
> >>> On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
> >>>> ...
> >>>> FWIW I noticed the Aztec C fgets/fprintf combo produced some unexpected results.
> >>>> Unbeknown to me the source text file used included some 'foreign' characters
> >>>> with bit 7 set. These did not pass through correctly e.g.
> >>>>
> >>>> E2 80 99
> >>>>
> >>>> became
> >>>>
> >>>> 62 19
> >>>>
> >>>> bug?
> >>> It is not a bug.
> >>> Aztec C 1.06D does not have separate open modes for text and binary, but uses special functions e.g. agetc and aputc to handle text files.
> >>> Under the covers fgets calls agetc, which removes the top bit, detects 1A as EOF and also skips null and carriage return, hence the 80h is removed, as it becomes 0 when the top bit is removed.
> >>> Using fread/fwrite should avoid this, also using raw read/write with a buffer a reasonable multiple of the sector size, would avoid too many multiple buffer copies and should be the most performant.
> >>>
> >>> Other compilers e.g. Hitech C, do have open modes e.g. "rt" or "wt" to open a file as text and "rb" or "wb" to open as binary, implementing the differences beneath the covers.
> >> If clearing bit 7 isn't a bug, perhaps a dubious feature :)
> > I suspect is mainly due to history. It was not unknown for serial connected terminals to add a parity bit. As fgets is reading a line, rather than a binary stream, then removing the parity bit is not unreasonable. It would also have made reading Wordstar documents straightforward, removing the top bits it used. It was only later that non ascii characters i.e. (80H-FFH) were more widely supported.
> It'd be interesting to know whether Manx persisted with this in later versions
> of the compiler. Hitech C fgets works fine with 8-bit characters.
The 4.1B version of the z80 cross compiler, still has agetc and does not support the text/binary modifiers for fopen. However the agetc function no longer strips the top bit.
Note, it would be trivial to modify agetc.c to prevent the top bit being stripped in the 1.06D version, especially as the source is provided.
Mark

Re: Aztec-C usage?

<ubhadb$35fa0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4434&group=comp.os.cpm#4434

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: Aztec-C usage?
Date: Wed, 16 Aug 2023 11:57:00 +1000
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <ubhadb$35fa0$1@dont-email.me>
References: <uatc9l$3d10b$1@dont-email.me> <kjf1ifFi86sU1@mid.individual.net>
<uatqp2$3fbdj$1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute>
<fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com>
<ub9ilr$1mn28$1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
<ubac87$1plcu$1@dont-email.me>
<d9d7ffa3-4d9b-49e3-85d9-4042131537f7n@googlegroups.com>
<ubc3c6$216r0$1@dont-email.me>
<85a94974-4904-4af4-a056-6d7d1aab843cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 16 Aug 2023 01:56:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f97586e4f6fffea406d906c75f7e747";
logging-data="3325248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194Cn8Y5u5VaCUUOKVKCM0U"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:pdE5uVc9xQKJ0c624W/o2k0C8Fo=
In-Reply-To: <85a94974-4904-4af4-a056-6d7d1aab843cn@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Wed, 16 Aug 2023 01:57 UTC

On 14/08/2023 7:39 pm, Mark Ogden wrote:
> On Monday, 14 August 2023 at 03:26:17 UTC+1, dxforth wrote:
> ...
>> It'd be interesting to know whether Manx persisted with this in later versions
>> of the compiler. Hitech C fgets works fine with 8-bit character
>
> The 4.1B version of the z80 cross compiler, still has agetc and does not support the text/binary modifiers for fopen. However the agetc function no longer strips the top bit.
> Note, it would be trivial to modify agetc.c to prevent the top bit being stripped in the 1.06D version, especially as the source is provided.
> Mark

I went ahead and made the change - if only to satisfy modern expectations.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor