Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing an assembler , need help [closed]

I'm writing an 8086 assembler for a college project . I've gone through some material on compiler design on the internet and am reading the 'dragon book' of compilers . But the problem is I couldn't find much about the assembling (generating object code) part here . Are there any good books or links for assembler design . Where do I start ?, I've gone through lexical analysis,parsing and intermediate code generation .

like image 515
abc def foo bar Avatar asked Feb 04 '23 03:02

abc def foo bar


1 Answers

Can you just punt and generate a .COM file? It is loaded into a code segment at :0100 and executed with CS, DS, ES, and SS all pointed to that segment.

If you could do that, then generating code gets a LOT easier.

Your test program would be simple

mov dx, 110
mov ah,9
int 21h
mov ax,4c00
int 21

at address 110:
"Hello, World!" 0d 0a 24
like image 128
Mike Warot Avatar answered Feb 05 '23 20:02

Mike Warot