## A mathematical demo

### A mathematical demo

Hi. Happy New Year and Holidays!

I dare to present my small multi-platform project PI-DEMO. It is available at http://litwr2.atspace.eu/pi/pi-spigot-benchmark.html. It has versions for 6809 and 6309. 6309 shows 3.63 times faster speed than 6809!

I am using XROAR emulator. IMHO Xroar (+ GDB) is one of the best emulator in the world. I only would like to have the speed indicator (percentage) in the full throttle mode (F12) and a Linux port for gdb-6x09. However I have some doubts about the exactness of 6309 emulation. So I have to ask for a favor. Please run PI-DEMO with the real iron. It is interesting to know exactly the power of the 8-bit genuine CPU king. A lot of thanks in advance.

I had a little practice with 6x09 programming. So it would be great if somebody finds a way to make the codes a bit faster. The main loop to optimize is rather small and situated between `loop2' and `l4' labels. C sources are also provided. The current version of the demo shows Dragon with 6809 only 0.2% slower than Commodore-128 or BBC Micro...

I had a problem with very good asm6809 assembler. I can't force it to assemble TFR 0,B instruction of 6309. How to call the zero register with asm6809?

I dare to present my small multi-platform project PI-DEMO. It is available at http://litwr2.atspace.eu/pi/pi-spigot-benchmark.html. It has versions for 6809 and 6309. 6309 shows 3.63 times faster speed than 6809!

I am using XROAR emulator. IMHO Xroar (+ GDB) is one of the best emulator in the world. I only would like to have the speed indicator (percentage) in the full throttle mode (F12) and a Linux port for gdb-6x09. However I have some doubts about the exactness of 6309 emulation. So I have to ask for a favor. Please run PI-DEMO with the real iron. It is interesting to know exactly the power of the 8-bit genuine CPU king. A lot of thanks in advance.

I had a little practice with 6x09 programming. So it would be great if somebody finds a way to make the codes a bit faster. The main loop to optimize is rather small and situated between `loop2' and `l4' labels. C sources are also provided. The current version of the demo shows Dragon with 6809 only 0.2% slower than Commodore-128 or BBC Micro...

I had a problem with very good asm6809 assembler. I can't force it to assemble TFR 0,B instruction of 6309. How to call the zero register with asm6809?

Last edited by litwr on Sun Jan 01, 2017 12:26 pm, edited 1 time in total.

### Re: A mathematical demo

Aha, a bug! For now, work around it by using TFR 12,B (it'll warn, but numbers are allowed - of course, register number 0 is not the zero valued register on a 6309, so you get the wrong result). I'll try and get a fix in for this in 6309 mode.litwr wrote: I had a problem with very good asm6809 assembler. I can't force it to assemble TFR 0,B instruction of 6309. How to call the zero register with asm6809?

### Re: A mathematical demo

Ok, try version 2.7 - in 6309 mode, now permits "0" as a register for TFR & EXG without warning and uses register 12.

Edit: oh, and Happy New Year!

Edit: oh, and Happy New Year!

### Re: A mathematical demo

Thanks! It may make PI-DEMO 2 bytes shorter.

EDIT. Sorry, a small typo made typing π for 6309 a bit wrong. It is fixed. Version 20 of demo is released. I have made it a bit faster. So Dragon 32 with 6809 is faster than C128/NTSC now. It is a mystery with BBC Micro and Dragon race. The Beeb is faster for 100 and 3000 digits but it is slower for 1000 digits. It is odd. I can explain this result only by more slower screen output and vertical scrolling of Dragon-32. Dragon-32 has also to make more vertical scrolls...

EDIT. Sorry, a small typo made typing π for 6309 a bit wrong. It is fixed. Version 20 of demo is released. I have made it a bit faster. So Dragon 32 with 6809 is faster than C128/NTSC now. It is a mystery with BBC Micro and Dragon race. The Beeb is faster for 100 and 3000 digits but it is slower for 1000 digits. It is odd. I can explain this result only by more slower screen output and vertical scrolling of Dragon-32. Dragon-32 has also to make more vertical scrolls...

### Re: A mathematical demo

Pipack-22 is just released - http://litwr2.atspace.eu/pi/pi-spigot-benchmark.html. It contains newer and faster versions for Dragons. The request for help with 6309 is still actual.

### Re: A mathematical demo

Very nice, indeed.litwr wrote:Pipack-22 is just released - http://litwr2.atspace.eu/pi/pi-spigot-benchmark.html. It contains newer and faster versions for Dragons. The request for help with 6309 is still actual.

Just a small typo in the 2nd table, rank 11, "68516" should be "65816"

*The dragon on my side: http://klasek.at/hc/dragon/*### Re: A mathematical demo

Thank you. However the data for 6309 may not be too accurate. I am using Xroar. There is another problem with it. Pi-demo uses Dragon at its maximum speed at 1.78 MHz. So it may not work with real iron because there is DRAM regeneration problem. Pi-demo uses continuous memory interval and this should properly refresh DRAM but I have no hardware to test it.

### Re: A mathematical demo

Bump! Could anybody help me and run my pi-calculator with the real silicon 6809? Indeed tests with 6309 can give us even more interesting results.

### Re: A mathematical demo

I ran your tests on my Dragon 64 equipped with a 6309 processor and this are the results for 100, 500 and 1000 digits:

100 digits:

6809 3.42

6809 Fast 1.72

6309 .92

6309 Fast .44

500 digits:

6809 79.54

6809 Fast 39.62

6309 21.08

6309 Fast 10.5

1000 digits:

6809 316.28

6809 Fast 157.54

6309 83.64

6309 Fast 41.68

Please tell me if you need more tests.

100 digits:

6809 3.42

6809 Fast 1.72

6309 .92

6309 Fast .44

500 digits:

6809 79.54

6809 Fast 39.62

6309 21.08

6309 Fast 10.5

1000 digits:

6809 316.28

6809 Fast 157.54

6309 83.64

6309 Fast 41.68

Please tell me if you need more tests.

### Re: A mathematical demo

Thank you very much! Your results show that XRoar is very accurate, it gives almost the same numbers. Would you like to get results for 3000 digits? It is the most precious values.

We also got an interesting collateral result - The Dragon works stable in the fast mode (that is without DRAM refreshing) during about 3 minutes. If we get the results for 3000 digits it will mean that code for RAM refreshing works.

The speed of the 6309 is fantastic. Such a processor could make the 68000 to look a bit bland in 1982. Is it right that 6309 appeared at 1982?

We also got an interesting collateral result - The Dragon works stable in the fast mode (that is without DRAM refreshing) during about 3 minutes. If we get the results for 3000 digits it will mean that code for RAM refreshing works.

The speed of the 6309 is fantastic. Such a processor could make the 68000 to look a bit bland in 1982. Is it right that 6309 appeared at 1982?