aboutsummaryrefslogtreecommitdiff
path: root/emu.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-24 18:16:32 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-24 18:16:32 +0000
commitd28be64a53c8436359406cd73775f41216155a7d (patch)
treebd7f62bb6423e2828fe21e75cb9ec2015d3828f9 /emu.c
parenta11ec50c0155d4011140486ffb5af92812bf11b4 (diff)
add NOP opcode
Diffstat (limited to 'emu.c')
-rw-r--r--emu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/emu.c b/emu.c
index 8ec00dc..5920ff7 100644
--- a/emu.c
+++ b/emu.c
@@ -62,11 +62,12 @@ void (*op[nOpt])(unsigned short *a, unsigned short *b) = {
[IFB] = ifb,
};
+void nop(unsigned short *a);
void jsr(unsigned short *a);
void stop(unsigned short *a);
void (*extop[nExt])(unsigned short *a) = {
- [Res] = stop, /* die on wrong opcode */
+ [NOP] = nop,
[JSR] = jsr,
[BRK] = stop,
};
@@ -215,6 +216,12 @@ ifb(unsigned short *a, unsigned short *b)
}
void
+nop(unsigned short *a)
+{
+ cycle += 1;
+}
+
+void
jsr(unsigned short *a)
{
mem[--reg[SP]] = reg[PC];