flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > C pic compiler macro

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 28 Nov 2008, 18:07
hello fasm, is it possible to do a standard C language compiler using the macroinstruction mechanism to insterpret first the C syntax, and second, change it in PIC hex file.
if possible, how to proceed? read the manual, done, read examples, done, but understand any? nope!

thanks.
Post 28 Nov 2008, 18:07
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 29 Nov 2008, 01:36
I strongly doubt that the macros will be powerful enough to do it. Just try to make a macro that decodes hashes and curly brackets and I think you will see the problem.
Post 29 Nov 2008, 01:36
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 29 Nov 2008, 07:49
revolution,

I have a strong feeling that fasm interpretive layer is Turing-complete, thus it's possible to write fasm source which will compile C source (as usual, file "hello.c" Wink).

edfed,

Selecting wrong tools to solve a problem can easily create unnecessary problems by the way. lex/yacc or back-end for gcc (if you don't want to dive so deep in C, and probably there is one already).
Post 29 Nov 2008, 07:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 29 Nov 2008, 08:10
baldr wrote:
I have a strong feeling that fasm interpretive layer is Turing-complete, thus it's possible to write fasm source which will compile C source (as usual, file "hello.c" Wink).
Perhaps if you use a myriad of load/store/virtual, but it becomes very complicated. I discovered this with the RSA, SHA and RIJNDAEL macros sets. Would it not just be easier to write a stand-alone interpreter in ASM? Or better still, just use GCC, VC, BCC, or any other of the free compilers!
Post 29 Nov 2008, 08:10
View user's profile Send private message Visit poster's website Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 12 Dec 2008, 01:04
revolution wrote:
Or better still, just use GCC, VC, BCC, or any other of the free compilers!


But writing compilers in FASM is alot of fun... Cool
Post 12 Dec 2008, 01:04
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 12 Dec 2008, 02:51
rCX wrote:
revolution wrote:
Or better still, just use GCC, VC, BCC, or any other of the free compilers!


But writing compilers in FASM is alot of fun... Cool
Yes, I agree. And I already suggested that very method. But writing it in fasm macro language would likely have a high frustration/fun ratio.
Post 12 Dec 2008, 02:51
View user's profile Send private message Visit poster's website 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.