I'm afraid you'll have to learn how to program first before you ask this kind of question. It's not a problem with the answer. I can guide you through creating an emulator from scratch, but you won't learn much from it (if at all).
Why the obvious "learn how to program first" respond, you might wonder: Because emulating a system is just like learning how to program for that system... essentially.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10