Skip to content
On this page

Introduction

So, today I woke up with a sudden urge to develop an emulator.

It first began as a wish to develop a Gameboy emulator, however, after some research, I found out about this BytePusher, a virtual machine based on Chip8.

It sounded simple enough to start, so I choose it. But I still want to develop a Gameboy emulator, but I'll do this after finishing this one.

By the way, I'll try to write it using web techonologies (HTML, CSS and Javascript) using <canvas> for the display.

So, the point of this plant is basically register my journey on this learning "adventure", while teaching myself and writing in a way that may be used to teach others.

Disclaimer

So, I'll be honest, I don't understand a lot about computer engineering in depth, so hardware and related stuff is not something I know well, at least by the time I write this introduction.


Understanding the machine.

Okay, I'll be honest. To understand how this works, I had to read through the Wiki page at least 3 times. Most of it sounded (actually, still sounds) like black magic. My difficult in understanding it is based on two factors about me:

  1. It's been quite a while since I last had to read about memories and CPU. I got a course of computer hardware at the Uni and read the Manga Guide to Microprocessors;
  2. Even thought I learned the way way way basic way about how computers works, a lot of the abstractions got lost through the time around my mind.

Fortunately, I got around the basic, whoever, this felt way more complex than i thought it would be.

The CPU

So, the CPU is the base of the ByterPush machine. It's machine code is based on ByteByteJump, which is a 3 word (aka, 3 bytes) instruction, which is something like:

A >> B -> C

Which roughly translates to:

  1. Get the value from address A;
  2. Move it to address B;
  3. Jump to C.

The hardest part of all this is that, in bytebytejump, you don't have operation instructions, so no "add", "sub" and so on out of the bat, you have to write them yourself.

The mental machine

So, I spent like, 3 hours, just scratching my head trying to understand it, because it is the most basic form of operating: you, your language of choice, their binary operators and you creativity (or mental resillience.)

Let's begin!

Okay, so, instead of trying to teaching you about how this might works, I'll start by developing it by myself and explaining what I was trying to do on the go.

Keep reading at Hello World, I guess?

Released under the MIT License.