PDA

Click to See Complete Forum and Search --> : More Machine Code


Sam Finch
Oct 29th, 2000, 09:58 PM
OK, in my quest to write a compiler I've found this

http://www.ece.uiuc.edu/ece291/class-resources/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.

Edwin_Drood_1870
Nov 14th, 2000, 03:32 AM
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.

Sam Finch
Nov 14th, 2000, 11:28 AM
Yeah, I got that much of it, Picking up some books is probably the best way about it, thanx.

parksie
Nov 18th, 2000, 12:18 PM
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.

Sam Finch
Nov 18th, 2000, 12:35 PM
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.