Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Making a compiler which produces EXE files

Making a compiler which produces EXE files

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jsmawais
    wrote on last edited by
    #1

    Hi. I know how to write an interpreter which can execute a program written in my own language. I want to know how I can implement the functionality so that the program can be made an independent EXE file which will run without the need of an interpreter. (Just like the VC++ compiler&linker do). Waiting 4 reply.

    T M D 3 Replies Last reply
    0
    • J jsmawais

      Hi. I know how to write an interpreter which can execute a program written in my own language. I want to know how I can implement the functionality so that the program can be made an independent EXE file which will run without the need of an interpreter. (Just like the VC++ compiler&linker do). Waiting 4 reply.

      T Offline
      T Offline
      Themis
      wrote on last edited by
      #2

      It's A LOT of work. First of all you need to produce assembly which of course should be machine-dependent, meaning that you should produce a different instruction set for each different machine. Assembly in x86 CISC architecture is quite chaotic. Then you either need to create a linker or use one that already works in order to make that assembly into binary code. I 've tried that for the SPARC (RISC) architecture. In order to produce the proper assembly you really need to know a lot about the CPU architecture and read the manufacturer's manuals carefully. Good luck should you try anything like that, Themis

      1 Reply Last reply
      0
      • J jsmawais

        Hi. I know how to write an interpreter which can execute a program written in my own language. I want to know how I can implement the functionality so that the program can be made an independent EXE file which will run without the need of an interpreter. (Just like the VC++ compiler&linker do). Waiting 4 reply.

        M Offline
        M Offline
        moliate
        wrote on last edited by
        #3

        I think the easiest way to do that would be to generate code in an intermediate language, like C. Then you can compile and link using standard tools. In addition you'll take advantage of the optimization of the intermediate compiler that way. /moliate


        The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.

        Neil Gaiman - Cold Colours

        1 Reply Last reply
        0
        • J jsmawais

          Hi. I know how to write an interpreter which can execute a program written in my own language. I want to know how I can implement the functionality so that the program can be made an independent EXE file which will run without the need of an interpreter. (Just like the VC++ compiler&linker do). Waiting 4 reply.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          You'll need to become intimately familiar with the PE file format.


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups