I suppose to write a grammar file for assembly language program by using Java in ANTLR .. but I don't know from where should I start .. and what should I do.. I am lost..

any expert with this subject could help me :(

I have read a lot but actually there is no time for me to read more.. and I suppose to work now before the dead line.. I am afraid :(

it's 3 years ago since I left Uni.. and I just came back to study..

seems I need a lot of help from U ..

the code what should I write the copiler for is :

SUB R1,R1,0
LD R1,R1,1024
SUB R2,R2,0
LD R2,R2,1025
SUB R3,R3,0
LD R3,R3,1023
MUL R1,R2,0
DIV R1,R3,0

Recommended Answers

All 2 Replies

I do not think java can access registers directly , assembly compiler basically convert asembly code to machine instructions , not sure whether java can do it.

I do not think java can access registers directly , assembly compiler basically convert asembly code to machine instructions , not sure whether java can do it.

to make it simply I 've put the register in array and the memory also in array.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.