How make a program transfer asm to hex

Status
Not open for further replies.
So you want to write a compiler?

First write a disassembler.

Then write an assembler.

Then write a linker. Better yet, save yourself the trouble and learn to use an existing one.

Then write a parser and a lexer. Learn to make them work together. (Look into flex and bison: The LEX & YACC Page )

Then, use the parser and lexer to interpret the source code, write a compiler to compile their output into assembly, run it through the assembler to generate your object code, and then run it through the linker to link any libraries or other dependencies.

Compiler writing is not simple. Learn to use compilers first (gcc is a good one to use for this; Visual <whatever> hides too much of what's going on for you to get a grasp of the actual usage).


Torben
 
Last edited:

Sorry l mean assembler
but let me understand how disassambler work

So you want to write a compiler?

First write a disassembler.

Then write an assembler.

Then write a linker. Better yet, save yourself the trouble and learn to use an existing one.
Torben

We have an existing disassembler which Nigel Goodwin gave it to me
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…