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. The Lounge
  3. Could you compile a program manually?

Could you compile a program manually?

Scheduled Pinned Locked Moved The Lounge
c++question
43 Posts 26 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.
  • M Member 110323

    Ah, the memories! First did this when my computer had a 16 bit address bus and 8 bit op-codes and a total of 4K of RAM. Then I discovered there was something called a "compiler" and haven't had the urge to engage in this kind of masochism since.

    R Offline
    R Offline
    Roger Wright
    wrote on last edited by
    #41

    Good choice! Unfortunately, when those specs were current, I didn't have a lot of choice. I could write an operating system and assembler, or I could watch a box of electronic components grow old and useless without actually doing anything. In the end, I did what was needed, wrote an OS and assembler in machine code, and pressed into paper tape form for posterity, then got a real job. It was fun, but I wouldn't care to do it again.

    Will Rogers never met me.

    1 Reply Last reply
    0
    • B Brandon X12000

      It would help be able to do anything, just think how useful it would be. You would be able do anything just about any computer or machine, and what you program, works on about almost any piece of hardware, when you boot it. Like all of a suddenly the C language dies.

      Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison

      I Offline
      I Offline
      irneb
      wrote on last edited by
      #42

      It would help be able to do anything, Nope, you would basically only be able to do what you already can using assembly. Though you might be able to get at some accidental error in the CPU's hardware. But that's probably undocumented. just think how useful it would be. Perhaps, though I'm not to sure about "Useful for what?" Crashing a CPU through using some code which is not designed to do something "useful". You would be able do anything just about any computer or machine, Definitely NOPE! You'll need to learn each and every family of CPU's machine codes. Unless by "any computer" you mean "only those with (say) the x86 instruction set. and what you program, works on about almost any piece of hardware, when you boot it. Again: Definitely NOPE! Again unless you mean only one set of CPU's are allowed, and even then only if the rest of the hardware is not too different from your original machine (e.g. a different GPU, other HDD connection type, etc.) Like all of a suddenly the C language dies. I don't think the C language would die due to this. If that was reason enough to kill C, then assembly would have done so long ago. And yes, machine code was the programming language at one time. You needed reams of operators to turn on/off banks of switches to perform the simplest of tasks. Then ASM was "invented" to make life easier for the programmer - so (s)he could remember something like "MOV" instead of C6(11000110) as the "instruction" to move (copy) data from one location to another. And then higher level languages like C was invented when it was noticed that programmes used the exact same group of asm instructions time and again (i.e. something like check value, goto,...) What you're after seems to be a reversion back to how it was in the 40's & 50's.

      1 Reply Last reply
      0
      • B Brandon X12000

        Is there some way to process a source-to-executable like a computer by hand? If so, could you point to some documents? Could you also compile a device driver source to ".sys" or ".vxd" (depending whether you are developing for a non-NT or NT Windows operating system)?

        Simple Thanks and Regards, Brandon T. H. Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst). Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison

        C Offline
        C Offline
        cpkilekofp
        wrote on last edited by
        #43

        I've actually written a program purely in machine code. When it was run, it shut down and restarted my DOS system. I also had some coursework in programming languages, automata theory, and computer semantics. As far as getting books on the subject, well, you've heard of porting a program from one language to another? That's one form of manual compilation, if you aren't interested in duplicating exactly what the computer did. If you're trying to duplicate exactly what your favorite compiler did, forget it: you're free to see the sauasage, but the compiler makers do things that aren't necessarily in the books to make their products work "better" than their competitors', and they don't publish those tricks. Otherwise, type "compiler development" into your favorite search engine and see what pops out. Mind you, in order to do this you'll have to either create or locate a grammar for the language you plan to use, preferably one written in some version of Backus Normal Form (BNF) grammar symbols. When you're done, perhaps you could write another book? Thanks in advance :)

        "Seize the day" - Horace "It's not what he doesn't know that scares me; it's what he knows for sure that just ain't so!" - Will Rogers, said by him about Herbert Hoover

        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