diff src/cpu.c @ 6:74a6d629b78f

Added assembler. Removed hand-assembled version of hello world example
author Michael Pavone <pavone@retrodev.com>
date Sat, 26 Mar 2016 23:31:08 -0700
parents 6204c81e2933
children d8ae30286d17
line wrap: on
line diff
--- a/src/cpu.c	Sat Mar 26 23:30:50 2016 -0700
+++ b/src/cpu.c	Sat Mar 26 23:31:08 2016 -0700
@@ -23,9 +23,6 @@
 #define FLAG_C 8
 #define FLAG_N 16
 
-#define REG_PC 14
-#define REG_SR 15
-
 cpu* alloc_cpu(uint32_t clock_divider, uint32_t num_regions, memory_region *regions)
 {
 	size_t alloc_size = sizeof(cpu) + sizeof(memory_region) * num_regions;
@@ -375,6 +372,14 @@
 	"ldim", "ldimh", "ld8", "ld16", "str8", "str16", "add", "adc", "and", "or", "xor", "lsl", "lsr", "asr", "bcc", "single"
 };
 
+char * mnemonics_single_src[] = {
+	"mov", "neg", "not", "cmp", "call", "swap", "in", "out", "ini", "outi", "addi", "andi", "ori", "lsi", "cmpi", "single reg"
+};
+
+char * mnemonics_single_reg[] = {
+	"reti", "trap", "trapi", "getepc", "setepc", "getesr", "setesr", "getenum", "setenum", "setuer", "getuer"
+};
+
 void run_instruction(cpu *context)
 {
 	uint16_t instruction = context->prefetch;