Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

To program is to be.


devel / comp.os.cpm / Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

SubjectAuthor
* Avoid warm boot on exit form a C program (Hi-Tech C compiler)Luca Masini
+- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Douglas Miller
`* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Steve Nickolas
 +* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
 |+* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Luca Masini
 ||`* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
 || `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Luca Masini
 ||  `- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
 |`* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Douglas Miller
 | `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
 |  +- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Douglas Miller
 |  `- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)fridtjof.ma...@gmail.com
 `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)dxforth
  +* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
  |`- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)ladislau szilagyi
  `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Douglas Miller
   +- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Luca Masini
   `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)dxforth
    `* Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)Luca Masini
     `- Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)dxforth

1
Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1995:b0:3ff:3725:1f24 with SMTP id u21-20020a05622a199500b003ff37251f24mr15563qtc.4.1690072496037;
Sat, 22 Jul 2023 17:34:56 -0700 (PDT)
X-Received: by 2002:a05:6808:1a1e:b0:3a4:744:e91b with SMTP id
bk30-20020a0568081a1e00b003a40744e91bmr12024210oib.0.1690072495696; Sat, 22
Jul 2023 17:34:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Sat, 22 Jul 2023 17:34:55 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=91.2.240.157; posting-account=W_2h1woAAABMH0g1jQ0ltguuMBxqh8gH
NNTP-Posting-Host: 91.2.240.157
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
Subject: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: luca.a.m...@gmail.com (Luca Masini)
Injection-Date: Sun, 23 Jul 2023 00:34:56 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1563
 by: Luca Masini - Sun, 23 Jul 2023 00:34 UTC

Hi,

I'm playing with HI-TECH-Z80-C from https://github.com/agn453/HI-TECH-Z80-C

One small program that I did is the following cls.c

#include <cpm.h>
void main()
{ char * s = "\033[2J\033[H$"; /* Clear the screen and go home */
bdos(9, s); /* BDOS function 9 (C_WRITESTR) - Output string */
}

This clear the screen but on exit a CP/M warm boot is done.

Is there a way to exit from C without triggering a CP/M warm boot?

MfG
Luca

PS: it was compiled with the following command line
zxc -n cls.c

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<2d1a4ee4-e6ab-43a4-a945-ed2b9582edbdn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1791:b0:400:9f40:e4f4 with SMTP id s17-20020a05622a179100b004009f40e4f4mr30779qtk.6.1690080162954;
Sat, 22 Jul 2023 19:42:42 -0700 (PDT)
X-Received: by 2002:a05:6808:2029:b0:3a3:a8d1:1aa1 with SMTP id
q41-20020a056808202900b003a3a8d11aa1mr10762807oiw.2.1690080162587; Sat, 22
Jul 2023 19:42:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Sat, 22 Jul 2023 19:42:42 -0700 (PDT)
In-Reply-To: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2d1a4ee4-e6ab-43a4-a945-ed2b9582edbdn@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: durgadas...@gmail.com (Douglas Miller)
Injection-Date: Sun, 23 Jul 2023 02:42:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1518
 by: Douglas Miller - Sun, 23 Jul 2023 02:42 UTC

I'm not sure specifically about Hi-Tech C, but generally C compilers use a runtime environment on CP/M that places the stack at top of memory, directly below the BDOS (possibly under some other runtime structures like stdio). So, there is no way to avoid a warm boot, since the CCP has been overwritten.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usots...@buric.co (Steve Nickolas)
Newsgroups: comp.os.cpm
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
Date: Sun, 23 Jul 2023 00:01:27 -0400
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: dont-email.me; posting-host="7c46e260c639b8d68fb20643d58802e6";
logging-data="176456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bN5Y5FEBm49GHsmGmvKFR1WaHUL3pcts="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:gCsltc+jspBIuo0d4BXf2blh6C0=
X-X-Sender: mary@sd-119843.dedibox.fr
In-Reply-To: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
 by: Steve Nickolas - Sun, 23 Jul 2023 04:01 UTC

On Sat, 22 Jul 2023, Luca Masini wrote:

> Is there a way to exit from C without triggering a CP/M warm boot?

That's literally what exiting any program does in CP/M.

I mean, you could try jumping back into the CCP, but that's going deep
into the bowels of CP/M and I think won't work at all with 3...

-uso.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1a0d:b0:404:132c:e7da with SMTP id f13-20020a05622a1a0d00b00404132ce7damr28464qtb.5.1690090187282; Sat, 22 Jul 2023 22:29:47 -0700 (PDT)
X-Received: by 2002:a05:6808:2103:b0:3a3:89a2:50a5 with SMTP id r3-20020a056808210300b003a389a250a5mr11736354oiw.10.1690090186886; Sat, 22 Jul 2023 22:29:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.18.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: Sat, 22 Jul 2023 22:29:46 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
Injection-Info: google-groups.googlegroups.com; posting-host=86.125.83.230; posting-account=Zav8fAoAAACRqOOZYggbw7GhvvIJEzFn
NNTP-Posting-Host: 86.125.83.230
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com> <alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Sun, 23 Jul 2023 05:29:47 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: ladislau szilagyi - Sun, 23 Jul 2023 05:29 UTC

Hi,

see https://github.com/Laci1953/RC2014-CPM/tree/main/ReturnToCCP

, for an example of how to build, using the HiTech C compiler, a .COM file that returns directly to CCP, without a CP/M warm boot.

Ladislau

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<27db8857-02bb-41b4-bb1b-3c93a13b3359n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1a82:b0:403:394c:bf29 with SMTP id s2-20020a05622a1a8200b00403394cbf29mr22791qtc.2.1690111566225;
Sun, 23 Jul 2023 04:26:06 -0700 (PDT)
X-Received: by 2002:a05:6808:13d3:b0:3a3:e17e:d2ea with SMTP id
d19-20020a05680813d300b003a3e17ed2eamr13647515oiw.8.1690111565804; Sun, 23
Jul 2023 04:26:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!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, 23 Jul 2023 04:26:05 -0700 (PDT)
In-Reply-To: <8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=91.2.240.157; posting-account=W_2h1woAAABMH0g1jQ0ltguuMBxqh8gH
NNTP-Posting-Host: 91.2.240.157
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr> <8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <27db8857-02bb-41b4-bb1b-3c93a13b3359n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: luca.a.m...@gmail.com (Luca Masini)
Injection-Date: Sun, 23 Jul 2023 11:26:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2091
 by: Luca Masini - Sun, 23 Jul 2023 11:26 UTC

On Sunday, July 23, 2023 at 7:29:48 AM UTC+2, ladislau szilagyi wrote:

> see https://github.com/Laci1953/RC2014-CPM/tree/main/ReturnToCCP
> , for an example of how to build, using the HiTech C compiler, a .COM file that returns directly to CCP, without a CP/M warm boot.

thank you ladislau szilagyi.
I think this will work also in my environment (a Z80-MBC2 board) after I solve a small problem.
Currently when I submit the make.sub taken from your github repository it end with the following message about unknown psect text

(xsub active)
G>LINK
link> -PTEXT=100H,DATA,BSS -C100H -OMYDUMPX.COM MYCRTCPM.OBJ DUMPX.OBJ LIBC.LIB
unknown psect: TEXT

MfG

Luca

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<917f005c-520d-4dab-ae7d-1768fbcebe70n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:2c45:0:b0:765:aafa:5be7 with SMTP id s66-20020a372c45000000b00765aafa5be7mr16492qkh.14.1690113464070;
Sun, 23 Jul 2023 04:57:44 -0700 (PDT)
X-Received: by 2002:a05:6808:3208:b0:3a2:6d07:ad48 with SMTP id
cb8-20020a056808320800b003a26d07ad48mr10599737oib.4.1690113463815; Sun, 23
Jul 2023 04:57:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 23 Jul 2023 04:57:43 -0700 (PDT)
In-Reply-To: <27db8857-02bb-41b4-bb1b-3c93a13b3359n@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: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <27db8857-02bb-41b4-bb1b-3c93a13b3359n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <917f005c-520d-4dab-ae7d-1768fbcebe70n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Sun, 23 Jul 2023 11:57:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2223
 by: ladislau szilagyi - Sun, 23 Jul 2023 11:57 UTC

Hi Luca,

the problem is the name of the segments; they MUST be named 'text' ,'data', 'bss' (NOT uppercase TEXT,DATA,BSS)

In my make.sub, you will find :

link
-ptext=100h,data,bss -c100h -omydumpx.com mycrtcpm.obj dumpx.obj libc.lib

Now, to be honest, I do not see a big advantage of using this approach of "avoiding" CP/M warm boot...

Why do you think HiTech did not used this method as a default?

Because, it's about a balance between gaining speed vs. loosing memory.

Using my method, you gain speed (CP/M is not read back in memory, after a .COM exits), but you loose 2KB of TPA space.

This might be important in some cases...

By the way, see the "original" HiTech's crtcpm.as here: https://github.com/Laci1953/RC2014-CPM/blob/main/ReturnToCCP/crtcpm.original.as

, in order to see how simple is the modification I used...

regards,
Ladislau

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:4f07:0:b0:63c:fcbe:b114 with SMTP id fb7-20020ad44f07000000b0063cfcbeb114mr3171qvb.0.1690117515068;
Sun, 23 Jul 2023 06:05:15 -0700 (PDT)
X-Received: by 2002:aca:901:0:b0:3a4:1484:b3db with SMTP id
1-20020aca0901000000b003a41484b3dbmr10166983oij.5.1690117514670; Sun, 23 Jul
2023 06:05:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.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, 23 Jul 2023 06:05:14 -0700 (PDT)
In-Reply-To: <8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr> <8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: durgadas...@gmail.com (Douglas Miller)
Injection-Date: Sun, 23 Jul 2023 13:05:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 16
 by: Douglas Miller - Sun, 23 Jul 2023 13:05 UTC

On Sunday, July 23, 2023 at 12:29:48 AM UTC-5, ladislau szilagyi wrote:
> Hi,
>
> see https://github.com/Laci1953/RC2014-CPM/tree/main/ReturnToCCP
>
> , for an example of how to build, using the HiTech C compiler, a .COM file that returns directly to CCP, without a CP/M warm boot.
>
> Ladislau

Ah, you are replacing the standard HiTech C RunTime, so to change how the stack is created. This assumes the CCP is 2K and lowers the stack area used by C so that it avoids overwriting the CCP, in addition to saving the CCP SP so that you can do a clean RET on exit. So the only complication would be if it was run on a system with a larger CCP, in which case CCP_SIZE needs to be adjusted.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<u9kuja$i1a2$1@dont-email.me>

  copy mid

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

  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: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
Date: Mon, 24 Jul 2023 14:27:22 +1000
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <u9kuja$i1a2$1@dont-email.me>
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 24 Jul 2023 04:27:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2242ee8b3b773cc3e5527402db5a5ead";
logging-data="591170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jG5HMCrc/VqADdrWi+S6N"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:92LWH215/wVnNtUqUUBU8TVKH2c=
Content-Language: en-GB
In-Reply-To: <alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
 by: dxforth - Mon, 24 Jul 2023 04:27 UTC

On 23/07/2023 2:01 pm, Steve Nickolas wrote:
> On Sat, 22 Jul 2023, Luca Masini wrote:
>
>> Is there a way to exit from C without triggering a CP/M warm boot?
>
> That's literally what exiting any program does in CP/M.
>
> I mean, you could try jumping back into the CCP, but that's going deep into the bowels of CP/M and I think won't work at all with 3...

Speaking of which, can anyone remind me what would happen were this
'no warm boot' scheme run under CP/M-3 ? IIRC CCP3 is a transient
which loads at 100h and whose source is banked memory. Then there
are the CP/M-3 RSX. Is top of TPA still determined from the page
number located at address 0007h ?

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<2ea63ddc-c4cf-422d-ba5e-d7332f4cfb65n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:4bb3:0:b0:635:e010:970e with SMTP id i19-20020ad44bb3000000b00635e010970emr28218qvw.13.1690187321110;
Mon, 24 Jul 2023 01:28:41 -0700 (PDT)
X-Received: by 2002:a05:6808:1a0e:b0:3a3:8466:ee55 with SMTP id
bk14-20020a0568081a0e00b003a38466ee55mr17330825oib.8.1690187320815; Mon, 24
Jul 2023 01:28:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 24 Jul 2023 01:28:40 -0700 (PDT)
In-Reply-To: <u9kuja$i1a2$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=86.125.83.230; posting-account=Zav8fAoAAACRqOOZYggbw7GhvvIJEzFn
NNTP-Posting-Host: 86.125.83.230
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr> <u9kuja$i1a2$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2ea63ddc-c4cf-422d-ba5e-d7332f4cfb65n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Mon, 24 Jul 2023 08:28:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3717
 by: ladislau szilagyi - Mon, 24 Jul 2023 08:28 UTC

Hi Luca,

after some careful investigations, it turns out that, after all, _exit was called correctly, but after doing its job, it jumped to 0 in its original HiTech library implementation, that's why CP/M re-booted...

I published a new, corrected version.

What was the problem: it could happen that in a C program, the author forgets to close a file that was opened for write.

Because of this, at the end of crtcpm, _exit was used.

Therefore, I modified mycrtcpm.as, now the final part looks like this:

call _main ; HL = value returned by main
ld (80H),hl ; store-it at 80H, as required by the exit(int) definition
; close all 8 CP/M files, just in case the program forgot-it

ld b,8 ; CP/M files counter
ld hl,__iob ; FILE*
cloop:
push bc ; counter on stack
push hl ; FILE* on stack
call _fclose ; fclose(FILE*)
pop hl
ld bc,8 ; sizeof(FILE)
add hl,bc ; go to next FILE
pop bc ; get counter
djnz cloop ; loop until counter=0

ld sp,(ccp_sp) ; restore CCP's SP
ret ; return to CCP

As a test, I included test.c :

#include <stdio.h>

void main(void)
{ FILE* f;

f = fopen("TEST.TXT", "w+");
fputs("test", f);

/* the file is NOT closed before exiting */
}

....and the maketest.sub :

xsub
zas mycrtcpm.as
c -v -c -o test.c
link
-ptext=100h,data,bss -c100h -omytest.com mycrtcpm.obj test.obj libc.lib

Try this to verify that test.com and mytest.com have the same outcome :

>c -v -o test.c
>test
>type test.txt
test
>era test.txt
>submit maketest
>mytest
>type test.txt
test
>

PS.
I noticed that your Z80-MBC2 has 128 KB RAM (banked). If you intend to work with large C programs on Z80-MBC2,
you will notice that the original HiTech's C compiler will issue "out-of-memory" error messages...
I had the same problem, and solved it by customizing all the C compiler toolchain components (P1, CGEN, OPTIM, ZAS).
The idea is to use the extra 64 KB RAM bank when allocating memory...
The trick works on all sort of Z80 machines (with RAM of 2 x 64KB, 4 x 32KB, 32 x 16KB), and allows compiling safely quite large C source files...
See the whole story here: https://github.com/Laci1953/HiTech-C-compiler-enhanced,
plus here: https://github.com/Laci1953/Z80AS
Of course, at the time I published these tools, I had no specs on your Z80-MBC2, but all is needed is to change some ports... just let me know if you will ever need-it.

regards,
Ladislau

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<cb97064c-aaa0-4626-92c9-aa1fd6ce878en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:5581:0:b0:63c:f3d7:f081 with SMTP id f1-20020ad45581000000b0063cf3d7f081mr17034qvx.13.1690187834335;
Mon, 24 Jul 2023 01:37:14 -0700 (PDT)
X-Received: by 2002:a05:6870:3a1a:b0:1bb:4da2:9edc with SMTP id
du26-20020a0568703a1a00b001bb4da29edcmr5210402oab.1.1690187834151; Mon, 24
Jul 2023 01:37:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 24 Jul 2023 01:37:13 -0700 (PDT)
In-Reply-To: <2ea63ddc-c4cf-422d-ba5e-d7332f4cfb65n@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: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<u9kuja$i1a2$1@dont-email.me> <2ea63ddc-c4cf-422d-ba5e-d7332f4cfb65n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cb97064c-aaa0-4626-92c9-aa1fd6ce878en@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Mon, 24 Jul 2023 08:37:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1709
 by: ladislau szilagyi - Mon, 24 Jul 2023 08:37 UTC

@fridtjof: yes, your code is appropriate for "embedded" C programs, but for the common C programs, it is important to :

- initialize with 0 the BSS segment
- handle the command line parameters
- close the files which were opened for write (and the programmer forgot to close-it...)

All these jobs are handled in crtcpm.obj, that's why, in most cases, it must be used...

Ladislau

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:190d:b0:63c:f33b:8243 with SMTP id er13-20020a056214190d00b0063cf33b8243mr22347qvb.12.1690199846455;
Mon, 24 Jul 2023 04:57:26 -0700 (PDT)
X-Received: by 2002:a9d:6752:0:b0:6b9:982d:2397 with SMTP id
w18-20020a9d6752000000b006b9982d2397mr8308700otm.5.1690199846145; Mon, 24 Jul
2023 04:57:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 24 Jul 2023 04:57:25 -0700 (PDT)
In-Reply-To: <u9kuja$i1a2$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr> <u9kuja$i1a2$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: durgadas...@gmail.com (Douglas Miller)
Injection-Date: Mon, 24 Jul 2023 11:57:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2624
 by: Douglas Miller - Mon, 24 Jul 2023 11:57 UTC

On Sunday, July 23, 2023 at 11:27:25 PM UTC-5, dxforth wrote:
> Speaking of which, can anyone remind me what would happen were this
> 'no warm boot' scheme run under CP/M-3 ? IIRC CCP3 is a transient
> which loads at 100h and whose source is banked memory. Then there
> are the CP/M-3 RSX. Is top of TPA still determined from the page
> number located at address 0007h ?

On CP/M 3, this CRT would waste some space but should still work. Most/many CP/M 3 implementations would cache the CCP in an alternate bank of RAM and so warm boot would be very fast and this enhancement is not needed. The CRT could be modified to check for CP/M 3 and change its behavior, since none of it is necessary. Similarly, it could check for CP/NET and use a different CCP size (although there is more probability that the CCP might be an expected size, since it was so easy to build your own).

Note that the standard CCP.SPR from DRI was actually only 2 pages larger than the CP/M 2.2 CCP (0A00H vs. 0800H), but since it is an SPR file it contains extra pages that are not actually part of the running image (header and relocation data) and it "looks" bigger. So in the case of CCP.SPR you need to examine the header in order to determine what the size is when running in memory - the file size will be misleading.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<c08472d5-9713-4a16-bf93-e00e3565a439n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:4ba9:0:b0:63c:f0dc:e896 with SMTP id i9-20020ad44ba9000000b0063cf0dce896mr1801qvw.1.1690233732092;
Mon, 24 Jul 2023 14:22:12 -0700 (PDT)
X-Received: by 2002:a9d:4f1a:0:b0:6bb:102d:1ff6 with SMTP id
d26-20020a9d4f1a000000b006bb102d1ff6mr9910313otl.1.1690233731651; Mon, 24 Jul
2023 14:22:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 24 Jul 2023 14:22:11 -0700 (PDT)
In-Reply-To: <2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=91.2.240.157; posting-account=W_2h1woAAABMH0g1jQ0ltguuMBxqh8gH
NNTP-Posting-Host: 91.2.240.157
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<u9kuja$i1a2$1@dont-email.me> <2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c08472d5-9713-4a16-bf93-e00e3565a439n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: luca.a.m...@gmail.com (Luca Masini)
Injection-Date: Mon, 24 Jul 2023 21:22:12 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2342
 by: Luca Masini - Mon, 24 Jul 2023 21:22 UTC

Hi ladislau szilagyi,

> after some careful investigations, it turns out that, after all, _exit was called correctly,
> but after doing its job, it jumped to 0 in its original HiTech library implementation, that's why CP/M re-booted...
> I published a new, corrected version.
> What was the problem: it could happen that in a C program, the author forgets to close a file that was opened for write.
> Because of this, at the end of crtcpm, _exit was used.

Thank you.
I implemented your suggestion also in my C-runtime library mincrt.as
that is based on https://github.com/agn453/HI-TECH-Z80-C/blob/master/cpm/ZNRTCPM.AS

Just for info: the size of the produced CLS.COM program grow up from 17 records to 31 records
As expected because now the line
call _fclose ; fclose(FILE*)
cause the linking of the fclose function.

> See the whole story here: https://github.com/Laci1953/HiTech-C-compiler-enhanced,
> plus here: https://github.com/Laci1953/Z80AS

Sound interesting. I will take a look in the next days.

MfG

Luca.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<u9ndj3$vmjr$1@dont-email.me>

  copy mid

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

  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: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
Date: Tue, 25 Jul 2023 12:55:30 +1000
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <u9ndj3$vmjr$1@dont-email.me>
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<u9kuja$i1a2$1@dont-email.me>
<2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 25 Jul 2023 02:55:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e9ad789f049706598dd018d9010dff54";
logging-data="1038971"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BYeggcIA/QRhEgD3uqdUu"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:kpeexUq4H7kaadbgAgG+xPU2tXM=
In-Reply-To: <2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Tue, 25 Jul 2023 02:55 UTC

On 24/07/2023 9:57 pm, Douglas Miller wrote:
> On Sunday, July 23, 2023 at 11:27:25 PM UTC-5, dxforth wrote:
>> Speaking of which, can anyone remind me what would happen were this
>> 'no warm boot' scheme run under CP/M-3 ? IIRC CCP3 is a transient
>> which loads at 100h and whose source is banked memory. Then there
>> are the CP/M-3 RSX. Is top of TPA still determined from the page
>> number located at address 0007h ?
>
> On CP/M 3, this CRT would waste some space but should still work. Most/many CP/M 3 implementations would cache the CCP in an alternate bank of RAM and so warm boot would be very fast and this enhancement is not needed. The CRT could be modified to check for CP/M 3 and change its behavior, since none of it is necessary. Similarly, it could check for CP/NET and use a different CCP size (although there is more probability that the CCP might be an expected size, since it was so easy to build your own).
>
> Note that the standard CCP.SPR from DRI was actually only 2 pages larger than the CP/M 2.2 CCP (0A00H vs. 0800H), but since it is an SPR file it contains extra pages that are not actually part of the running image (header and relocation data) and it "looks" bigger. So in the case of CCP.SPR you need to examine the header in order to determine what the size is when running in memory - the file size will be misleading.

Thanks. The option to bypass warm boots exists in programs compiled
with DX-Forth for CP/M. OTOH it's not particularly useful as it
assumes a 2K CCP. This thread got me thinking I should at least make
the number of pages reserved user-selectable.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<be224a40-5111-42c8-bcb3-55fc8a1b4378n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:46:b0:405:3a8b:b7e0 with SMTP id y6-20020a05622a004600b004053a8bb7e0mr9040qtw.13.1690298569876; Tue, 25 Jul 2023 08:22:49 -0700 (PDT)
X-Received: by 2002:a9d:6f8a:0:b0:6b9:dc90:e351 with SMTP id h10-20020a9d6f8a000000b006b9dc90e351mr13615142otq.6.1690298569434; Tue, 25 Jul 2023 08:22:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.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: Tue, 25 Jul 2023 08:22:48 -0700 (PDT)
In-Reply-To: <u9ndj3$vmjr$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=91.2.240.157; posting-account=W_2h1woAAABMH0g1jQ0ltguuMBxqh8gH
NNTP-Posting-Host: 91.2.240.157
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com> <alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr> <u9kuja$i1a2$1@dont-email.me> <2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com> <u9ndj3$vmjr$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <be224a40-5111-42c8-bcb3-55fc8a1b4378n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: luca.a.m...@gmail.com (Luca Masini)
Injection-Date: Tue, 25 Jul 2023 15:22:49 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 22
 by: Luca Masini - Tue, 25 Jul 2023 15:22 UTC

Hi dxforth,

> The option to bypass warm boots exists in programs compiled with DX-Forth for CP/M.
> OTOH it's not particularly useful as it assumes a 2K CCP.
> This thread got me thinking I should at least make the number of pages reserved user-selectable.

I knew that DX-Forth did not call Warm-Boot on termination.
The implementation of CLS.COM that I did in DX-Forth was the following

: main page ;
\ Create cls.com and exit
turnkey main cls
bye

To generate a turnkey CLS.COM I used the following CP/M command line:
forth - include cls.f

What I didn't know was this behavior is optional.
How can we generate a turnkey executable with DX-Forth that calls Warm-Boot on exit?

MfG
Luca.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<u9q01t$18j7p$1@dont-email.me>

  copy mid

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

  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: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
Date: Wed, 26 Jul 2023 12:22:54 +1000
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <u9q01t$18j7p$1@dont-email.me>
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<u9kuja$i1a2$1@dont-email.me>
<2ca67af8-58cf-4b9d-a9ab-9157300104ddn@googlegroups.com>
<u9ndj3$vmjr$1@dont-email.me>
<be224a40-5111-42c8-bcb3-55fc8a1b4378n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 26 Jul 2023 02:22:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d142533b4bc34cf46726a11937536445";
logging-data="1330425"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RNkG2jloOkRSFYr31NJI7"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:adolPwkgJ0q6MjowQ3KvAnONbjU=
Content-Language: en-GB
In-Reply-To: <be224a40-5111-42c8-bcb3-55fc8a1b4378n@googlegroups.com>
 by: dxforth - Wed, 26 Jul 2023 02:22 UTC

On 26/07/2023 1:22 am, Luca Masini wrote:
> Hi dxforth,
>
>> The option to bypass warm boots exists in programs compiled with DX-Forth for CP/M.
>> OTOH it's not particularly useful as it assumes a 2K CCP.
>> This thread got me thinking I should at least make the number of pages reserved user-selectable.
>
> I knew that DX-Forth did not call Warm-Boot on termination.
> The implementation of CLS.COM that I did in DX-Forth was the following
>
> : main page ;
> \ Create cls.com and exit
> turnkey main cls
> bye
>
> To generate a turnkey CLS.COM I used the following CP/M command line:
> forth - include cls.f
>
> What I didn't know was this behavior is optional.
> How can we generate a turnkey executable with DX-Forth that calls Warm-Boot on exit?

So there's at least one other user :)

Thanks for the question. To clarify, DX-Forth as supplied performs a warm
boot (JMP 0) on exit. DX-Forth executables may be patched to return to CCP
instead by using the INSTALL program and selecting the 'No Warm Boot' option.
Note that this assumes a 2KB CCP. In the next release of DX-Forth, users
will be able to specify the CCP size. I recommend leaving warm boot enabled
for the compiler (DX.COM) for maximum TPA and only patching turnkeys.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:419f:b0:63c:f3e3:8220 with SMTP id ld31-20020a056214419f00b0063cf3e38220mr22978qvb.0.1690118381703;
Sun, 23 Jul 2023 06:19:41 -0700 (PDT)
X-Received: by 2002:a05:6808:2012:b0:3a1:c163:6022 with SMTP id
q18-20020a056808201200b003a1c1636022mr13840195oiw.4.1690118381358; Sun, 23
Jul 2023 06:19:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 23 Jul 2023 06:19:40 -0700 (PDT)
In-Reply-To: <5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@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: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Sun, 23 Jul 2023 13:19:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1650
 by: ladislau szilagyi - Sun, 23 Jul 2023 13:19 UTC

Hi Douglas,

yes, you are right, I could not find a simple way to calculate the CCP base address (or the CCP size) , so I assumed that we are working with the "original" CCP, which is 806H bytes long...

For other, "custom" CCP's, the mycrtcpm.as source code must be changed accordingly.

Ladislau

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<492f2a5c-d1d6-4826-8c78-23edea0d7faan@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:620a:4905:b0:767:14d4:bda0 with SMTP id ed5-20020a05620a490500b0076714d4bda0mr30692qkb.2.1690123860711;
Sun, 23 Jul 2023 07:51:00 -0700 (PDT)
X-Received: by 2002:a05:6808:20a7:b0:3a1:f295:3e with SMTP id
s39-20020a05680820a700b003a1f295003emr14306887oiw.1.1690123860476; Sun, 23
Jul 2023 07:51:00 -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, 23 Jul 2023 07:50:59 -0700 (PDT)
In-Reply-To: <aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@googlegroups.com>
<aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <492f2a5c-d1d6-4826-8c78-23edea0d7faan@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: durgadas...@gmail.com (Douglas Miller)
Injection-Date: Sun, 23 Jul 2023 14:51:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Douglas Miller - Sun, 23 Jul 2023 14:50 UTC

On Sunday, July 23, 2023 at 8:19:42 AM UTC-5, ladislau szilagyi wrote:
> Hi Douglas,
>
> yes, you are right, I could not find a simple way to calculate the CCP base address (or the CCP size) , so I assumed that we are working with the "original" CCP, which is 806H bytes long...
>
> For other, "custom" CCP's, the mycrtcpm.as source code must be changed accordingly.
>
> Ladislau

Nothing wrong with your approach, I just wanted to make sure anyone looking at this understood the implication. I have seen other threads lately where some have written their own CCP or run across an old one that was larger than 2K.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<5eb8fdc0-9e4f-4092-b155-aa58d2aadba5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1a0d:b0:404:132c:e7da with SMTP id f13-20020a05622a1a0d00b00404132ce7damr33882qtb.5.1690125256371;
Sun, 23 Jul 2023 08:14:16 -0700 (PDT)
X-Received: by 2002:a05:6870:d896:b0:1bb:4593:edfb with SMTP id
dv22-20020a056870d89600b001bb4593edfbmr3393998oab.1.1690125256072; Sun, 23
Jul 2023 08:14:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!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: Sun, 23 Jul 2023 08:14:15 -0700 (PDT)
In-Reply-To: <917f005c-520d-4dab-ae7d-1768fbcebe70n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=91.2.240.157; posting-account=W_2h1woAAABMH0g1jQ0ltguuMBxqh8gH
NNTP-Posting-Host: 91.2.240.157
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <27db8857-02bb-41b4-bb1b-3c93a13b3359n@googlegroups.com>
<917f005c-520d-4dab-ae7d-1768fbcebe70n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5eb8fdc0-9e4f-4092-b155-aa58d2aadba5n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: luca.a.m...@gmail.com (Luca Masini)
Injection-Date: Sun, 23 Jul 2023 15:14:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1871
 by: Luca Masini - Sun, 23 Jul 2023 15:14 UTC

On Sunday, July 23, 2023 at 1:57:45 PM UTC+2, ladislau szilagyi wrote:

> By the way, see the "original" HiTech's crtcpm.as here: https://github.com/Laci1953/RC2014-CPM/blob/main/ReturnToCCP/crtcpm.original.as
> , in order to see how simple is the modification I used...

The following lines need to be commented in mycrtcpm.as
; push hl
; call _exit
otherwise the call to _exit do a warm boot

MfG
Luca.

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<2d0836b7-852a-4ebd-ab7b-3de6b6f6f39cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:8685:0:b0:76a:ece9:d898 with SMTP id i127-20020a378685000000b0076aece9d898mr13886qkd.8.1690126728986;
Sun, 23 Jul 2023 08:38:48 -0700 (PDT)
X-Received: by 2002:a05:6808:ecc:b0:3a2:2146:1e0 with SMTP id
q12-20020a0568080ecc00b003a2214601e0mr13845183oiv.0.1690126728543; Sun, 23
Jul 2023 08:38:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!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: Sun, 23 Jul 2023 08:38:48 -0700 (PDT)
In-Reply-To: <aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:9299:3700:a83e:37de:ecab:1cc0;
posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:9299:3700:a83e:37de:ecab:1cc0
References: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <5384bdfc-f12a-4fbe-bb9b-b81b7bd86f43n@googlegroups.com>
<aa4a37bd-b25a-4b17-ae63-9328e3bdd5a1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2d0836b7-852a-4ebd-ab7b-3de6b6f6f39cn@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: fridtjof...@gmail.com (fridtjof.ma...@gmail.com)
Injection-Date: Sun, 23 Jul 2023 15:38:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2382
 by: fridtjof.ma...@gmail - Sun, 23 Jul 2023 15:38 UTC

On Sunday, July 23, 2023 at 9:19:42 AM UTC-4, ladislau szilagyi wrote:
> Hi Douglas,
>
> yes, you are right, I could not find a simple way to calculate the CCP base address (or the CCP size) , so I assumed that we are working with the "original" CCP, which is 806H bytes long...
>
> For other, "custom" CCP's, the mycrtcpm.as source code must be changed accordingly.
>
> Ladislau
Just to let you know -- CCP for CP/NET 1.2 is about 4 pages longer than CP/M 2.2
See my R program for how I handle this with the R.COM loader (just a single MAC source file).

https://github.com/ratboy666/r

Also, have a look at

https://github.com/ratboy666/tiny/blob/main/tiny.c

This demonstrates that you don't even need crtcpm.as AT ALL! Just the run-time intrinisic functions. For a 128 byte program written in HiTech C!

Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)

<d53102c4-ff8d-4ad5-9714-5062f6e22c80n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:b0a:b0:63c:f17e:ccd0 with SMTP id u10-20020a0562140b0a00b0063cf17eccd0mr14762qvj.8.1690126974788;
Sun, 23 Jul 2023 08:42:54 -0700 (PDT)
X-Received: by 2002:a05:6808:f14:b0:3a4:24bc:125f with SMTP id
m20-20020a0568080f1400b003a424bc125fmr14467792oiw.1.1690126974460; Sun, 23
Jul 2023 08:42:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!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: Sun, 23 Jul 2023 08:42:53 -0700 (PDT)
In-Reply-To: <5eb8fdc0-9e4f-4092-b155-aa58d2aadba5n@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: <8477b45e-47e2-4583-9214-5e56eae6ce02n@googlegroups.com>
<alpine.DEB.2.21.2307222359450.12758@sd-119843.dedibox.fr>
<8657570b-4b77-4d23-aafd-b6b3d2454a8cn@googlegroups.com> <27db8857-02bb-41b4-bb1b-3c93a13b3359n@googlegroups.com>
<917f005c-520d-4dab-ae7d-1768fbcebe70n@googlegroups.com> <5eb8fdc0-9e4f-4092-b155-aa58d2aadba5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d53102c4-ff8d-4ad5-9714-5062f6e22c80n@googlegroups.com>
Subject: Re: Avoid warm boot on exit form a C program (Hi-Tech C compiler)
From: ladislau...@euroqst.ro (ladislau szilagyi)
Injection-Date: Sun, 23 Jul 2023 15:42:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1545
 by: ladislau szilagyi - Sun, 23 Jul 2023 15:42 UTC

Thanks Luca, you're absolutely right!

I updated the file on GitHub...

Ladislau

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor