CP/M-80 ADA on HPPA linux

For friendly off topic discussion not covered in a forum above.
Forum rules
No politics, please.
Y888099
Posts: 284
Joined: Mon Jul 11, 2016 11:00 am

CP/M-80 ADA on HPPA linux

Unread postby Y888099 » Thu Apr 20, 2017 4:51 am

Do you remember dosbox and dosemu? They provide us a virtual dos machine making us able to run Turbo Pascal even on a RISC machine. I wanted to run a CP/M-80 (z80 driven) ADA compiler on my HPPA workstation, therefore I have recently created a piece of software to do that.

It's called "zoe", written in C, it contains a z80 cpu emulator and a CP/M bios (modified), probably it will be renamed.

Code: Select all

procedure hAllo is
begin
        put("hAllo");
        new_line;
end hAllo;

hallo.ada

Code: Select all

C3600 ada # ls
ada.com  hallo.ada


Code: Select all

C3600 ada # zoe ada.com hallo.ada

Ada Compiler V2.10
Copyright (c) 1981,1982,1983
Supersoft Inc. and Maranatha Software Systems

Ada Phase I (Lexical Analysis)

Ada Phase II (Syntactical/Semantic Analysis)

00000 syntax error(s)

Ada Phase III (Optimization)
252
procedure hAllo is
0 0 0
19 0 0
1 1 1
15 1
15 2

begin
        put("hAllo");
22 hAllo
98
        new_line;
129

end hAllo;
3 1
18 0 0
26
0 optimizations performed

Ada Phase IV (Code Generation)
00051 bytes of machine code generated
Compilation complete


Code: Select all

C3600 ada # ls
ada.com  hallo.ada  hallo.com


linux-hppa2.zoe( cp/m-80.ada.com ( hallo.ada )) -> hallo.com

Code: Select all

C3600 ada # file hallo.com
hallo.com: data

The sys-apps/file tool on Linux doesn't understand "hallo.com" is a CP/M-80 executable.

Code: Select all

C3600 ada # hexedit hallo.com
File: hallo.com                   ASCII Offset: 0x00000000 / 0x0000187F (%00)
00000000  C3 00 02 8B  0C 9A 0C AA   0C B3 0C C2  0C CB 0C D2   ................
00000010  0C D9 0C E8  0C EF 0C CD   32 0F CD 00  00 00 00 00   ........2.......
00000020  00 00 00 00  00 00 00 00   0D C3 FB 0C  00 00 00 00   ................
00000030  00 0C CD 96  00 00 C8 00   7B 0C E6 08  C4 82 11 79   ........{......y
00000040  E6 30 B0 C3  F8 0C CD 32   0F CD B5 0D  C3 FB 0C CD   .0.....2........
00000050  96 0D B0 47  CD BB 0D CD   8B 0D B0 C3  F8 0C CD 96   ...G............
00000060  0D B0 CD 31  0F CD BB 0D   CD AF 0D C3  FB 0C CD 32   ...1...........2
00000070  0F CD AF 0D  C3 FB 0C CD   96 0D E6 28  C4 82 11 79   ...........(...y
00000080  E6 10 B0 C3  F8 0C CD 32   0F CD B5 0D  C3 FB 0C CD   .......2........
00000090  8B 0D B0 C3  F8 0C CD 96   0D B0 C3 F8  0C CD 96 0D   ................
000000A0  E6 08 C4 82  11 79 E6 30   B0 C3 F8 0C  CD 96 0D B0   .....y.0........
000000B0  C3 F8 0C CD  32 0F CD AF   0D C3 FB 0C  CD 31 0F CD   ....2........1..
000000C0  F4 0E CD E3  0E C3 D5 0D   10 27 E8 03  64 00 0A 00   .........'..d...
000000D0  01 00 06 05  21 04 0D 5E   23 56 23 E5  2A DC 11 0E   ....!..^#V#.*...
000000E0  30 7D 93 6F  7C 9A 67 DA   2A 0D 0C C3  1D 0D 19 22   0}.o|.g.*......"
000000F0  DC 11 3A DB  11 B7 CA 44   0D 78 3D CA  44 0D 79 FE   ..:....D.x=.D.y.
00000100  AF 32 58 00  2A 06 00 2B   F9 21 00 00  E5 E5 E5 E5   .2X.*..+.!......
00000110  E5 E5 21 04  00 39 22 A0   18 21 F8 FF  39 F9 21 00   ..!..9"..!..9.!.
00000120  80 E5 21 FF  7F E5 01 FA   FF CD 3B 03  21 01 00 E5   ..!.......;.!...
00000130  21 FF 7F E5  01 F8 FF CD   3B 03 21 00  00 E5 21 01   !.......;.!...!.
00000140  00 E5 01 F6  FF CD 3B 03   21 00 00 E5  21 7F 00 E5   ......;.!...!...
00000150  01 F4 FF CD  3B 03 C3 A4   18 E1 22 34  01 21 00 00   ....;....."4.!..
00000160  E5 E5 C5 2A  A0 18 E5 E5   E5 21 04 00  39 C1 C5 E5   ...*.....!..9...
00000170  21 04 00 09  7E 4F 23 B6   CA 7F 02 46  C3 70 02 C1   !...~O#....F.p..
00000180  70 2B 71 EB  39 F9 2A 34   01 E9 F5 2A  A0 18 11 04   p+q.9.*4...*....
^C


Code: Select all

C3600 ada # zoe hallo.com
hAllo


But it's actually a CP/M-80 executable!

No sense, but it's funny :)

User avatar
commodorejohn
Posts: 562
Joined: Tue Oct 02, 2012 1:22 pm
Contact:

Re: CP/M-80 ADA on HPPA linux

Unread postby commodorejohn » Thu Apr 20, 2017 7:02 am

Ah, cool :) Does it use disk images, or does it provide access to the host filesystem for the CP/M program?
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/SH-09/HS-80/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/M1, Ensoniq SQ-80, E-mu Emax HD/Proteus-2, Casio CZ-5000, Moog Satellite, Sequential Circuits Prophet-600

Y888099
Posts: 284
Joined: Mon Jul 11, 2016 11:00 am

Re: CP/M-80 ADA on HPPA linux

Unread postby Y888099 » Thu Apr 20, 2017 8:02 am

commodorejohn wrote:does it provide access to the host filesystem for the CP/M program?


This one, so it's like a CLI-wrapper to CP/M-80, and you can "embed" CP/M-80 compilers and use them like they were native :)

p.s.
But it fails with Microsoft Basic Compiler, I still don't know why. Sounds odds. It has success with Supersoft Inc && Maranatha Software Systems ADA Compiler, and with HI-TECH C COMPILER

Code: Select all

10 PRINT "hAllo"

hallo.bas

Code: Select all

C3600 ~ # zoe /opt/cpm-80/m-bascom/mbascom.com hallo.bas
       tm
Microsoft BASIC Compiler Version 5.4
Compilation aborted


Code: Select all

int main()
{
    puts("hAllo");
    return 0;
}

hallo.c

Code: Select all

C3600 ~ # zoe /opt/cpm-80/CC-HT/c.com hallo.c
bind /opt/cpm-80/CC-HT/lib
head /opt/cpm-80/CC-HT/inc
HI-TECH C COMPILER (CP/M-80) V3.09
Copyright (C) 1984-87 HI-TECH SOFTWARE


Code: Select all

C3600 ~ # zoe hallo.com
hAllo


I am afraid it still needs some work.



BTW, let's face it: Ada is huge! Stuffing all of Ada's features into a Z80 processor would be like trying to pour Lake Michigan into a bathtub :lol:

User avatar
commodorejohn
Posts: 562
Joined: Tue Oct 02, 2012 1:22 pm
Contact:

Re: CP/M-80 ADA on HPPA linux

Unread postby commodorejohn » Thu Apr 20, 2017 9:34 am

Ah, sweet :D Do share the code when you've got it all sorted out - there's a handful of CP/M emulators out there, but the only ones I'm aware of that provide transparent access to the host filesystem are DOS-only.
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/SH-09/HS-80/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/M1, Ensoniq SQ-80, E-mu Emax HD/Proteus-2, Casio CZ-5000, Moog Satellite, Sequential Circuits Prophet-600

Y888099
Posts: 284
Joined: Mon Jul 11, 2016 11:00 am

Re: CP/M-80 ADA on HPPA linux

Unread postby Y888099 » Thu Apr 20, 2017 9:39 am

Sure :)

User avatar
johnnym
Donor
Donor
Posts: 88
Joined: Sun Sep 04, 2016 9:53 pm

Re: CP/M-80 ADA on HPPA linux

Unread postby johnnym » Thu Apr 20, 2017 10:04 am

Y888099 wrote:BTW, let's face it: Ada is huge! Stuffing all of Ada's features into a Z80 processor would be like trying to pour Lake Michigan into a bathtub :lol:

Oh geez, I hoped I could run that on the Amstrad PCW 8256 of my dad, although I'd still would have to get it on a 3" not-that-floppy disk. :lol:
:Indy: :O2: :Octane: :Octane2: :O200: = :O200: - :O200: = :O200: (O200 cluster w/2 GIGAchannel cabinets)
[ ( hp ) ] c3000 (dead) c3700 c3750 c8000 :hpserv: (J5600) rp2470 :rx2600: (rx2620) rx4640
| d | i | g | i | t | a | l | AXPpci33 AlphaStation 200 4/166 AlphaStation 255 300 Personal Workstation 500au AlphaServer DS20E
C O B A L T Qube 2 Qube 3 RaQ RaQ 2 RaQ 4r RaQ XTR


Return to “Everything Else”

Who is online

Users browsing this forum: Shiunbird, Yandex [Bot] and 1 guest