flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Flat C-

Author
Thread Post new topic Reply to topic
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 09 Oct 2017, 16:22
The new FlatC- compiler.
A brief description is given in the file IntroFlatC-.txt.
Not compatible with the compiler. FlatC-- (see https://board.flatassembler.net/topic.php?t=19700).
With some modifications can compile C programs (compare Julia.c- and JuliaWC02.c.


Description:
Download
Filename: IntroFlatC-.txt
Filesize: 7.61 KB
Downloaded: 1390 Time(s)

Description:
Download
Filename: FC-35.7z
Filesize: 84.26 KB
Downloaded: 1387 Time(s)

Post 09 Oct 2017, 16:22
View user's profile Send private message Reply with quote
NEASM



Joined: 13 Apr 2018
Posts: 13
NEASM 23 May 2018, 15:01
You are a genius. Is really a shame that it cannot compile for Linux and Unix.... But, is always great. 10/10, because this compiler is great.
Post 23 May 2018, 15:01
View user's profile Send private message Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 23 May 2018, 21:44
Thank you! However, I am embarrassed by such praise ...
Nix - maybe someday in the future, if I wish.
Post 23 May 2018, 21:44
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 13 Jun 2018, 17:18
Hi bazizmix

Avast anti virus refused to download your FC-35 , it says that it has a virus.

so is that false or not? can you check it please.
Post 13 Jun 2018, 17:18
View user's profile Send private message Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 14 Jun 2018, 10:57
Again?!!! Shocked
revolution wrote:
emil wrote:
my Avast still refuse to accept the zip file.
Time to kill your AV then. It is clearly not working for you. Rolling Eyes

In zip no viruses - checked by Kasperskiy antivirus
Post 14 Jun 2018, 10:57
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 14 Jun 2018, 12:58
Hi bazizmix

I see that you quoted a comment that posted by revolution.

so where is his comment in your topic!!!!!!!!!!!

Avast keep me in safe side of anti virus , and will not change it.

any way , I have no luck with your FC-35.

keep up your good work.
Post 14 Jun 2018, 12:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 14 Jun 2018, 13:04
emil wrote:
Avast keep me in safe side of anti virus , and will not change it.
It also seems to be keeping you safe from non-viruses. The "best" AV would simply be one that never lets you download anything, keeping you 100% safe from viruses ... and non-viruses. Smile

But seriously, how can you trust an AV that gives you this much trouble?
Post 14 Jun 2018, 13:04
View user's profile Send private message Visit poster's website Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 14 Jun 2018, 16:16
emil wrote:
Hi bazizmix

I see that you quoted a comment that posted by revolution.

so where is his comment in your topic!!!!!!!!!!!

Avast keep me in safe side of anti virus , and will not change it.

any way , I have no luck with your FC-35.

keep up your good work.

I checked file on online service https://www.virustotal.com/en
Result you can see at https://www.virustotal.com/en/url/99f94badf2aade2008968571b79dbb18f86ed637ea660cd81fd37865c8e7bed0/analysis/1528992552/
Really Avast stupid...

File name: FC-35.7z
Detection ratio: 4 / 60
Post 14 Jun 2018, 16:16
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 15 Jun 2018, 15:14
Hi bazizmix

I have disabled Avast , and test it.

nice work , have some questions....

1- will you support creating coff object file ? ; may be directive #obj

2- when you will dived your work into include folder, samples folder,.... etc. ?

3- why there is no inline macro ?

4- what do you think for supporting next syntax
Code:
edi = (esi <> 1) ? TRUE : FALSE;    


hope you keep devolping it.

thanks.
Post 15 Jun 2018, 15:14
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 15 Jun 2018, 15:21
Hi again

In Next code

Code:
int WIRandom(int rmin,rmax){
        push rdx rcx;
        mov ecx,[rmax]; sub ecx,[rmin]; inc ecx;
        WRandom();
        xor edx,edx; div ecx; mov eax,edx; add eax,[rmin];
        pop rcx rdx;
}    


why you did not support uses directive so that it will be like that
Code:
int WIRandom(int rmin,rmax) uses rdx rcx
{
        mov ecx,[rmax]; sub ecx,[rmin]; inc ecx;
        WRandom();
        xor edx,edx; div ecx; mov eax,edx; add eax,[rmin];
}    


Last edited by emil on 15 Jun 2018, 18:03; edited 1 time in total
Post 15 Jun 2018, 15:21
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 15 Jun 2018, 18:02
hi

I think there is a bug in next code , it is a part of your fc-- code

Code:
int strlen(char* s)
{
   push rcx rdx;
   rax=s;         // get pointer to string
   rcx=rax;             // copy pointer
   pxor xmm0, xmm0;            // set to zero
   rcx&=15;              // lower 4 bits indicate misalignment    


the last line compiled to this

Code:
 mov rax,rcx                             
 push rax                               
 mov rax,F                               
 pop rcx  
 and rax,rcx  
 mov rcx,rax    
    


so the value of rax is destroyed and the program crashed.
Post 15 Jun 2018, 18:02
View user's profile Send private message Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 16 Jun 2018, 12:02
emil wrote:
hi

I think there is a bug in next code , it is a part of your fc-- code

....
so the value of rax is destroyed and the program crashed.

In start of this topic
Quote:
Not compatible with the compiler FlatC--
Post 16 Jun 2018, 12:02
View user's profile Send private message Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 16 Jun 2018, 12:06
emil wrote:
why you did not support uses directive so that it will be like that

You can use aliasing for this (see IntroFlatC-.txt)
Post 16 Jun 2018, 12:06
View user's profile Send private message Reply with quote
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 14 Nov 2018, 19:04
Hi bazizmix,

why the next code do not compile?

Code:
void RemoveFileExt(char* lpFileName)
{
    push rcx rdx;
        lstrlen(lpFileName);
        rdx = lpFileName;
        while( rax )
        {       
                if( byte [rdx+rax]=='.')
                {
                        byte [rdx+rax] = 0;
                        break;
                }
                rax--;
        }
        pop rdx rcx;
}
    
Post 14 Nov 2018, 19:04
View user's profile Send private message Reply with quote
bazizmix



Joined: 15 Jan 2016
Posts: 51
bazizmix 15 Nov 2018, 08:44
Hi Emil,
Constructions byte[] and similar not supported in FlatC-.
For above code you can use lpFileName[rdx] instead.
Code:
        rdx = lstrlen(lpFileName);
        while( rdx )
        {
                if( lpFileName[rdx]=='.')
                {
                        lpFileName[rdx] = 0;
                        break;
                }
                rdx--;
        }
    
Post 15 Nov 2018, 08:44
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.