hi and power-c

Started by hannenz, January 13, 2008, 10:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hannenz

first of all, hi there!
i am new to the forum as well as to the c128. i am coming from the c64 and now switching to the 128.
I am quite a "fan" of Spinnaker's Power-C, i did a lot on c64 with this Compiler.
I wrote a new assembler/ disassmebler package which i am right now porting to the 128 (i try to.... ;)
there are some assemblers out there for Power-C I know, i first used the C/ASSM which is so f***ing slow that i decided to write my own one. Then I stumbled upon buddy (power assembler) which is not bad at all but still has some drawbacks: the "bug/ feature" that it requires some extra empty lines at the source's bottom drove me nuts, and expression syntax is - let's say - inconvenient...

lda "a" - without the '#'
doesn't recognize argstk + 1 but wants argstk+1
no brackets, no precedence of operators...

and then not allowing labels alone in a line makes source coes look so damn ugly...

my assembler features:
- conditional assembly
- unnamed labels
- full-blown expression evaluation with precedence, brackets and all you expect!
- assemles multiple source files in one run
- quite fast

the 64er version was written 99% in C with some modules written in Assembler itself - since i couldn't assemble these modules on the 128er i had to rewrite some of those modules back to C again.

The disassembler is quite straight forward and produces PetASCII sources compatible to the assembler.

Then i wrote some command line tools, like

hd - hex dump
wc - word count
grep - ... you know
lib - replacement for lib.sh which is fully command line driven
and a whole lot more...

and last but not least i wrote my own libraries, extending the Power-C libs to some more "standard":

strstr, strchr, strtok, strtol and friends are implemented
some non-standard behaving functions of the power-c stdlib are replaced/ substituted (e.g use read instead of fread which will return the number of bytes read which fread doesn't.... )
then i implemented getopt, which is quite handy for option parsing from command line.
and then again a whole lot more...

another lib, implementing linked lists and stacks is there, too...

I hope I will succeed in porting this whole stuff to the 128er.

Would there be some interest in all this?!
Are there active power-C developers out there...?!

then i need some help too:
while porting my assembler modules i simply changed the runtime stack's location to $400
power-c executables use a relocated 0-page at $1300. Is this in RAM 0 or RAM 1??
I didn't relocate zeropage in my modules and figured out that locations $a0 - $a6 should be quite safe to use as pointers etc. but i am not sure about that - could anyone tell me more about zero page usage... then, when i locate zeropage back to $0000 what locations are safe then beside $fa - $ff?

so, please tell me what you think of all this.


EDIT: concerning the Assembler:
- I need a good name for it, since confusion is much enough with having C/assm sometimes found as "asm.sh" sometimes as "as.sh" then the shell version of buddy is called "as.sh" as well. it should be short and meaningful, i think of smoethnig like "ass.sh" or "az.sh" - your suggestions?
- I think it would be not too much work to modify the assembler to be compatible to buddy's source codes, if you would be interested in that feature...

hannenz

it is done :)
after working the whole day i managed to port as (assembler) and da (disassembler) to the power-c-128 environment!
now with my favorite tools at hand i can start porting the extended library (extlib) and all the command line tools.
when i am done i will upload the whole stuff somewhere so you can have a look at it!

nikoniko

Wow, that's quite a project! I'm sorry to say I haven't given Power C a very thorough look yet, but it sounds like you're putting together some great stuff.

wte

Quote from: hannenz on January 13, 2008, 10:42 PM
first of all, hi there!
i am new to the forum as well as to the c128. i am coming from the c64 and now switching to the 128.
Hi hannez! Nice to see you here ;)
And congratulations for your decision to use a true computer now  =D

WTE

Willkommen im "Club"!

hannenz

yeah - i think the c128 is truely underestimated and it has so much more than just being a c64 with a numeric keypad ;)
i really start loving this machine! but having the good 'ol 6502 instruction set is just cool!

hannenz

Just to keep you informed: i have ported now the extlib library, assembler and disassembler, i think i will have some more time this weekend so i can transfer it all to pc and upload somewhere together with some docs.
i managed to rewrite the modules of extlib so that they assemble both for c64 and c128 depending on one single switch (define) in an include file, using conditional assembly. while porting i fixed some bugs and changes here and there...

i'd really like to know if there are more Power-C users out there. I mean, this is a really great compiler/ shell package which makes developping in C really fun especially on the c128 with 80 columns and the 2mhz. This computer is really READY for C (the c64 isn't, but it still can ;)).
And C is such a beautiful language, don't you agree ;)

so, power-c users of the world: unite & fight! or at least post here that you exist!