flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > C++ Compiler in assembly

Author
Thread Post new topic Reply to topic
connor



Joined: 07 Jun 2016
Posts: 79
connor 18 Jun 2018, 05:08
I'm thinking if there is a C++ Compiler written in assembly language somewhere ?

never-mind its limitations; easy to take care of.

_________________
cars tech weed bitches country & thug life
Post 18 Jun 2018, 05:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 18 Jun 2018, 08:40
There might be one somewhere but it is doubtful. Most C++ programmers would like their compiler to be able to compiler itself. And it would also lose the advantage of cross-platform-ness.

But what you could do is take an existing C++ compiler and capture the assembly output of it compiling itself. Then you wold have an assembly version of a C++ compiler. The output would likely be quite ugly from a readability POV.
Post 18 Jun 2018, 08:40
View user's profile Send private message Visit poster's website Reply with quote
connor



Joined: 07 Jun 2016
Posts: 79
connor 08 Jul 2018, 05:07
"take an existing C++ compiler and capture the assembly output of it compiling itself"

How do I set that up & with what?

;I want to try it in windows. and save the output as an asm.
Post 08 Jul 2018, 05:07
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 08 Jul 2018, 09:04
Compilers first generate a low-level version of the code before assembling it into the final product. Some compilers provide a switch for that. GCC and Clang have the -S switch (cc -S test.c -o test for the default AT&T syntax or cc -S -mllvm --x86-asm-syntax=intel test.c -o test (-masm=intel for GCC) if you prefer Intel syntax).

Of course don't expect the output code to look very pretty.

I'm not sure this method will be useful at all with such beasts as modern high-level compilers though.
Post 08 Jul 2018, 09:04
View user's profile Send private message Reply with quote
Alex Scarlet



Joined: 22 Sep 2019
Posts: 1
Location: Silver Creek
Alex Scarlet 22 Sep 2019, 05:55
I'm sold on this idea
Post 22 Sep 2019, 05:55
View user's profile Send private message Reply with quote
connor



Joined: 07 Jun 2016
Posts: 79
connor 31 Dec 2019, 02:10
How about this instead:

A GNU C++ Compiler written in C

_________________
cars tech weed bitches country & thug life
Post 31 Dec 2019, 02:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.