Results 1 to 5 of 5

Thread: More Machine Code

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089

    Red face

    OK, in my quest to write a compiler I've found this

    http://www.ece.uiuc.edu/ece291/class...s/opcodes.html

    only trouble is I don't understand a word of it, well I understand some of it, but not enough to translate ASM into machine code which is what I'm trying to do.

    Can anyone offer any hints/sites to aid translation.

  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    62
    I was into this for a little while. The op codes are the machine code translations of asm commands. Depending on the function called, the first four or five digits specify the command and the last signal the var.

    There are books you can find that explain it much easier than that site. I suggest reading up on it.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Yeah, I got that much of it, Picking up some books is probably the best way about it, thanx.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    If you want to write a compiler, take a good look at lex and yacc (Yet Another Compiler Compiler). Any Unix website should have documentation on them. What they do is to accept a Backus-Naur notational grammar syntax formation for your language (there is one for C++), and generate a parser for it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    thing is it's a really specialised language, with lots of wierd bits, so I kinda need the power of writing it myself, I've got the logic of it pretty sorted, it's just the technical details of getting the file to work and learning binary (which doesn't look that hard when you get the hang of it, it's just learning the encodeing notations which is tricky.

Posting Permissions

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



Click Here to Expand Forum to Full Width