tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Hello!


From: Milutin Jovanović
Subject: Re: [Tinycc-devel] Hello!
Date: Sun, 8 Apr 2012 22:32:41 -0400


Hi Jakob,

Let me digress a little. I saw Notch's new baby, and it does seem very interesting. I thought of doing exactly what you did as well. But then I realised one thing. DCPU is a very limited, both in memory and instructions. Also Notch started talking about instrustion cost. This is all starting to sound to me that heavy optimization will be the name of the game. Do you feel that you can introduce Instruction cost based optimization into tcc? This is the main reason I decided not to go this route.

A big plus on the other hand is that this would allow me to get to know innards of tcc much better, which I think would be big plus.

Your thought, if any?

Miki.

On Friday, April 6, 2012, Jakob Bornecrantz wrote:
Hello everybody!

I and a friend is trying to add support in TinyCC for the dcpu[1, 2],
we have gotten a little bit on the way and are able to emit function
prologe and math arithmetics.

We are currently using "-Wl,-format=binary" and "-c" to get out binary
data from it and have hacked in assembler output as well.

When I try without the "-c" flag I see it trying to link to crt1.o and
crti.o as well as a couple of standard libraries afterwards.

I'm wondering if it is possible to only get it to link with only
crt1.o and no standard library and then hack it to make _start be
located at 0x0 as a way to just get something slightly more proper and
that supports multiple C files?

Without -Wl,-format=binary it also looks like its outputting i386-efl
object file?

I'm guessing here but it looks like I should be able to write a
crt1.c[3] and compile that into a "i386-elf" and finally make the
linker output a binary.

I'm sorry if this email is a bit over the place. Thanks for any advice
you can give.

Cheers, Jakob.

[1] http://0x10c.com/doc/dcpu-16.txt
[2] http://0x10c.com

[3]
int main(int argc, char** argv);

void _start()
{
   // Stack starts in the correct place.

   // Setup arguments.
   char* argv[2] = {
       "<APP>",
       NULL,
   };

   // main expects two arguments.
   main(1, &argv);

   // XXX Syscall to return result.
}

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


--
Miki.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]