6809 and FLEX

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
roland
Posts: 2808
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: 6809 and FLEX

Postby roland » Mon Apr 27, 2015 9:37 pm

I'm still struggling with my images files. At the moment I can only read SD/SS disk images (90K). So I started looking around in the other formats and I came along this F77.DSK image:

Code: Select all

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000100  00 03 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000210  44 49 53 4b 00 00 00 00  00 00 00 00 01 1b 09 1b  |DISK............|
00000220  07 01 23 04 0f 61 27 14  00 00 00 00 00 00 00 00  |..#..a'.........|
00000230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000310  44 49 53 4b 00 00 00 00  00 00 00 00 01 01 01 27  |DISK...........'|
00000320  14 03 0c 04 0f 61 27 14  00 00 00 00 00 00 00 00  |.....a'.........|
00000330  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000400  00 06 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000410  53 56 54 45 53 54 00 00  41 53 4d 00 00 1a 13 1b  |SVTEST..ASM.....|
00000420  08 00 08 00 00 03 0d 04  ff 56 54 45 53 54 00 00  |.........VTEST..|
00000430  4c 49 54 00 00 00 00 00  00 00 00 00 00 03 0d 04  |LIT.............|
00000440  ff 48 41 52 49 4e 44 58  44 45 4d 00 00 01 0b 01  |.HARINDXDEM.....|
00000450  0d 00 03 00 00 02 11 54  ff 48 41 52 53 00 00 00  |.......T.HARS...|
00000460  44 45 4d 00 00 01 0e 01  12 00 05 00 00 02 11 54  |DEM............T|
00000470  45 52 52 4f 52 53 00 00  46 37 37 00 00 01 13 02  |ERRORS..F77.....|
00000480  0e 00 10 00 00 02 11 54  ff 58 54 45 52 4e 41 4c  |.......T.XTERNAL|
00000490  44 45 4d 00 00 02 0f 03  02 00 08 00 00 02 11 54  |DEM............T|
000004a0  46 37 37 00 00 00 00 00  43 4d 44 00 00 03 03 0b  |F77.....CMD.....|
000004b0  04 00 a2 00 00 02 11 54  46 37 37 00 00 00 00 00  |.......TF77.....|
000004c0  4c 49 42 00 00 0b 05 0b  05 00 01 00 00 02 11 54  |LIB............T|


According to the docs this disk should be $1B tracks and 7 sectors per track, as you can read in the SIR at &0200. That would make an image of 49KB. However, the image is 205KB which is more like the information in the SIR at &0300: $27 * $14 * 256 = 199680 bytes. However, track 0 sector 3 shouldn't be used by flex. What kind of image is driving me nuts?


The PASCAL.DSK image is making more sense:

Code: Select all

00000210  54 53 43 5f 50 41 53 00  00 00 00 00 db 12 11 4c  |TSC_PAS........L|
00000220  1a 05 ee 03 15 63 4c 1a  00 00 00 00 00 00 00 00  |.....cL.........|
00000230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000300  00 05 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000310  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*


This image should be $4C * $1A * 256 = 505856 bytes and does look like the file size of the image file (513KB).


BTW JGH's workaround works fine: create a custom image and copy the files with FLOPPYMAINT. I created an image with 255 tracks but still 10 sectors per track which is a file of about 650KB. Then I copied all the Pascal files to that image and now I can read them. Not execute them because I really have no clue how to start one of the pascal files.... more stuff to drive me nuts :shock:
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
1024MAK
Posts: 6791
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: 6809 and FLEX

Postby 1024MAK » Mon Apr 27, 2015 9:54 pm

roland wrote:I'm still struggling with my images files....
<snip>
What kind of image is driving me nuts?
<snip>
...because I really have no clue how to start one of the pascal files.... more stuff to drive me nuts :shock:

Nuts? On an Acorn computer? Surely not :lol:

Personally I prefer fruit and nut chocolate :wink: :D

Keep at it =D>

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

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

Re: 6809 and FLEX

Postby roland » Sat Aug 15, 2015 10:00 am

It seems like I have figured out how to read (and mount) the images. I can even mount JGH's BBCFLEX6.DSD file 8)

And run the adventure game:

IMG_0313.JPG


I think the qqqq at the beginning of each line has something to do with a control code that my Atom ignores...
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
DutchAcorn
Posts: 1631
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands

Re: 6809 and FLEX

Postby DutchAcorn » Sun Aug 16, 2015 9:50 am

Inspired by Roland's update I wrote the image that Rob posted to a disk and had a go at it in the matchbox copro. Not surprisingly that worked without issues =D>

One thing I did notice is that using wildcards in the CAT command produces the correct results - and "DISK ERROR #26". Tried this using DFS 1.2 on a BBC and 1770 DFS on a master using two different drives.

Is it supposed to do that or is it my configuration? :-k
Paul

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

Re: 6809 and FLEX

Postby RobC » Sun Aug 16, 2015 2:41 pm

DutchAcorn wrote:Inspired by Roland's update I wrote the image that Rob posted to a disk and had a go at it in the matchbox copro. Not surprisingly that worked without issues =D>

One thing I did notice is that using wildcards in the CAT command produces the correct results - and "DISK ERROR #26". Tried this using DFS 1.2 on a BBC and 1770 DFS on a master using two different drives.

Is it supposed to do that or is it my configuration? :-k

Glad someone else is using FLEX :)

I'm using a Master so the CAT thing shouldn't be a problem with your setup.

Disk error #26 is "Command syntax error" so could you post the exact command you are running please?

According to the FLEX Users Manual, the syntax of the CAT command is:

CAT[,<drive list>][,<match list>]

e.g. +++CAT,0,1,.CMD,.SYS

I have the 6809 source for all the FLEX commands and have a couple of days off this week so should be able to debug this.

User avatar
DutchAcorn
Posts: 1631
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands

Re: 6809 and FLEX

Postby DutchAcorn » Sun Aug 16, 2015 5:06 pm

RobC wrote:... Disk error #26 is "Command syntax error" so could you post the exact command you are running please?
...

Ah, I was using

Code: Select all

CAT B*
assuming that would get me all files starting with the letter B (which it did, including an error). It appears that to list all files starting with the letter B you can simply use the command

Code: Select all

CAT B
The asterisk is the symbol that produces error #26.

I should just read the user guide before posting silly questions... :oops: :-#
Paul

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

Re: 6809 and FLEX

Postby RobC » Sun Aug 16, 2015 6:44 pm

No problem - glad that it was something simple!

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

Re: 6809 and FLEX

Postby roland » Sun Aug 16, 2015 10:28 pm

Rob,

Did you already try some other languages than basic? If so, which compiler would you recommend for e.g. C and Pascal?

I didn't try nothing yet but I'm about to do so next week....
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: 6809 and FLEX

Postby RobC » Mon Aug 17, 2015 8:10 am

roland wrote:Did you already try some other languages than basic? If so, which compiler would you recommend for e.g. C and Pascal?

I haven't tried any other languages but there should be some compilers on the disk image I posted.

Unfortunately, I don't know which versions they are as I was just given a number of disk images and pulled them together into a system disk.

As I said earlier, I'm off work for a couple of days so could have a play with the compilers (assuming I can still remember how to write Pascal!) to see if they work.

Also, I mailed Jerry Davis (who helped me with all this stuff) about software and this is what he recommended:
A good option is the standard and enhanced Basic from TSC. Your hardware needs to be a close match to the TSC memory map in order for those to work but they are pretty cool! You can run with non-standard devices but RAM needs to be where Basic thinks it should be and do what Basic thinks it should do.

A lot of folks on the Flex Users Group like the Dynamite Disassembler which seems to work well for binaries you don’t have the source code for.

If you want to experiment with an early Forth interpreter there is eForth interpreter from Frank Hogg Labs.

I’m a C programmer and the Dyna-C compiler from Allan Jost at Dynasoft is nice for small programs. Dynasoft has a PASCAL compiler but I’ve not used it.

There’s even a spreadsheet called Dynacalc but I’ve not used it either.

I noticed a number of folks like the TSC Text Editing and Text Processing System. But I think the winner for text editing is SCREDITOR III from John Alford.

All of the above were placed in the public domain by the authors and are fee to download and use.

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

Re: 6809 and FLEX

Postby roland » Mon Aug 17, 2015 9:14 am

Thanks Rob for your reply. I have access to the FTP archives as well and will try some of the compilers. I don't think I'm going to use them a lot, but it's just the fun to get is working on my Atom (actually, my 6809 board that uses my Atom for I/O).

I will keep you informed here about my progress.
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
sPhilMainwaring
Posts: 251
Joined: Tue Jan 15, 2013 7:57 pm
Location: Mid Wales
Contact:

Re: 6809 and FLEX

Postby sPhilMainwaring » Mon Aug 17, 2015 9:32 am

RobC wrote:I'm off work for a couple of days so could have a play with the compilers (assuming I can still remember how to write Pascal!) to see if they work.


program HelloWorld;

begin
writeln('Hello World');
end.

:p

User avatar
danielj
Posts: 5346
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: 6809 and FLEX

Postby danielj » Mon Aug 17, 2015 9:39 am

=D> :lol:

Prime
Posts: 2345
Joined: Sun May 31, 2009 11:52 pm

Re: 6809 and FLEX

Postby Prime » Mon Aug 17, 2015 12:56 pm

RobC wrote:I'm off work for a couple of days so could have a play with the compilers (assuming I can still remember how to write Pascal!) to see if they work.


Code: Select all

PROGRAM Dixons;

BEGIN;
   Repeat;
      Write('Dixons is SHIT! ');
   Until (1=0);
END.


:) :) :)

Cheers.

Phill.

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

Re: 6809 and FLEX

Postby roland » Mon Aug 17, 2015 1:32 pm

Thanks for these inspiring examples, I'll try them both :lol:
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: 6809 and FLEX

Postby roland » Mon Aug 17, 2015 6:14 pm

I tried three versions of Pascal which all seem to start, however none of them lead me to a working "Hello World".

For all those tests I used the following program:

Code: Select all

program helloworld;

begin
  writeln('Hello world');
end.


1. Omegasoft Pascal
This compile started to complain about undeclared or incorrect standard i/o device and I found out that this version needs the I/O specified in the program line, like this:

Code: Select all

program helloworld (output);


After this modification the program compiles without errors but what's next? The manuals I have found don't mention what to do now. There are a linker and an assembler included but running them did not lead to an executable program.

I found a manual at http://www.cs.otago.ac.nz/homepages/and ... Pascal.pdf but I didn't see a section about how to run a program. Some further investigation is needed.

2. TSC Pascal

It loads, starts and displays the message The specified file could not be found. Regardless of the parameters I add. I didn't find a manual yet.

3. Lucidata Pascal9
This compiler behaves like TSC Pascal but the message is different: Illegal file specification.
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: 6809 and FLEX

Postby RobC » Mon Aug 17, 2015 6:37 pm

roland wrote:
2. TSC Pascal

It loads, starts and displays the message The specified file could not be found. Regardless of the parameters I add. I didn't find a manual yet.

Is the manual here:
http://www.colorcomputerarchive.com/coco/Documents/Manuals/Programming/TSC%206809%20Flex%20Pascal%20User's%20Manual%20(Technical%20Systems%20Consultants).pdf

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

Re: 6809 and FLEX

Postby roland » Mon Aug 17, 2015 7:53 pm

Hi Rob,

Yes, that's the manual 8)

IMG_0320.JPG


IMG_0321.JPG


I had to assign drive 1 as system drive, the ASN W=1,S=1 fixed the error. That corrected the file error but I still had one error in that incredible complex helloworld.pas program. An error in line 1 ... TSC Pascal doesn't like what a Pascal program makes a Pascal program: the Pascal statement in line 1 :evil:
After removing that line the program compiles and runs without errors.
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: 6809 and FLEX

Postby roland » Mon Aug 17, 2015 8:06 pm

And this one is for Phill :wink:

IMG_0322.JPG
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: 6809 and FLEX

Postby roland » Thu Aug 20, 2015 10:53 pm

Today, while Stardot was unreachable (at least for me), i managed to get this working:

image.jpg


This is the Dynasoft C compiler. I really need its manual because it has some very strange syntax.... But it's cool to have a C compiler working on my 6809 board 8)
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 » Fri Oct 23, 2015 7:57 am

Hi Guys,

Just been catching up on this thread, which I had somehow managed to miss completely. Excellent work getting Flex running.

=D> =D> =D> =D> =D> =D> =D> =D> =D> =D>

Today I'm going to try a couple of things:
1. Verify that the latest version (Rob's BBCFLEX6) works on the Beeb with the latest matchbox build (it should, nothing has changed on the 6809)
2. Have a go at running this on the Atom Tube, in the same way that I got CPM to boot (using SDDOS to mount this disk image)

The main issue I think I'll have to overcome is getting the boot loader to execute in this environment, because I don't known how compatible SDDOS is with DFS.

Anyway, I'm sure it will be a fun ride!

Roland, is this is disk image you are using on your Atom 6809?

Dave

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

Re: 6809 and FLEX

Postby jgharston » Fri Oct 23, 2015 9:48 am

hoglet wrote:Today I'm going to try a couple of things:
1. Verify that the latest version (Rob's BBCFLEX6) works on the Beeb with the latest matchbox build (it should, nothing has changed on the 6809)
2. Have a go at running this on the Atom Tube, in the same way that I got CPM to boot (using SDDOS to mount this disk image)
The main issue I think I'll have to overcome is getting the boot loader to execute in this environment, because I don't known how compatible SDDOS is with DFS.

The three files Boot.asm, Console.asm and DiskIO.asm here are what you need to customise a Flex system to run on the BBC 6809 Tube. The only filing system dependency they have is calling OSWORD &7F to access single density disks.

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 » Fri Oct 23, 2015 10:14 am

jgharston wrote:The three files Boot.asm, Console.asm and DiskIO.asm here are what you need to customise a Flex system to run on the BBC 6809 Tube. The only filing system dependency they have is calling OSWORD &7F to access single density disks.

Are these used in Rob's BBCFLEX6 release, or was that done independently?

Dave

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

Re: 6809 and FLEX

Postby hoglet » Fri Oct 23, 2015 11:32 am

Whoop! :D :D :D

FLEX working on Atom TUBE:
IMG_0117.JPG

It's a tad fiddly to start:
- Extract the FLEX boot loader and save as an AtoMMC file
- Start Atom Tube with AtoMMC as the file system and *LOAD FLEX
- Hit Break
- Start Atom Tube with SDDOS as the file system and BBCFLEX6.DSD mounted as Drive 0
- GO C120 to run the FLEX boot loader that was loaded earlier

This shenanigans is necessary because SDDOS doesn't support LOAD/SAVE over the Tube, so you can't just to *RUN FLEX. But the Atom Tube does contain an implementation of OSWORD 7F that seems to be sufficient for FLEX to work.

Roland, I'm interested in understanding how you got this working, and which bits you had to write yourself.

Dave

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

Re: 6809 and FLEX

Postby RobC » Fri Oct 23, 2015 6:12 pm

Great to see this up and running.
hoglet wrote:
jgharston wrote:The three files Boot.asm, Console.asm and DiskIO.asm here are what you need to customise a Flex system to run on the BBC 6809 Tube. The only filing system dependency they have is calling OSWORD &7F to access single density disks.

Are these used in Rob's BBCFLEX6 release...

No - they are independent. I'm sure JGH's versions are better than mine but I'd always wanted to port Flex to the Beeb and so I was keen to complete the work myself!

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

Re: 6809 and FLEX

Postby hoglet » Fri Oct 23, 2015 6:13 pm

Hi Rob,
RobC wrote:Great to see this up and running.
hoglet wrote:
jgharston wrote:The three files Boot.asm, Console.asm and DiskIO.asm here are what you need to customise a Flex system to run on the BBC 6809 Tube. The only filing system dependency they have is calling OSWORD &7F to access single density disks.

Are these used in Rob's BBCFLEX6 release...

No - they are independent. I'm sure JGH's versions are better than mine but I'd always wanted to port Flex to the Beeb and so I was keen to complete the work myself!

Would you be able to make the sources available? - I'd love to understand better what was involved.

I'd also like to be able to see what set of OSWORD 7F commands I need to emulate in the Atom Tube host.

Dave

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

Re: 6809 and FLEX

Postby RobC » Fri Oct 23, 2015 7:26 pm

Hi Dave,

I'll dig them out - they were on my old laptop which died a while back so I'll have to go through the backup.

It wasn't that difficult as the Flex Adaptation Guide explains what you need to do. Then it's just a case of wrapping the relevant OSWORD and Client ROM calls.

As luck would have it, I do have some notes that I made (in a lunchtime at work) that I emailed to myself - here are the required disk routines and associated OSWORD calls:

Code: Select all

READ - OSWORD &7F, Op &57 Read data and deleted data multi-sector **read one 256-byte sector**
WRITE - OSWORD &7F, Op &4B Write data multi sector **write one 256-byte sector**
VERIFY - OSWORD &7F, Op &5F Verify data and deleted data multi-sector **verify one 256-byte sector**
RESTORE - OSWORD &7F, Op &69 Seek
DRIVE - Store selected drive in CURDRV
CHKRDY - Check valid drive no.
QUICK - Same as CHKRDY
INIT - Do nothing
WARM - Do nothing
SEEK - OSWORD &7F, Op &69 Seek


The OSWORD calls will be correct but I did have to add some manipulation of the sector and drive numbers to translate between the Flex ordering (1-10 on side 1, 11-20 on side 2) and the Beeb's 0-9 on each side.

I'll dig out my sources and will put together something explaining how to build and combine the objects as the order you combine them is important.

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

Re: 6809 and FLEX

Postby roland » Fri Oct 23, 2015 9:54 pm

hoglet wrote:Roland, I'm interested in understanding how you got this working...


Me too :lol:

hoglet wrote:... and which bits you had to write yourself.


I wrote my own Flex disk drivers and a special terminal program which handles the flex requests. I did not use any sddos software but instead I used random access files to read and write the images. Yes, it is slow but I'm not limited to the 100k image size. My Atom can handle images up to 16 MB this way.

I'll search my sources tomorrow evening and upload them somewhere to the Internet.
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 » Fri Oct 23, 2015 10:03 pm

RobC wrote:As luck would have it, I do have some notes that I made (in a lunchtime at work) that I emailed to myself - here are the required disk routines and associated OSWORD calls.

Perfect, just what I was looking for,
RobC wrote:I'll dig out my sources and will put together something explaining how to build and combine the objects as the order you combine them is important.

Brill, thanks.

Dave

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

Re: 6809 and FLEX

Postby hoglet » Fri Oct 23, 2015 10:06 pm

roland wrote:I wrote my own Flex disk drivers and a special terminal program which handles the flex requests. I did not use any sddos software but instead I used random access files to read and write the images. Yes, it is slow but I'm not limited to the 100k image size. My Atom can handle images up to 16 MB this way.

Interestingly, the SDDOS APIs in the AtoMMC2 PIC do not seem to be limited to 100K images. I'm using them successfully with 400K .dsd files, and they are really fast. In fact, I think SDDOS 3 would also work with much larger disk images.
roland wrote:I'll search my sources tomorrow evening and upload them somewhere to the Internet.

I look forward to learning from these.

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 4:33 pm

Hi Dave,

Here are my files.

I never looked at the API of SDDOS because I thought its maximum image size was 100 kB, just like Atom disks.

Greetings,
Roland
Attachments
AtomFlex.zip
(28.08 KiB) Downloaded 33 times
256K + 6502 Inside
MAN WOMAN :shock:


Return to “software: other”

Who is online

Users browsing this forum: No registered users and 4 guests