Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A complex system that works is invariably found to have evolved from a simple system that works.


devel / comp.sys.apple2.programmer / Re: Ctrl-C Interrupt?

SubjectAuthor
* Ctrl-C Interrupt?Bill Chatfield
+* Re: Ctrl-C Interrupt?fadden
|`- Re: Ctrl-C Interrupt?Bill Chatfield
+* Re: Ctrl-C Interrupt?Hugh Hood
|`* Re: Ctrl-C Interrupt?Bill Chatfield
| `* Re: Ctrl-C Interrupt?Oliver Schmidt
|  `* Re: Ctrl-C Interrupt?Bill Chatfield
|   `* Re: Ctrl-C Interrupt?Oliver Schmidt
|    `- Re: Ctrl-C Interrupt?Bill Chatfield
`* Re: Ctrl-C Interrupt?I am Rob
 `- Re: Ctrl-C Interrupt?Bill Chatfield

1
Ctrl-C Interrupt?

<20231210194712.4301d589@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=407&group=comp.sys.apple2.programmer#407

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Ctrl-C Interrupt?
Date: Sun, 10 Dec 2023 19:47:12 -0500
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <20231210194712.4301d589@smilodon-gracilis>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="438b70081458600965c9b9a2c3766dcf";
logging-data="1730384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tnJ7i3uBD7FGgmXZavuDYhdse4So6pto="
Cancel-Lock: sha1:zNs3EoEzq7CJlL8/n3tA54nvKcU=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Mon, 11 Dec 2023 00:47 UTC

Is there any way to have Ctrl-C interrupt a BIN program like it does a
Basic program? I know Ctrl-Reset will do it, but that messes up the
screen and probably other things too.

Re: Ctrl-C Interrupt?

<58223802-5373-43c7-8157-62ba758aadfcn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=408&group=comp.sys.apple2.programmer#408

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a0c:e88f:0:b0:67a:ba83:5a2c with SMTP id b15-20020a0ce88f000000b0067aba835a2cmr25707qvo.6.1702259695013;
Sun, 10 Dec 2023 17:54:55 -0800 (PST)
X-Received: by 2002:a05:6830:2b2a:b0:6d9:e28d:aaec with SMTP id
l42-20020a0568302b2a00b006d9e28daaecmr3448393otv.2.1702259694801; Sun, 10 Dec
2023 17:54:54 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.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.sys.apple2.programmer
Date: Sun, 10 Dec 2023 17:54:54 -0800 (PST)
In-Reply-To: <20231210194712.4301d589@smilodon-gracilis>
Injection-Info: google-groups.googlegroups.com; posting-host=24.130.68.111; posting-account=UAtoeQoAAADrX7T-MHdWWRC4Fzf0dsLP
NNTP-Posting-Host: 24.130.68.111
References: <20231210194712.4301d589@smilodon-gracilis>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <58223802-5373-43c7-8157-62ba758aadfcn@googlegroups.com>
Subject: Re: Ctrl-C Interrupt?
From: fad...@fadden.com (fadden)
Injection-Date: Mon, 11 Dec 2023 01:54:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fadden - Mon, 11 Dec 2023 01:54 UTC

On Sunday, December 10, 2023 at 4:47:14 PM UTC-8, Bill Chatfield wrote:
> Is there any way to have Ctrl-C interrupt a BIN program like it does a
> Basic program? I know Ctrl-Reset will do it, but that messes up the
> screen and probably other things too.

It's not a system feature; it doesn't send a signal the way a UNIX line discipline does. It's being tested for explicitly by the BASIC interpreter, here: https://6502disassembly.com/a2-rom/Applesoft.html#SymISCNTC

Re: Ctrl-C Interrupt?

<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=409&group=comp.sys.apple2.programmer#409

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 11 Dec 2023 03:10:13 +0000
Date: Sun, 10 Dec 2023 21:10:13 -0600
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: hughh...@earthlink.net (Hugh Hood)
Subject: Re: Ctrl-C Interrupt?
Newsgroups: comp.sys.apple2.programmer
References: <20231210194712.4301d589@smilodon-gracilis>
Content-Language: en-US
In-Reply-To: <20231210194712.4301d589@smilodon-gracilis>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
Lines: 32
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 172.59.193.77
X-Trace: sv3-16nxuUQb3YhXVDh3f3zqNAjC/OLWz2WNfOVM/TPPP1X0X/HU0sKDXZsz6I5aPegFl2QBsTj/BnyNjW5!auOmNoU0qslSx63yTycMW32PBDoukFrq9OG0d9B8I4PChli+6whhgtbnI4rxoOyKbVgNCu7QbDcA!SwDe08tzMkchXIKcMEs0G0oEvPtUBU/uog==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Hugh Hood - Mon, 11 Dec 2023 03:10 UTC

On 12/10/2023 6:47 PM, Bill Chatfield wrote:
> Is there any way to have Ctrl-C interrupt a BIN program like it does
> a Basic program? I know Ctrl-Reset will do it, but that messes up
> the screen and probably other things too.
>

Bill,

Are you able to patch the particular BIN program?

If so, I might suggest you inject a JMP somewhere in the program's main
'run' loop to some new code you graft onto the end of the code.

The new code would save the registers, poll the keyboard, check for a
CTRL-C, and just BRK if a CTRL-C is found. If not, just add whatever
code you messed up by inserting the JMP to the new code, restore the
registers, and then JMP back to where the program was interrupted.

Or, if the program already is polling the keyboard for some input, can
you just re-purpose a key you don't normally need to do the same, or
maybe JMP to a routine to add the check for CTRL-C?

Just some thoughts. Maybe none of them are appealing.

I'm assuming you're not using a IIgs where you can interrupt and Visit
the Monitor.

Hugh Hood

Re: Ctrl-C Interrupt?

<14c5a885-e220-4c7e-9828-56812d996600n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=410&group=comp.sys.apple2.programmer#410

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:ac8:580b:0:b0:421:c3a9:1e34 with SMTP id g11-20020ac8580b000000b00421c3a91e34mr27741qtg.10.1702269002326;
Sun, 10 Dec 2023 20:30:02 -0800 (PST)
X-Received: by 2002:a05:6808:1597:b0:3b2:df42:589f with SMTP id
t23-20020a056808159700b003b2df42589fmr3992680oiw.7.1702269002168; Sun, 10 Dec
2023 20:30:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.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.sys.apple2.programmer
Date: Sun, 10 Dec 2023 20:30:01 -0800 (PST)
In-Reply-To: <20231210194712.4301d589@smilodon-gracilis>
Injection-Info: google-groups.googlegroups.com; posting-host=207.195.86.47; posting-account=U4TNXwoAAABP4nIJHynAJZ69O_f3LY2g
NNTP-Posting-Host: 207.195.86.47
References: <20231210194712.4301d589@smilodon-gracilis>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <14c5a885-e220-4c7e-9828-56812d996600n@googlegroups.com>
Subject: Re: Ctrl-C Interrupt?
From: gids...@sasktel.net (I am Rob)
Injection-Date: Mon, 11 Dec 2023 04:30:02 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1795
 by: I am Rob - Mon, 11 Dec 2023 04:30 UTC

> Is there any way to have Ctrl-C interrupt a BIN program like it does a
> Basic program? I know Ctrl-Reset will do it, but that messes up the
> screen and probably other things too.

A simple method would be to just poll $C000, then place JSR's to this routine where you would want the keyboard to be interrupted. Say, after a page of text is displayed or even throughout your code at various places.

Another method is to just put a $00, after the code you want to check out. It has the added benefit of displaying the registers.

BIT $C000
BPL RETURN

LDA $C000
BIT $C010
CMP #$83
BNE RETURN
JMP $FF69 ; for monitor of $3D0 for Applesoft

RETURN RTS

Re: Ctrl-C Interrupt?

<20231211100742.6b7f25a6@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=411&group=comp.sys.apple2.programmer#411

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Mon, 11 Dec 2023 10:07:42 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <20231211100742.6b7f25a6@smilodon-gracilis>
References: <20231210194712.4301d589@smilodon-gracilis>
<58223802-5373-43c7-8157-62ba758aadfcn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="438b70081458600965c9b9a2c3766dcf";
logging-data="1730384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ujWXenQoZQbAKVAWjgNNq84Qm+RLvi9U="
Cancel-Lock: sha1:TS6kvqHUn+mFBPy8sRjiXpd6M6c=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Mon, 11 Dec 2023 15:07 UTC

On Sun, 10 Dec 2023 17:54:54 -0800 (PST)
fadden <fadden@fadden.com> wrote:

> It's not a system feature; it doesn't send a signal the way a UNIX
> line discipline does.

Is it too much to ask for an Apple II to work like UNIX? Haha :-) :-)

I've always been frustrated by the inconsistency that you Ctrl-C a
BASIC program but you have to Ctrl-Reset a binary program. You have to
know what type of program is running to know what interrupt to use. I
guess you can always use Ctrl-Reset, but that is more invasive.

Re: Ctrl-C Interrupt?

<20231211100943.0c7dcc0e@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=412&group=comp.sys.apple2.programmer#412

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Mon, 11 Dec 2023 10:09:43 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <20231211100943.0c7dcc0e@smilodon-gracilis>
References: <20231210194712.4301d589@smilodon-gracilis>
<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="438b70081458600965c9b9a2c3766dcf";
logging-data="1730384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MRcIQPMUyrhuv4zHuBiyrQfDEJc7Oy9Q="
Cancel-Lock: sha1:flWjp+AbiFeJ8FwqH5OU+m5P87k=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Mon, 11 Dec 2023 15:09 UTC

On Sun, 10 Dec 2023 21:10:13 -0600
Hugh Hood <hughhood@earthlink.net> wrote:

> Just some thoughts. Maybe none of them are appealing.
>
> I'm assuming you're not using a IIgs where you can interrupt and
> Visit the Monitor.

I am working on a Apple II/e/c program with the cc65 C compiler. I can
check for Ctrl-C in various places.

Re: Ctrl-C Interrupt?

<20231211101101.46dbb959@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=413&group=comp.sys.apple2.programmer#413

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Mon, 11 Dec 2023 10:11:01 -0500
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <20231211101101.46dbb959@smilodon-gracilis>
References: <20231210194712.4301d589@smilodon-gracilis>
<14c5a885-e220-4c7e-9828-56812d996600n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="438b70081458600965c9b9a2c3766dcf";
logging-data="1730384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DmmShfPczpx7LkeMcC9nCAaAVTwJ828k="
Cancel-Lock: sha1:A55+PGuw05sRn8V4BvI3NqswRmI=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Mon, 11 Dec 2023 15:11 UTC

On Sun, 10 Dec 2023 20:30:01 -0800 (PST)
I am Rob <gids.rs@sasktel.net> wrote:

> A simple method would be to just poll $C000, then place JSR's to this
> routine where you would want the keyboard to be interrupted. Say,
> after a page of text is displayed or even throughout your code at
> various places.

Yes, I can try that. Thanks!

Re: Ctrl-C Interrupt?

<ul7mrh$2l8d7$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=414&group=comp.sys.apple2.programmer#414

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ol....@web.de (Oliver Schmidt)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Mon, 11 Dec 2023 19:10:41 -0000 (UTC)
Message-ID: <ul7mrh$2l8d7$1@solani.org>
References: <20231210194712.4301d589@smilodon-gracilis>
<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
<20231211100943.0c7dcc0e@smilodon-gracilis>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 11 Dec 2023 19:10:41 -0000 (UTC)
Injection-Info: solani.org;
logging-data="2793895"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:/H/r37QQlKhnqk8qy44IKGAfGh4= sha1:luSJkKCnEij4of+ft1o6od1/9Ic=
X-User-ID: eJwFwQkBwEAIAzBN/EzOUah/CUvCUhLlGenB4AB+FfDWA7SVz9p2S+Y7DdTaPjHWgLnDHzRjElQ=
 by: Oliver Schmidt - Mon, 11 Dec 2023 19:10 UTC

Hi Bill,

> I am working on a Apple II/e/c program with the cc65 C compiler. I can
> check for Ctrl-C in various places.

In this case I suggest to use
- kbhit() and cgetc() to detect the Ctrl-C
- exit() to quit if Ctrl-C was detected
- atexit() to run custom cleanup code

Not directly related but there's also doesclrscrafterexit() that allows you
determine if the user will be able to read output from your program after
exit - i.e. an error message. You can call it i.e. from your atexit()
function and call cgetc() if it returns true having the user acknowledge
that he has read the message.

Regards,
Oliver

Re: Ctrl-C Interrupt?

<20231211153907.71933ea0@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=415&group=comp.sys.apple2.programmer#415

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Mon, 11 Dec 2023 15:39:07 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <20231211153907.71933ea0@smilodon-gracilis>
References: <20231210194712.4301d589@smilodon-gracilis>
<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
<20231211100943.0c7dcc0e@smilodon-gracilis>
<ul7mrh$2l8d7$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="438b70081458600965c9b9a2c3766dcf";
logging-data="3483950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7fDOIRvg/ASGsLNH5n9AHUljmNXlFalU="
Cancel-Lock: sha1:/NnK6DQQBbCByCxZztMgVFU9Y5w=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Mon, 11 Dec 2023 20:39 UTC

On Mon, 11 Dec 2023 19:10:41 -0000 (UTC)
Oliver Schmidt <ol.sc@web.de> wrote:

> In this case I suggest to use
> - kbhit() and cgetc() to detect the Ctrl-C
> - exit() to quit if Ctrl-C was detected
> - atexit() to run custom cleanup code

Thanks! I was thinking of using an asm block to check KBD for
characters. What you said is much better. I also forgot about atexit().
I need to put that in now to close files. It's like the "finally" block
of a try/catch/finally around main(). I'm a Java programmer during the
day.

Re: Ctrl-C Interrupt?

<ulag8n$2mkpn$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=419&group=comp.sys.apple2.programmer#419

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ol....@web.de (Oliver Schmidt)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Tue, 12 Dec 2023 20:36:39 -0000 (UTC)
Message-ID: <ulag8n$2mkpn$1@solani.org>
References: <20231210194712.4301d589@smilodon-gracilis>
<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
<20231211100943.0c7dcc0e@smilodon-gracilis>
<ul7mrh$2l8d7$1@solani.org>
<20231211153907.71933ea0@smilodon-gracilis>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 20:36:39 -0000 (UTC)
Injection-Info: solani.org;
logging-data="2839351"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:NWGOfCEfQ2u4GParBQs7eHKgldw= sha1:tt3bIyLFrleWjsB8+kH/JKOoMx4=
X-User-ID: eJwFwYEBgDAIA7CXQEpx5yCj/59gkkHnFJhEKnU678gPzLVFVMC+lZaB5lKmfmbvS/bNqR8nihHO
 by: Oliver Schmidt - Tue, 12 Dec 2023 20:36 UTC

Hi Bill,

> Thanks!

You're welcome :-)

> I was thinking of using an asm block to check KBD for
> characters. What you said is much better.

I'm quite often surprised by the amount of workarounds people "find"
although the functionality is already present in the Apple II C library.

> I also forgot about atexit().
> I need to put that in now to close files. It's like the "finally" block
> of a try/catch/finally around main(). I'm a Java programmer during the
> day.

You don't need to do so for closing files. All still open files are closed
by the C library exit code.

That code is by the way also executed on Ctrl-Reset during the runtime of a
cc65 C program. So the behavior on Ctrl-Reset isn't as undefined/fatal as
you might think.

I even had once the case where I totally ran out of memory so I couldn't
add some quit code. Instead I simply documented Ctrl-Reset as the official
way to quit the program ;-)

Regards,
Oliver

Re: Ctrl-C Interrupt?

<20231212235506.6847234a@smilodon-gracilis>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=421&group=comp.sys.apple2.programmer#421

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bill_cha...@yahoo.com (Bill Chatfield)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Ctrl-C Interrupt?
Date: Tue, 12 Dec 2023 23:55:06 -0500
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20231212235506.6847234a@smilodon-gracilis>
References: <20231210194712.4301d589@smilodon-gracilis>
<8ROdnZS9bYMI4Ov4nZ2dnZfqnPednZ2d@earthlink.com>
<20231211100943.0c7dcc0e@smilodon-gracilis>
<ul7mrh$2l8d7$1@solani.org>
<20231211153907.71933ea0@smilodon-gracilis>
<ulag8n$2mkpn$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="918b89254b297b91947d689fccc31daa";
logging-data="32273"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OXGcS0HMbAWUIm3U8GQxEYWvo1hA3ViU="
Cancel-Lock: sha1:pGDILpOBST/vudKM3hHr7wmivj8=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
 by: Bill Chatfield - Wed, 13 Dec 2023 04:55 UTC

On Tue, 12 Dec 2023 20:36:39 -0000 (UTC)
Oliver Schmidt <ol.sc@web.de> wrote:

> You don't need to do so for closing files. All still open files are
> closed by the C library exit code.

I am always amazed about how well cc65 implements the standard. I was
thinking in terms of BASIC which does not do that and gets completely
screwed up if you don't close files.
> That code is by the way also executed on Ctrl-Reset during the
> runtime of a cc65 C program. So the behavior on Ctrl-Reset isn't as
> undefined/fatal as you might think.

That is very impressive. I never would have guessed that.

> I even had once the case where I totally ran out of memory so I
> couldn't add some quit code. Instead I simply documented Ctrl-Reset
> as the official way to quit the program ;-)

:D

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor