Click here to Skip to main content
15,918,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to create mini assembler by change this coding of Motorola MCR68000
to the machine code in c or c++?? please help me.....



ORG $4000
MOVE.B A1,D0
MOVE.B (A2),D1
ADD.B D0,D1
MOVE.B D1,(A1)+
LOOP MOVE.W (A1)+,-(A2)
BNE LOOP
END
Posted
Updated 14-Oct-11 20:52pm
v5

It would be best if you do your own homework. It is given to you so that you will learn something, think about what have been taucht. Read your text books and give it a try.

Once you have code and run into problems you can always come back here with a more specific question and the community will do its best to help you. Don't forget to post only the relevant code bits that pose the problem as a code dump is not usually helpful at all in getting someone to help/assist you.
 
Share this answer
 
If you cannot use tools like lex/yacc (or the cousins flex/bison) then you should write your own lexer and parser. It shouldn't be a daunting task, since assembly is relatively simple (you may find Crenshaw's wonderful Let's build a compiler[^], although dated, useful).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900