6809 and FLEX

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Sat Oct 24, 2015 4:51 pm

Roland,

Thanks for posting those.

That's an impressive amount of work there. Kudos for getting it working to the extent that FLEX will boot and adventure will run.

What sort of speed are you getting out of the Random Access File based disk reading? (e.g. how long does ADV9 adventure take to start?)

Dave

User avatar
roland
Posts: 2808
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: 6809 and FLEX

Postby roland » Sat Oct 24, 2015 6:12 pm

Loading the ADV9 games takes 38 seconds with my Atom running at 2 MHz. Strangely, the RAF seems not to work at 4MHz. Normal loading of data works fine.

Using RAF files is probably not the fastest way of accessing disc images. But we knew this already :?
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Wed Jan 18, 2017 2:58 pm

Hi Guys,

Prompted by this post from Jonathan, I've just been playing with Flex again.
http://www.stardot.org.uk/forums/viewto ... 35#p158735

I'm finding that pressing Escape whilst in Flex causes a hang.

This happens in both the Matchbox and in PiTubeDirect, so I don't think it's the hardware.

Does anyone got any ideas what might be happening here?

Dave

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

Re: 6809 and FLEX

Postby jgharston » Thu Jan 19, 2017 12:19 am

hoglet wrote:I'm finding that pressing Escape whilst in Flex causes a hang.

I wonder if this is it in the Flex Console.asm module:

Code: Select all

; -------------------------------
; CONIN - Console character input
; -------------------------------
CONIN:    JSR  [INCH]   ; Call BIOS
    ANDCC #$FE   ; Clear Carry
    TST  $FFFF   ; Check for Escape state
CONESC:    BPL  CONINOK   ; No Escape pending
    LDA  #$7E
    JSR  OSBYTE   ; Acknowledge Escape
    LDA  #$1B   ; Return A=Escape
    ORCC #$01   ; Set Carry
CONINOK: RTS

CONIN is supposed to only modify A and the flags, but if Escape if pressed the OSBYTE call changes X. If so, this should fix it:

Code: Select all

; -------------------------------
; CONIN - Console character input
; -------------------------------
CONIN:    JSR  [INCH]   ; Call BIOS
    ANDCC #$FE   ; Clear Carry
    TST  $FFFF   ; Check for Escape state
CONESC:    BPL  CONINOK   ; No Escape pending
    PSHS  X ; Save X
    LDA  #$7E
    JSR  OSBYTE   ; Acknowledge Escape
    PULS X ; Restore X
    LDA  #$1B   ; Return A=Escape
    ORCC #$01   ; Set Carry
CONINOK: RTS

Code: Select all

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

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Thu Jan 19, 2017 8:05 am

hoglet wrote:Prompted by this post from Jonathan, I've just been playing with Flex again.
http://www.stardot.org.uk/forums/viewto ... 35#p158735

I'm finding that pressing Escape whilst in Flex causes a hang.

This happens in both the Matchbox and in PiTubeDirect, so I don't think it's the hardware.

Does anyone got any ideas what might be happening here?

Which port of Flex are you using? If it's one of mine, I should be able to take a look at it later today. I'm currently redecorating our bathroom though so it depends on how much of that I get done...

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Thu Jan 19, 2017 9:49 am

RobC wrote:Which port of Flex are you using?

I'm using your BBCFLEX6 from this post:
viewtopic.php?p=105794#p105794

Jonathan, do you have a port as well?

Dave

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

Re: 6809 and FLEX

Postby jgharston » Thu Jan 19, 2017 1:34 pm

hoglet wrote:
RobC wrote:Which port of Flex are you using?
I'm using your BBCFLEX6 from this post:
viewtopic.php?p=105794#p105794
Jonathan, do you have a port as well?

Yes, that's the one I've got. I'm trying to remember how to insert the "custom BIOS" (Boot.bin, Console.bin, DiskIO.bin) into the disk image. Judging by the datestamps I've not done anything with my 6809 code since 25-Jan-2015 until a few days ago.

RobC wrote:I'm currently redecorating our bathroom though so it depends on how much of that I get done...

Lol. I'm currently "redecorating" one of my bedrooms. :D

Code: Select all

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

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Thu Jan 19, 2017 4:16 pm

jgharston wrote:Yes, that's the one I've got. I'm trying to remember how to insert the "custom BIOS" (Boot.bin, Console.bin, DiskIO.bin) into the disk image.

Do you overwrite my drivers with your own then? Mine are built into the FLEX.SYS file (built by appending the SPOOL, FLEX, FLEXFMS, DMA5 and TERMIO binaries together).

jgharston wrote:Lol. I'm currently "redecorating" one of my bedrooms.

That's a bit more involved than anything I'm doing! Although, I bet you won't cause a pipe to leak and get squirted in the face with a load of water :oops: My kids found it funny though!

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Thu Jan 19, 2017 9:41 pm

Had a quick look at this just now. My terminal io drivers just point to the client rom BIOS block entries from $F800 onwards (which is what Flex does).

Looking at the client source here: http://mdfs.net/Software/Tube/6809/Client09.src, the INCH and INECHO routines send command 0 (OSRDCH) across the Tube and pass the result back but there's no acknowledgement of escape.

I could patch my Flex driver to sort this out but I guess we should decide whether this should be done within the INCH and INECHO routines in the client rom.

The client rom command line prompt behaves correctly because it isn't using INECHO and instead has its own input handler.

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

Re: 6809 and FLEX

Postby jgharston » Thu Jan 19, 2017 10:29 pm

RobC wrote:Had a quick look at this just now. My terminal io drivers just point to the client rom BIOS block entries from $F800 onwards (which is what Flex does).
I could patch my Flex driver to sort this out but I guess we should decide whether this should be done within the INCH and INECHO routines in the client rom.

Based on examining other Flex Console module code the Flex equivalent of the BDOS (the code at &D3xx) should call the BIOS or MOS entries points in a manner appropriate to the BIOS/MOS they are calling, and the BIOS/MOS should just do the rawest lowest level calls, viz:

Code: Select all

; -------------------------------
; CONIN - Console character input
; -------------------------------
CONIN:    JSR  [INCH]   ; Call BIOS
    ANDCC #$FE   ; Clear Carry
    TST  $FFFF   ; Check for Escape state
CONESC:    BPL  CONINOK   ; No Escape pending
    PSHS X      ; Save X
    LDA  #$7E
    JSR  OSBYTE   ; Acknowledge Escape
    PULS X      ; Restore X
    LDA  #$1B   ; Return A=Escape
    ORCC #$01   ; Set Carry
CONINOK: RTS

I think CONINIT should probably do *FX229,1 to set the Escape key to ASCII, which is what the CP/M equivalent of CONINIT does. Which would also allow the CONIO entries to be pure jumps to the BIOS (and saves quite a bit of code space), so Console003.asm:

Code: Select all

   ORG  $D370
; --------------------------------
; CONINIT - Console initialisation
; --------------------------------
CONINIT: JSR  INITERR   ; Initialise MOS error handlers
         ; Returns X=BRKV, Y=ERRFLG
    LDD  #CONERR
    STD  ,X   ; Set [BRKV] to our error handler
;    STY  CONESC-2   ; Store address of ESCFLG; edit: we won't need this any more
    LDA  #$229
    LDX  #1
    LDY  #0
    JSR  OSBYTE
(snip)
    RMB  $D3E5-$
INCHAR:    FDB  BIOS_INCH
...
STAT:    FDB  BIOS_INCHK
OUTPUT:    FDB  BIOS_OUTCH
INPUT:    FDB  BIOS_INCHE


I'm having a rummage around to find how I "inserted" this code into the Flex boot disk image. How do you do it?

Code: Select all

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

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Fri Jan 20, 2017 8:17 am

jgharston wrote:Based on examining other Flex Console module code the Flex equivalent of the BDOS (the code at &D3xx) should call the BIOS or MOS entries points in a manner appropriate to the BIOS/MOS they are calling, and the BIOS/MOS should just do the rawest lowest level calls

Okay - I'll modify my IO code to acknowledge escape set escape to ASCII. I'll post a new version later today.

jgharston wrote:I'm having a rummage around to find how I "inserted" this code into the Flex boot disk image. How do you do it?

I build FLEX.SYS and then insert it into the boot disk using the Flex Floppy Maintenance tool. I built the boot disk using the same tool and combining binaries I wrote (NEWDISK, MODE etc.) with stuff I found from various sources. I add the DFS catalogue using a hex editor.

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Fri Jan 20, 2017 8:49 pm

Here's a new disk image which has a modified version of my terminal IO driver setting escape to ASCII at initialisation.

I've tested it on my Master and it seems to work okay: the escape key is generally ignored by Flex but does what it's supposed to in XBASIC.

Happy to look at any other issues. I did start porting a screen editor and might have a look at finishing it off if I get a chance.
Attachments
BBCFLEX7.zip
(131.39 KiB) Downloaded 23 times

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

Re: 6809 and FLEX

Postby jgharston » Sat Jan 21, 2017 6:41 pm

I've
finished
decorating
the bedroom
and am aching all over, but I'll now be able to get back to some programming stuff.

Code: Select all

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

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

Re: 6809 and FLEX

Postby jgharston » Sat Jan 21, 2017 8:48 pm

RobC wrote:Here's a new disk image which has a modified version of my terminal IO driver setting escape to ASCII at initialisation. ...

The code header in the flex boot loader is slightly wrong:

Code: Select all

C100 42          EQUS "BBC FLEX"
C108 21 42       EQUS "!BOOT  ","$"+128
C110 46          EQUS "FLEX   ","$"+128
C118 00 00 00 00 EQUD 0
C11C 00 00 00 00 EQUD 0

C120 7E C1 40    JMP  &C140
C123 00 00 00    EQUB 0,0,0
C126 63          EQUB &63
C127 13          EQUB &C133-&C120
C128 03          EQUB &03
C129 4C          EQUS "LOAD FLEX"
C132 00          ; erroneous extra byte
C133 00          EQUB 0
C134 28 43       EQUS "(C) TSC" ; shouldn't be space after (C), should be "(C)blah... not "(C) blah...
C13B 00          EQUB 0
C13C 00 C1 00 00 EQUD &0000C100

The title should really be a noun, that's part of what title means, so "FLEX LOADER" would be more appropriate.

Code: Select all

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

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

Re: 6809 and FLEX

Postby jgharston » Sun Jan 22, 2017 5:20 pm

I think in the past I'd used a sector editor to find where FLEX.SYS was in the disk image, then did a FOR A=1 TO xx: BPUT#out,BGET#in: NEXT loop to poke the Console and DiskIO drivers in. So, I've written AddSyst which does it programatically, see here.

I remember when I was last prodding around with Flex I was trying to get CAT to display in multiple columns as everything zooms off the screen before I can see anything.

Code: Select all

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

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Mon Jan 23, 2017 9:52 am

jgharston wrote:I remember when I was last prodding around with Flex I was trying to get CAT to display in multiple columns as everything zooms off the screen before I can see anything.

Does setting page mode on with CTRL-N not work then?

If not, I have commented source code for most of the Flex utilities somewhere.

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

Re: 6809 and FLEX

Postby jgharston » Mon Jan 23, 2017 4:44 pm

RobC wrote:
jgharston wrote:I remember when I was last prodding around with Flex I was trying to get CAT to display in multiple columns as everything zooms off the screen before I can see anything.

Does setting page mode on with CTRL-N not work then?

Yes that works, but I still only see 1/4 of the catalog at any one time with 3/4 of the screen empty, and have to remember what's disappeared off the top of the screen when I get back to the command prompt.

Code: Select all

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

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Sun Feb 19, 2017 1:04 pm

Hi Rob,
RobC wrote:Here's a new disk image which has a modified version of my terminal IO driver setting escape to ASCII at initialisation.

I've tested it on my Master and it seems to work okay: the escape key is generally ignored by Flex but does what it's supposed to in XBASIC.

Happy to look at any other issues. I did start porting a screen editor and might have a look at finishing it off if I get a chance.

I've just tried this on the Model B, and pressing escape has no effect in either BASIC or XBASIC, i.e. nothing is printed and you can't interrupt a running BASIC program.

Tested on the Matchbox and on latest boa-dev version of PiTubeDirect.

Am I misunderstanding what's meant to happen?

Dave

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

Re: 6809 and FLEX

Postby jgharston » Sun Feb 19, 2017 1:51 pm

hoglet wrote:I've just tried this on the Model B, and pressing escape has no effect in either BASIC or XBASIC, i.e. nothing is printed and you can't interrupt a running BASIC program.

Programs running on anything non-Acorn tend to expect Ctrl-C to interupt a running program.

Code: Select all

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

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Sun Feb 19, 2017 2:18 pm

jgharston wrote:
hoglet wrote:I've just tried this on the Model B, and pressing escape has no effect in either BASIC or XBASIC, i.e. nothing is printed and you can't interrupt a running BASIC program.

Programs running on anything non-Acorn tend to expect Ctrl-C to interupt a running program.

That doesn't seem to work either to interrupt a running program.

Dave

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Sun Feb 19, 2017 3:02 pm

Does the Escape key not stop a running program in XBASIC? I definitely tested it and it stopped the program.

I'll take another look at this later today.

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

Re: 6809 and FLEX

Postby jgharston » Sun Feb 19, 2017 3:58 pm

RobC wrote:Does the Escape key not stop a running program in XBASIC? I definitely tested it and it stopped the program.
I'll take another look at this later today.

It works in this version of ExBasic09 because it's built from source code with the appropriate code hook into the Tube MOS error and escape handling. Anything run from FLEX is dependent on whatever environment FLEX gives to the application, and whatever that application choses to use to commincate with the outside world.

Code: Select all

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

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Sun Feb 19, 2017 4:45 pm

Pretty sure I tested it with the BASIC on the disk image I posted.

Had a quick play on a Flex emulator and XBASIC reacts to CTRL-C but not to Escape (as you'd expect).

We could make Escape do the equivalent of CTRL-C in the terminal driver...

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Sun Feb 19, 2017 4:51 pm

RobC wrote:Pretty sure I tested it with the BASIC on the disk image I posted.

If you have the time, then please could you try this again in case I'm doing something silly.

Specifically, I ran the following program in both BASIC and XBASIC:

Code: Select all

10 PRINT "HELLO"
20 GOTO 10

Neither Escape or ^C would interrupt it.

Dave

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Sun Feb 19, 2017 5:18 pm

Will do.

(I'm in the middle of testing my enhanced video ULA with a model B so my matchbox co-pro machine isn't setup at the moment but I'll test it again some time today.)

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Mon Feb 20, 2017 12:39 pm

Sorry for the delay in getting round to this but I've been trying to sort out a memory expansion for an A3000...

I've retested this on my M128 with matchbox co-pro using the BBCFLEX7 disk image I posted.

In both BASIC and XBASIC, Escape stopped a running program - pressing Escape stopped the program and then RETURN brings up the "READY" prompt. CTRL-C had no effect on the running program (as expected). I'm using the BASIC and XBASIC that are on the BBCFLEX7 disk...

What behaviour are you seeing Dave? Does Escape still cause a crash in FLEX or is it just ignored?

Still happy to change Escape to do 'CTRL-C' if people think that would be more helpful.

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Mon Feb 20, 2017 2:45 pm

RobC wrote:I've retested this on my M128 with matchbox co-pro using the BBCFLEX7 disk image I posted.

In both BASIC and XBASIC, Escape stopped a running program - pressing Escape stopped the program and then RETURN brings up the "READY" prompt. CTRL-C had no effect on the running program (as expected). I'm using the BASIC and XBASIC that are on the BBCFLEX7 disk...

What behaviour are you seeing Dave? Does Escape still cause a crash in FLEX or is it just ignored?

I'm sure it was just being ignored, but it sounds like I messed something up.

I'll try this same combination again later today.

Out of interest, what was your basic program doing?

Dave

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Mon Feb 20, 2017 3:00 pm

No problem - I didn't repeat the whole process (writing the image to disk etc.) so it's possible that I've done something amiss.

hoglet wrote:Out of interest, what was your basic program doing?

Same as yours:

Code: Select all

10 PRINT "HELLO"
20 GOTO 10

User avatar
hoglet
Posts: 6622
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 and FLEX

Postby hoglet » Tue Feb 21, 2017 5:14 pm

Hi Rob,
RobC wrote:No problem - I didn't repeat the whole process (writing the image to disk etc.) so it's possible that I've done something amiss.

No, it was me that somehow messed up.

I just repeated the whole exercise and escape is working fine now, both on the Matchbox and on PiTubeDirect.

Thanks for your help,

Dave

RobC
Posts: 1820
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 and FLEX

Postby RobC » Wed Feb 22, 2017 6:09 pm

No problem - glad it's working.

In preparation for the RISC OS SW Show, I've been simplifying my disk drivers so that they run from RAMFS on the DataCentre. When I get a chance, I'll pop the latest version of the system disk on here.


Return to “software: other”

Who is online

Users browsing this forum: No registered users and 3 guests