View Full Version : Cgiasm

06-01-2002, 12:43 PM
I decided to do a fairly big, one-person project for the summer, and I settled on making my own assembler. Makes sense to me that the first step to AI is a program that writes its own code and compiles it, so I'm figuring out how to make compilers and stuff. I'm going to base it on HTML and CGI using geocities ( because they're the only free server I could find that let you write your own code from scratch. Anyway - a couple of questions on compiling ASM (or ASSEMBLING it).
- I have a list of the binary (machine language) equivalents of all the instructions, but how do I enter binary into a file, because the standard is decimal and ASCII, so how? I'll need to specify it in binary (preferrably) and then maybe use a converter to put it into a file in that form, so that it's usabl;e as an executable.
- How would I include the oparands in the code?
- Any volunteers to test it in September?
Any additional advice would be awesome. Thanks.

06-01-2002, 03:30 PM
Creating an assmebler seems like a b*tch of a project IMHO....

I did a little program that works out the binary code to produce a message box at runtime......That fairly simple principal took me a long time to noodle around with......and then I didnt dump anything into an executable....I just held the code in memory and routed a newly created thread in its direction (the code for it is on my website under Obfuscated Hello World).....

If you want info on the executable format for Windows, then look up some tutorials on the PE Format (Portable Executable)......Iczilion's site has a good starter tutorial with links for more info.

Good luck!

06-02-2002, 06:35 PM
Well thanks, but as it turns out, there was actually an explanation of how to do that in the exact same book as I found the list of binary instructions. Anyay - if anyonewants to see it, it'll be at The CGIASM Website (http://www.goecities.com/CGIASM)