Last active
September 19, 2016 12:58
-
-
Save Darksecond/ab11cc60017c41ac3ec38a6c183920ae to your computer and use it in GitHub Desktop.
libvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libvm design | |
------------ | |
Basically Gameboy Z80 | |
registers | |
========= | |
[15...8] [7...0] | |
[A ] [F ] | |
[B ] [C ] | |
[D ] [E ] | |
[H ] [L ] | |
[ 15...0 ] | |
[ SP ] | |
[ PC ] | |
A = Accumulator | |
F = Flags | |
SP = Stack Pointer | |
PC = Program Counter | |
[Flag Bits ] | |
[7][6][5][4][3][2][1][0] | |
[Z][N][H][C][0][0][0][0] | |
Z = Zero | |
N = Negative (Subtract) | |
H = Half Carry | |
C = Carry | |
0 = Unused, Always zero | |
memory layout | |
============= | |
opcodes | |
======= | |
d = immediate 8-bit data | |
dd = immediate 16-bit data | |
aa = 16-bit address | |
- = untouched | |
0 = set to zero | |
1 = set to one | |
0x00: NOP [----] [.] | |
0x01: LD BC, dd [----] [.DD] | |
0x02: LD (BC), A [----] [.] | |
0x03: INC BC [----] [.] | |
0x04: INC B [Z0H-] [.] | |
0x05: DEC B [Z1H-] [.] | |
0x06: LD B, d [----] [.d] | |
0x07: | |
0x08: LD (aa), SP [----] [.aa] | |
0x09: ADD HL, BC [-0HC] [.] | |
0x0A: LD A, (BC) [----] [.] | |
0x0B: DEC BC [----] [.] | |
0x0C: INC C [Z0H-] [.] | |
0x0D: DEC C [Z1H-] [.] | |
0x0E: LD C, d [----] [.d] | |
0x0F: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment