• Please review our updated Terms and Rules here

π for the Altair 8080

vol.litwr

Experienced Member
Joined
Mar 22, 2016
Messages
325
Great project congrats, would love to see the Altair included .
I have just made the code for CP/M-80. However as I know, the Altair has no any hardware to measure timings and therefore my code can't measure time. So I can't include the Altair 8800 results in my project (there is also sources location). :(
BTW it is interesting that the 8080 code gives about 73% speed of the z80 code. I ran both codes on the same the z80 based computer.
 

Attachments

  • pi-80g.zip
    1.4 KB · Views: 1
Not the Altair 8080, but possibly the newest CP/M 2.2 machine.
TRS-80 Model 100 with REXCPM upgrade, 80C85 processor @2.4576 MHz. Running CP/M 2.2
Results:
100 : ~ 5 seconds
1000: 340 seconds
3000: 3052 seconds
max # of digits = 7712
 
Not the Altair 8080, but possibly the newest CP/M 2.2 machine.
TRS-80 Model 100 with REXCPM upgrade, 80C85 processor @2.4576 MHz. Running CP/M 2.2
Results:
100 : ~ 5 seconds
1000: 340 seconds
3000: 3052 seconds
max # of digits = 7712

Thank you very much. Your machine configuration looks fantastic! It's worth to write a specialized program for it. It is interesting could the 8085 beat the z80 at the same frequency? However, sorry, I know very little about the TRS-80 Model 100 hardware. Could you help me with details about its timer? I need timer data or timer/raster interrupt handler address. I also need the frequency of the updates. Is there any TRS-80 Model 100 emulator anywhere?
 
Yes, but you need an unreleased version of VirtualT. I have that "pre-release" version myself for development.
All of the files are available now to get the VirtualT setup running.
So, for timing, I guess you want to detect start and stop time?
There are also 8 undocumented opcodes in 8085, some of which are very useful. There might be some speed up possible.
 
An option for spaces every 5 would be nice if they could be implemented along with a cr/lf so they stay aligned on the screen (you can get 13 groups of 5 to fit in 80 columns).
 
Thanks very much for posting this!

I have downloaded your application and transferred it onto a CP/M disk in my Altair 8800c. It appears to work properly for me - no printing of the time measurement at the end, as you indicated. I will attempt to time the process for 100, 1000, and 3000 digits by hand and post them back here.

smp
 
I'm working with PI-80G on my Altair 8800c.

Yesterday, I successfully ran 100, 200 and 500 digits, and I notice that the program takes a bit longer to get started printing out the 4 digit sequences, and longer in between sequences, for more requested total digits. Then, I decided to try for the maximum 7232, as indicated by the input message. The program took quite a while to print out the first 4 digit sequence, and then slowly prints out subsequent sequences. I manually stopped the program after letting it work for over 4 hours.

Question: If the program is running, attempting to print out the maximum number of digits allowed, does that mean that given enough time the program will successfully finish? I would hate to let the program churn away for 6 or 8 hours and then have it crash because for whatever reason it cannot actually finish.

TIA

smp
 
I have made code for Tandy model 100/102. It is two files: `PI.BA' and `CALCPI.CO'. `PI.BA' loads and runs `CALCPI.CO' from `RAM:'. So at first `CALCPI.CO' must be moved to `RAM:'. It is quite possible that `CALCPI.CO' can be loaded from a cassette but I have not tested this because VirtualT doesn't support cassettes. For the use with a cassette `PI.BAS' must be modified, you need to replace LOADM with CLOADM.
It is the 8085 code which uses the additional 8085 instructions. I use the Z80 assembly so these instructions are
Code:
SUB HL,BC
RL DE
SRA HL
LD DE,HL+byte
LD DE,SP+byte
LD (DE),HL
LD HL,(DE)
RSTV
JP X5,label
JP NX5,label
VirtualT has a bug which sets the carry flag incorrectly after `SRA HL', I had to fix it. CloudT has bugs too, I haven't fix them. I also try MAME but it supports only WAV-files for cassettes, I don't know how to use this. :(
It is possible load and run `CALCPI.CO' without `PI.BAS', after loading it type
Code:
CLEAR0,36080
CLR:CALL36096
This should show 100 digits of the pi without timings.
It seems that VirtualT is not very accurate with timings. Therefore please help me get better data. Please run pi-spigot for me with your hardware for 100, 1000, and 3000 digits. The screen output is very slow for Tandy model 100. Please type `CLR:RUN' not just run to get better results. Thank you.
Yes, but you need an unreleased version of VirtualT. I have that "pre-release" version myself for development.
All of the files are available now to get the VirtualT setup running.
So, for timing, I guess you want to detect start and stop time?
There are also 8 undocumented opcodes in 8085, some of which are very useful. There might be some speed up possible.

Can I get this "pre-release" version? You know I have fixed a bug in the released one.
 

Attachments

  • tandy100pi.zip
    1.5 KB · Views: 1
Ok cool, I will PM you. lets get the bug communicated to the main author Ken.
Looks like you have made some programs for use with standard Model 100. Easy to run. Will do.
The CP/M variant can use an external LCD display which takes care of scroll, and so will be faster.
If you want you can tell me what file in VirtualT has the change and I can submit it.
I can also send you what I am using to operate CP/M on Virtual T. again - PM.
Steve
 
I'm working with PI-80G on my Altair 8800c.

Yesterday, I successfully ran 100, 200 and 500 digits, and I notice that the program takes a bit longer to get started printing out the 4 digit sequences, and longer in between sequences, for more requested total digits. Then, I decided to try for the maximum 7232, as indicated by the input message. The program took quite a while to print out the first 4 digit sequence, and then slowly prints out subsequent sequences. I manually stopped the program after letting it work for over 4 hours.

Question: If the program is running, attempting to print out the maximum number of digits allowed, does that mean that given enough time the program will successfully finish? I would hate to let the program churn away for 6 or 8 hours and then have it crash because for whatever reason it cannot actually finish.

TIA

smp
Thank you very much.
It should work for all the digits it claims. The time of calculation depends quadratic on the number of digits. Therefore if 1000 digits require 400s then 7000 digits require 19600s ≈ 5h30m.

Ok cool, I will PM you. lets get the bug communicated to the main author Ken.
Looks like you have made some programs for use with standard Model 100. Easy to run. Will do.
The CP/M variant can use an external LCD display which takes care of scroll, and so will be faster.
If you want you can tell me what file in VirtualT has the change and I can submit it.
I can also send you what I am using to operate CP/M on Virtual T. again - PM.
Steve

Hope to get results soon. ;) I have fixed file `do_instruct.h', ASHR (SRA HL) instruction code. I have changed line
Code:
i = L & CY;
with
Code:
i = L & 1;
.
 
For the development of a version for CP/M, I need to know are timer interrupts active with CP/M? Do they use RST to 0x003C?
 
Pi calculation times for TRS-80 Model 100:
100: 3.25391
300: 27.09375
1000: 291.57813
3000: pending

Running in BASIC, 32k RAM, 80C85@ 2.4576MHz
 
Pi calculation times for TRS-80 Model 100:
100: 3.25391
300: 27.09375
1000: 291.57813
3000: pending

Running in BASIC, 32k RAM, 80C85@ 2.4576MHz

Thank you very much. The number for 3000 digits is very important. Did use CLR before RUN? The Tandy 100 scrolling is fantastically slow.
You know I also gather screenshots of results. So if it is possible please make one for me. Thank you
 
Thank you very much. The number for 3000 digits is very important. Did use CLR before RUN? The Tandy 100 scrolling is fantastically slow.
You know I also gather screenshots of results. So if it is possible please make one for me. Thank you

I did use CLS:RUN...

Pi calculation times for TRS-80 Model 100:
100: 3.25391
300: 27.09375
1000: 291.57813
3000: 2563.17188

Running in BASIC, 32k RAM, 80C85@ 2.4576MHz

TRS80mod100_1.jpg
TRS80mod100_2.jpg
 
I did use CLS:RUN...
Pi calculation times for TRS-80 Model 100:
100: 3.25391
300: 27.09375
1000: 291.57813
3000: 2563.17188
Running in BASIC, 32k RAM, 80C85@ 2.4576MHz
Thank you very much.
I have checked screenshots - all digits are correct. This also proves that my emu correction has been right. ;)
The tables - https://litwr2.github.io/pi-spigot-benchmark/pi-spigot-benchmark.html - are updated.
The results show that for the 8085 is about 15% faster for pi-spigot than the 8080 but the Z80 is faster than the 8085 for about 20%. Maybe this Z80 noticeable advantage caused by slow scrolling of the Tandy 100. So I have attached files `PINT.BA' and `CAPINT.CO' which don't print digits of the π, they print just timing. Please run it for 100, 1000 and 3000 digits (maybe only 100 and 1000 will be enough) - no CLS required. :)
I also have some doubts about timings. The emulator is very inaccurate here. Could you check with a stopwatch the timings for 300 digits (it is better to use a version which outputs digits)?
Meanwhile I have made a version for the Tandy 100 CP/M (pi-8085.com). I can't test it so it can crash the system. It uses a vector at 3eh for the interrupt redirection. Indeed I am waiting for results (100, 1000, 3000 digits; max number of digits; a screenshot) if it works properly. It is also worth to use a screen clear before its run. Please check also timings with a stopwatch for 100 or 300 digits: documentation says that it is possible to set the timer with different frequency...
 

Attachments

  • tandy100-news.zip
    3 KB · Views: 1
Back
Top