Results 1 to 9 of 9

Thread: the smallest fpc program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    does FPC not remove unused code, variable and consts?

    in my assembler/compiler, i have include 10,000 lines of code, and if my main file does nothing it will be the minimum exe size, why does FPC use 30kb that is ridiculous....

    in ziron, even a messagebox app is 2kb

    Code:
    program WIN32GUI 'Test';
    
    #include 'kernel32.zir';
    #include 'user32.zir';
    
    MessageBox(0, 'Hello World!', 'Hello', MB_OK);
    
    ExitProcess(0);
    I'd be interested in what FPU adds so much to the exe to be 30kb!!!!!!!! :O

    the minimum size note on windows (PE) is 1kb, since you need 512 bytes for headers and 512 for your code.

    Code:
    program WIN32GUI 'Test';
    
    #include 'kernel32.zir';
    #include 'user32.zir';
    #include 'strings.zir';
    #include 'gdi32.zir';
    
    function Unused1() {
    	#repeat 100000:
    		eax = eax;		//useless code to make the exe huge :) (not really since it will be discarded)
    	#end
    }
    
    MessageBox(0, 'Hello World!', 'Hello', MB_OK);
    
    ExitProcess(0);
    this compiles with an equiv of 101873 lines of code and is still only 2kb, i can add error checking too which takes it to 3.5kb......
    Last edited by Colin; 09-11-2011 at 03:35 PM.
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •