6809 Flex.....

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
jgharston
Posts: 3596
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: 6809 Flex.....

Post by jgharston » Fri Jul 05, 2019 10:33 am

That would require psychic abilities to know what the host is, and would probably need more code space in the client than is available for the 6502 code and the chuck-across-the-Tube code. It would need to be done on the client side. Remembering the C stdio library I think it can be done with:

INIT:
flag=0, ret
KBDTST:
if (flag) return TRUE
result=INKEY(0)
if result=-1, return FALSE
lastchar=result
flat=true
return TRUE
GETKEY:
if (flag) flag=FALSE, return lastchar
return OSRDCH

That allows the 6809 BIOS entry block called by Flex to implement KBDTST and GETKEY *for* *the* *6809* *API*. Trying to mess with the Tube API would mean making the client Tube code have psycic abilities having to hook into anything that might end up fetching something from the OSRDCH input stream and anything that may be a KBDTEST call, OSRDCH, OSBYTE, OSWORD, OSBGET, knowing *which* OSBYTE and OSWORD calls might end up fetching something from the input stream. The Tube API should be a clean API that purely and simply passes calls across to the host, anything else specific for the code running on the client should be built on top of that API.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
jgharston
Posts: 3596
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: 6809 Flex.....

Post by jgharston » Sat Jul 13, 2019 7:10 pm

I've done a test build of the 6809 Tube Client with updatd KBDTST and KBDIN code.

Tightening up the specification of KBDTST to mean 'will the next call to KBDIN return immediately, with no waiting?', KBDTST actively samples the input stream and if a character is available, saves it for a subsequent KBDIN call. KBDIN now loops calling KBDTST, either fetching that saved character or waiting until the input stream does supply a character.

You can replace the 6809 client on a live CoPro until the next Break with the reload command.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Post Reply