6 Replies - 1159 Views - Last Post: 06 October 2016 - 04:29 PM

#1 Philzon  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 07-August 16

CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 11:50 AM

Hello, I've recently started with emulator programming, and after about hours of work, managed to get a "fully" working CPU with its set of register and call stacks; able to read and execute assembly code and some other basics.

Thought a forum would be appropriate for both help and inspiration on my way to a complete emulator. I invite anyone with interests or experience to discuss more about this subject and perhaps anyone got a few words to give.

As you can see below, this is what I managed so far in terms of outputting strings without touching any of the back-end code; with this being more of an accidental discovery on how to actually do it.

http://imgur.com/CI6bg8M

Any thoughts or ideas for implementations? My current goal is to get some sort of RAM module to store values in memory and not only relying on stack and registers.

Let's get the party startin' B)/>

Is This A Good Question/Topic? 1
  • +

Replies To: CPU emulator C++ - ideas and discussions

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5830
  • View blog
  • Posts: 19,876
  • Joined: 05-May 12

Re: CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 11:55 AM

What CPU are you emulating?
Was This Post Helpful? 0
  • +
  • -

#3 Philzon  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 07-August 16

Re: CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 12:10 PM

View PostSkydiver, on 07 August 2016 - 11:55 AM, said:

What CPU are you emulating?


Nothing in particular, just the basics of a regular CPU. I'll emulate a real CPU one day when I get the hang of things.
Was This Post Helpful? 0
  • +
  • -

#4 illNickA  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-August 16

Re: CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 12:17 PM

Hi Philzon.

Interesting topic, I will follow this thread even though I'm quite a beginner at programming; I'm however interested in reverse engineering and might be able to aid you with some information or at least bring some ideas.

A couple of questions:
- Does it only recognise opcode used in the screenshot so far?
- Are you relying on flags only at the moment?

Best regards,
illNickA
Was This Post Helpful? 0
  • +
  • -

#5 Philzon  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 07-August 16

Re: CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 01:00 PM

Most of the basics such as arithmetic operations, jumps, comparisons and some more visible in the picture. As for flags, haven't really thought much about it other than using 1 flag for the comparison, I'll find more use for them later on... at some point :innocent:/>/>

This post has been edited by astonecipher: 07 August 2016 - 01:19 PM
Reason for edit:: No need to quote the post above yours, there is a reply button further down.

Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5830
  • View blog
  • Posts: 19,876
  • Joined: 05-May 12

Re: CPU emulator C++ - ideas and discussions

Posted 07 August 2016 - 06:29 PM

It doesn't look like there are any specific C++ questions being asked here, and it seems like a higher level discussion is sought out. I'm moving this into the C++ lounge.
Was This Post Helpful? 0
  • +
  • -

#7 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1265
  • View blog
  • Posts: 4,979
  • Joined: 09-June 09

Re: CPU emulator C++ - ideas and discussions

Posted 06 October 2016 - 04:29 PM

How many stages is your pipeline? Looks cool, I once created a MIPS emulator a while back. Can't say I ever want to do that again lol
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1