|
|
|
|
|
by jermaustin1
2165 days ago
|
|
Instead of outputting c, could you not just output the equivalent assembler? so instead of self.emitter.emitLine("printf(\"" + self.curToken.text + "\\n\");")
you do something like self.emitter.emitLine("STRING DB " + self.curToken.text + "', '$'")
...
self.emitter.emitLine("LEA DX,STRING")
self.emitter.emitLine("MOV AH,09H")
self.emitter.emitLine("INT 21H")
|
|
You said in your other post that this can be done with minor modifications, but I can already foresee a few modifications that would need to be made which aren't minor.
And then there's the problem that you may want to target more than one architecture. We can write two completely different code generators, but it would be nice if there were an architecture that could share some of the code.