News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_NewsBot

NoRecess - PhrozenC's manual available as download link

Started by NewsBot, 10:00, 12 January 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NewsBot

PhrozenC's manual available as download link
12 January 2011, 3:10 am

I made available as a download link the PhrozenC's manual I wrote. It's about 36 pages to explain how to use the compiler and its dedicated small library for the Amstrad CPC. As a reminder, PhrozenC is a K&R C compiler running on Amstrad CPC platforms (64Kb/128Kb/ROM). Phreaks demo has been created using it.

Source: NoRecess {the website} - Blog

This content has been fetched from a third-party page feed.

TFM

Hi NoRecess,

This manual is pretty cool work! Thank's a lot.

Now a question: If I read right, then PhrozenC always creates code beginning at &4000 (means ORG &4000 command in generaed Z80 source-code). Is it possible to change to another ORG, like &0100 for example?
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

norecess

Thank you for your input.


PhrozenC is outdated. I recommend SDCC over it.


The main advantage of PhrozenC was being able to run on a real CPC.. since then, I learnt a lot and I know it could have been much better implemented. First, I would have compiled PhrozenC.... not by PhrozenC itself like version 1.X, but with SDCC instead. Second, I would try to make PhrozenC a real ROM (cf. compiler executed directly from ROM) - it would have been a perfect developer dream for the CPC.


Unfortunately, only me used PhrozenC (Phreaks was created with) and I saw little interest from others to use it (only Optimus actually gave it a serious try, but he finally accepted to follow my advice and used SDCC instead).


Oh, to answer your question - yep, in latest released version generated code is always &4000. It sucks, as there is no special limitation to hardcode this..


So yes, basically, that's it : I could create the uber ROM of SmallC compiler, unfortunately I don't see any big demand for it so ...

TFM

Thank's a lot of your detailed Answer.

Yes, there is SDCC, but *honestly* it's main disadvantage is (like you mentioned) that it doesn't run on a CPC.

I mean which sense does it make that I need another system (PC), just to be able to program for my CPC? If I need a modern system anyway, then I can switch completely to the PC and leave the CPC.
Well, the CPC is a reliable and stable system, therefore I stay with it - in contrast to the PC!
(Oh.... that's dangerous... it becomes a philosophical discussion.... so back to the topic).

Since you now know about all that things you mentioned in you posting, it would be absolutely great if you could release a new version of PhrozenC !!!

Don't care if (seemingly!) only few people use it. Usually there are much more people using it, and they all just stay silent and just use it. Further, the CPC szene is a bit small, so don't expect too much. The experiences you made with the "number of users" is a CPC thing. Even Prodi made similar experiences with his OS, and it did disappoint him a lot. But that's not the way we should look at it, because CPC is CPC and it's scene is what we make out of it :)


Coming back to the ORG thing... Is it possible to change "ORG &4000" by hand to "ORG &0100" for example? Or will that crash the system. I could try it, but even if it would work, it wouldn't tell if there are some circumstances it will not work.


Now, after the translation of OP to german (and a lot of other stuff) I have finally some time to work with PhrozenC - and I think it's quite fascinating! Especially since it does run on a CPC! The only (real) alternative I know it the Small C compiler for CP/M (disregarding Aztec-C, Arnor-C, and so on...).

A real cool C for CPC would be IMHO something like SDCC on the CPC! It should fit in 128 KB. But probably this would mean a LOT of work!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

norecess

Another cons about PhrozenC :

       
  • No optimizations. PhrozenC (SmallC) actually does a line-by-line C-to-asm direct translations. This produce inefficient code and also generate code that takes lot of memory.
  • K&R. Not being an ANSI C compiler is actually a no-go for regular code porting (and more)
So basically.. that's it. It's very low priority to me.


That said, thanks for your interest  :)


MaV

Ok, one word from a lurker.


I'll be testing PhrozenC for sure, it may take a bit time at the moment, though. I also like the manual. It helps with the first steps.

Yes, it doesn't have optimizations, and it's not ANSI C. But it's a start.

A PhrozenC in ROM would be great. It'll work much faster there. And I'll place it in the upcoming MegaFlash for sure. :) Of course, SDCC on the CPC might be better, but I can't imagine someone doing that job.

As TFM suggested, moving the org to a lower address will make the compiler more useful. Hm, why not &40? I don't like &100. It is cp/m's starting address, but we're talking about AMSDOS.

So why will I use PhrozenC?

       
  • It's a quicker way to test more complex algorithms ON the machine.
  • Most people here tell others to test programs on a real machine.
  • I don't want to swap constantly between PC and CPC when compiling programs (as I would with SDCC), if I want to test on a CPC.
  • I'd also have to constantly change position to program on the PC, then test on the CPC.
  • I want to refresh my rusty C knowledge.
  • I have a CPC (well, more than one). It bloody well should be used the way it was intended.
  • If I cannot use a C compiler, I'd have to resort to Turbo-Pascal as a high level language.
  • I'm a retro guy and I want my 80ies back!
Phew! Convinced? ;)
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

redbox

Yep, PhrozenC is very interesting to me as well as I too like coding just on the CPC. 

I've always wanted to learn a C style language and also it's interesting as a quick way to try out routines and also see the ASM it generates.

So please don't abandon it!

norecess

K guys I'm keeping your comments in mind.. but know that HxC and QuickCMD are currently higher priority  :)


And also, my time is going to drastically be reduced soon so, ..


About the org thing, it could have been easy from me to let the programmer choose for its own value.. anyway.

TFM

Quote from: norecess on 20:01, 11 August 11
About the org thing, it could have been easy from me to let the programmer choose for its own value.. anyway.

Alright, so we can change it by hand. Fair enough ;-)

BTW: HxC and QCMD work already well :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod