CPCWiki forum

General Category => Programming => Topic started by: funkheld on 21:39, 19 November 19

Title: Phrozen C
Post by: funkheld on 21:39, 19 November 19

hello, I have looked at this phrozentc.
makes a good impression. I like it.
can one of the source code from the program on the pc slices and then transferred to phrozentc on the Javacpc?


Thank you.
greeting
Title: Re: Phrozen C
Post by: funkheld on 22:21, 19 November 19

Hi good afternoon.


I plugged in the PhrozenC.rom and started with | cc
then a program loaded.
shortly thereafter it crashes without compiling.


have you ever tried a rom?


Thank you.
greeting
Title: Re: Phrozen C
Post by: funkheld on 22:35, 19 November 19

I have maxam in it too.
still crashes.
greeting
Title: Re: Phrozen C
Post by: AMSDOS on 09:52, 20 November 19
Quote from: funkheld on 22:21, 19 November 19
Hi good afternoon.


I plugged in the PhrozenC.rom and started with | cc
then a program loaded.
shortly thereafter it crashes without compiling.


have you ever tried a rom?


Thank you.
greeting


I have been using the ROM version which has been working fine for me, though following the instructions from the Manual you can use |cc,"example1.c" to compile the code. If it doesn't work, then there maybe something wrong with the ROM.  :(
Title: Re: Phrozen C
Post by: funkheld on 11:09, 20 November 19

Hi good afternoon.
I have now renounced from Pascal.
I tested this:


https://ccz80pp.webcindario.com/ccz80pp-en.html (https://ccz80pp.webcindario.com/ccz80pp-en.html)


wonderfully simple, small ASM code and fast in execution.
For me as a 70 year old I like this language.
I like programming in cros.


greeting
Title: Re: Phrozen C
Post by: norecess464 on 15:26, 21 November 19
Please note that I don't provide any support on PhrozenC, it's a dead project with remaining bugs, I don't recommend using it anymore.
I highly recommend using a cross-compiler like SDCC on PC to use C programming language on the Amstrad.

Best regards
Title: Re: Phrozen C
Post by: GUNHED on 18:25, 21 November 19
Quote from: norecess on 15:26, 21 November 19
Please note that I don't provide any support on PhrozenC, it's a dead project with remaining bugs, I don't recommend using it anymore.
I highly recommend using a cross-compiler like SDCC on PC to use C programming language on the Amstrad.

Best regards


Well, all that PC stuff is nice for sure. However, as CPC users lots of us would love to have something up and running on the real machine. Maybe PhrozenC can be open source of something like this (or is it already?). If you don't suggest to use it, what could be used instead on a CPC?  :)
Title: Re: Phrozen C
Post by: norecess464 on 19:31, 21 November 19
Feel free to fork PhrozenC, sources are available here: https://github.com/norecess464/PhrozenC

Title: Re: Phrozen C
Post by: AMSDOS on 21:45, 21 November 19
Quote from: norecess on 15:26, 21 November 19
Please note that I don't provide any support on PhrozenC, it's a dead project with remaining bugs, I don't recommend using it anymore.


You don't recall what remaining bugs there are?
I understand that being based on Small-C there will be limits from the other PC Cross-Compilers and it won't compile Commercial Quality software, at the moment though I only have some routines from Small-C which work on Phrozen C to produce random numbers and I've added some extra routines from the firmware for joystick control, redefining characters, basic scrolling, it's BASIC stuff, but at least it's more usable than some of the other Pascal Cross-Compilers I've seen.


Quote
I highly recommend using a cross-compiler like SDCC on PC to use C programming language on the Amstrad.

Best regards


I had a look at z88dk, which was updated recently, but the whole package seems to be missing a document titled "Lets get you up and running on Z88DK for your CPC".  ???  But, but, but I don't know how anyone can make sense of all that and I was still able to get Python up and running on my Mac!  :o
Title: Re: Phrozen C
Post by: norecess464 on 15:11, 22 November 19
QuoteYou don't recall what remaining bugs there are?
Not exactly "bugs", but there are remaining improvements to provide for sure.
The CPC version of PhrozenC that generates ASM files with static address for compilation. Address should be configurable, not fixed.Also, the compiler is not ANSI C but K&R one (the syntax is really challenging nowadays).Finally, note that the SmallC does absolutely no effort to optimize. Compiled code quickly takes a large amount of memory even for a small portion of C code.
Title: Re: Phrozen C
Post by: GUNHED on 18:02, 22 November 19
Quote from: norecess on 15:11, 22 November 19
note that the SmallC does absolutely no effort to optimize.
Well, I have a Small C for CP/M Plus which is executing an optimizing tool after compilation and before optimization. Seems to work quite well. Maybe this can help. The DSK was uploaded before.   :)


The Phrozen C is still a great thing and I totally understand that people like it.  :)
Title: Re: Phrozen C
Post by: funkheld on 18:11, 22 November 19

Hi good afternoon.


with which compiler are the asm under windows10 compiled please?
phrozenc

Thank you.
greeting
Title: Re: Phrozen C
Post by: norecess464 on 19:22, 22 November 19
Quotewith which compiler are the asm under windows10 compiled please?
phrozenc
Sorry I'm not sure to understand, please can you reformulate ?
Title: Re: Phrozen C
Post by: funkheld on 21:19, 22 November 19
with which compiler for the asm can one please compile.


asm from Phrozen C programm.


greeting
Title: Re: Phrozen C
Post by: AMSDOS on 22:07, 22 November 19
The RASM Z80 Assembler (http://www.cpcwiki.eu/forum/programming/rasm-z80-assembler-in-beta/msg141788/#msg141788) should work for you.


@GUNHED (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2029) are you are referring to the Mike's Enhanced Small-C Compiler for CP/M (http://www.cpcwiki.eu/forum/programming/mescc-mike's-enhanced-small-c-compiler-for-cpm/msg108181/#msg108181) made by @FloppySoftware (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1162) ?


@norecess (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2409) so the Assembly source code produced has to remain at &4000. I think CPC BASIC 3 is the same, though CPC BASIC 3 produces some very optimised code. It's one of the few Cross Compilers I can use, unfortunately it mimicks Locomotive BASIC a lot, while there are differences. A really good Manual documentating it's use (not a webpage just noting the differences with Locomotive BASIC) would be a great help and reference.
Title: Re: Phrozen C
Post by: GUNHED on 13:47, 23 November 19
Gosh, too long ago that I used it, need to browse my DSKs as soon as I have a bit time.
Title: Re: Phrozen C
Post by: funkheld on 17:57, 24 November 19

Hi good afternoon.


how can you please compile an asm with maxam1.5 rom?
Thank you.
greeting
Title: Re: Phrozen C
Post by: AMSDOS on 10:09, 26 November 19
Quote from: funkheld on 17:57, 24 November 19
Hi good afternoon.


how can you please compile an asm with maxam1.5 rom?
Thank you.
greeting


I maybe wrote, but I think it needs Protext with the Assembly File loaded in that, you can exit Protext and |ASM to assemble. I can't remember if it could compile from File.
Title: Re: Phrozen C
Post by: GUNHED on 21:59, 26 November 19
Quote from: AMSDOS on 10:09, 26 November 19

I maybe wrote, but I think it needs Protext with the Assembly File loaded in that, you can exit Protext and |ASM to assemble. I can't remember if it could compile from File.


READ to read source code
WRITE to write binary code
Title: Re: Phrozen C
Post by: AMSDOS on 09:46, 27 November 19
Quote from: GUNHED on 21:59, 26 November 19

READ to read source code


Yeah, but I don't know if |ASM,"example1.asm" would read in that Assembly file and Compile to Memory, or if it only works when the Assembly file has been loaded in Protext, which was how I used to Compile when using Maxam 1.5.
Title: Re: Phrozen C
Post by: GUNHED on 11:52, 27 November 19
Quote from: AMSDOS on 09:46, 27 November 19

Yeah, but I don't know if |ASM,"example1.asm" would read in that Assembly file and Compile to Memory, or if it only works when the Assembly file has been loaded in Protext, which was how I used to Compile when using Maxam 1.5.


IMNO Protext should contain at lease one line:


READ"source


But you can just try it.   :)
Title: Re: Phrozen C
Post by: zhulien on 01:30, 13 June 25
Quote from: norecess464 on 19:31, 21 November 19Feel free to fork PhrozenC, sources are available here: https://github.com/norecess464/PhrozenC


has the github page moved?
Title: Re: Phrozen C
Post by: norecess464 on 02:40, 13 June 25
I'm not maintaining this project anymore... 2010... but that was fun!
Title: Re: Phrozen C
Post by: zhulien on 08:14, 13 June 25
Quote from: norecess464 on 02:40, 13 June 25I'm not maintaining this project anymore... 2010... but that was fun!
are you ok to pass the source code over to someone else?

btw, what is the benefit of...

ld hl,65536
add hl, sp

vs

ld hl,0
add hl, sp

something to do with flag setup?
Title: Re: Phrozen C
Post by: Prodatron on 13:02, 13 June 25
Quote from: zhulien on 08:14, 13 June 25btw, what is the benefit of...

ld hl,65536
add hl, sp

vs

ld hl,0
add hl, sp

something to do with flag setup?
It's exactly the same  :D
Title: Re: Phrozen C
Post by: norecess464 on 13:34, 13 June 25
As requested, I have just made the repository public (it's now hosted on Bitbucket).

https://bitbucket.org/norecess464/phrozenc/src/master/ (https://bitbucket.org/norecess464/phrozenc/src/master/)

Here is why I lost interest in the project:

Working on improving the two points mentioned above seemed like a massive job -- one that I wasn't able to take on by myself.
Please note that my contribution to this project was limited to porting the existing Small-C codebase to the Amstrad platform and properly repackaging it with RSXs and documentation. I did not write the compiler myself -- that credit goes to Ron Cain, back in the early 1980s.

Still, exploring the internals of a full compiler was a fascinating learning experience. If anyone decides to continue or update the project, please keep this cpcwiki thread going!

Thanks!
Title: Re: Phrozen C
Post by: genesis8 on 20:46, 13 June 25
Is it the v1.1 or was there a newer version ? I checked the PDF documentation, but no mention of version at the start of the file
Title: Re: Phrozen C
Post by: norecess464 on 00:12, 14 June 25
Quote from: genesis8 on 20:46, 13 June 25Is it the v1.1 or was there a newer version ? I checked the PDF documentation, but no mention of version at the start of the file
I can't say regarding the "official" versioning, but I can confirm that this is the most recent version of the codebase I have.
Title: Re: Phrozen C
Post by: zhulien on 09:33, 14 June 25
Thanks, it is really a cool product.
Title: Re: Phrozen C
Post by: GUNHED on 16:43, 15 June 25
Indeed!  :) :) :) And we can use it on CPC - We do not need to buy or use a PC to compile for the CPC  :) :) :)
Powered by SMFPacks Menu Editor Mod