Skip to content
  • Facebook
  • LinkedIn
  • Twitter
  • Instagram
Sincere Flattery

Sincere Flattery

  • Sincere Flattery
  • About
  • Contact
  • Blog

Search

Author: jeremy pereira

The Refactoring Results

June 5, 2017June 20, 2017 by jeremy pereira, posted in refactoring

So I completed the refactoring of the instruction decoding to allow two sources and two destinations. I'm pretty pleased with the results.  It's allowed me to completely eliminate several operations from the decoding code. All the jumps, calls and returns (except RETI, which is not implemented yet and RET cc which requires the stack to … Continue reading The Refactoring Results

Leave a comment

Some Refactoring

June 2, 2017June 5, 2017 by jeremy pereira, posted in decoding, Emulation, refactoring

Whilst I was writing my post about instruction decoding, a thought struck me about improving the structure of decoding. In the existing decoder, I do four things: Get the displacement, if needed Get the source operand, if needed Do the operation Save the result to the destination if needed This works fine but the "do … Continue reading Some Refactoring

Leave a comment

Decoding

June 1, 2017June 1, 2017 by jeremy pereira, posted in decoding, Emulation, Z80

The Decoding Table Let us talk about instruction decoding. What is instruction decoding? It is the process of taking opcodes and operands and doing what they tell you. Instruction decoding is the heart of a processor emulation and in mine takes up the vast majority of lines of code. In his blog, Andre Weissflog characterises two … Continue reading Decoding

Leave a comment

These Memories Can’t Wait

June 1, 2017June 1, 2017 by jeremy pereira, posted in Emulation, Z80

Basics Memory access is one of the most critical parts of an emulation. If memory access is slow, the emulation is slow. The Z80 does at least one memory read for each iteration of its fetch-execute loop. I chose to take the same approach as I had with the 6502 emulation, which is to say: … Continue reading These Memories Can’t Wait

Leave a comment

Another Milestone

May 30, 2017June 1, 2017 by jeremy pereira, posted in Emulation, progress, Z80

I’ve made two posts about the design of my emulation so far and we haven’t got very far into the nitty gritty. The actual work, though, is much further ahead. In fact, I’ve got to the first major milestone as exemplified from this log of the most recent run of the zexdoc tests. This tests […]

1 Comment

A Milestone

May 21, 2017June 1, 2017 by jeremy pereira, posted in progress

I've made two posts about the design of my emulation so far and we haven't got very far into the nitty gritty. The actual work, though, is much further ahead. In fact, I've got to the first major milestone as exemplified from this log of the most recent run of the zexdoc tests. This tests … Continue reading A Milestone

Leave a comment

The Fetch Execute Loop

May 18, 2017 by jeremy pereira, posted in Emulation, Z80

If you read any introduction to writing emulators, they all tell you to do the same thing. You write a loop that continually fetches instructions and executes them. Notice that I put the fetch after the execute. Doing so makes certain aspects of the design cleaner such as coming in to the loop first time. … Continue reading The Fetch Execute Loop

1 Comment

Beginnings

April 29, 2017 by jeremy pereira, posted in Emulation, Z80

So I'm building a Spectrum emulation. Having done a 6502, I thought it would be fun to do something different and try to document it along the way. I'm a bit late getting going since the actual work has already progressed quite a way. Objective I want to build a functional emulator for the ZX … Continue reading Beginnings

Leave a comment

Posts navigation

Newer posts

Categories

  • 6502 (3)
  • Armchair Universe (1)
  • C64 (1)
  • Code Snippets (3)
  • Computer Science (4)
  • decoding (2)
  • Emulation (12)
  • Evolution (2)
  • forth (29)
  • L-Systems (2)
  • Lambda Calculus (10)
  • machine learning (2)
  • Metal (3)
  • pandemic (2)
  • Programming (13)
  • progress (4)
  • protocol oriented programming (2)
  • Puzzle cheats (1)
  • refactoring (6)
  • SceneKit (1)
  • Simulation (3)
  • Spectrum (1)
  • Swift (4)
  • Uncategorized (2)
  • Z80 (7)
Blog at WordPress.com.
  • Subscribe Subscribed
    • Sincere Flattery
    • Already have a WordPress.com account? Log in now.
    • Sincere Flattery
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar