Re: The pain of BASIC GET#

From: A. Fachat <afachat_at_gmx.de>
Date: Tue, 23 Jan 2024 12:43:48 +0100
Message-ID: <f3598de1-bce3-4ec4-892b-970f476e66e3_at_gmx.de>
Am 11.05.23 um 20:41 schrieb Thom Cherryhomes:
> Hey guys,
>
> I'm trying to shore up BASIC support for #FujiNet.
>
> Since everything is handled via KERNAL I/O, we can indeed do things like:
>
> 10 OPEN1,12,2,"http://www.gnu.org/licenses/gpl-3.0.txt"
> 20 get#1,a$
> 30 print A$;
> 40 GOTO20
>
> But we are missing characters as BASIC is processing each byte and
> displaying it.
>
> What is the 1541 doing to slow down enough to be able to send a single
> byte exactly when asked?


Don't think you are missing bytes because BASIC is so slow.

If you implement a server for IEEE488 or IEC, the drive has to be ready
to send a byte at any time. However, the transfer can be interrupted
anytime by the controller (computer) with an ATN.

So, you have to first get the byte, store it, and only acknowledge that
you sent it to the controller when the transfer was successful.

You can see it here
https://github.com/fachat/XD2031/blob/master/firmware/iec.c in
talkloop(), where I call "bus_receivebyte()" first with "BUS_PRELOAD" to
get the byte, and then only acknowledge it later after successfully
sending it to the controller by calling "bus_receivebyte()" without the
PRELOAD flag.

André

(I know this post is old, but still unanswered. The OP may have found
the answer elsewhere already, but I hope to help this list with my
answer anyway :-) )

>
> -Thom
Received on 2024-01-23 13:00:14

Archive generated by hypermail 2.3.0.