Permalink
Browse files

dcpu: correctly initialize SP to 0xFFFF

  • Loading branch information...
1 parent a3c1c95 commit 4a5fdca121b7804509d05d5e787ff3d0ad8db4fa @swetland swetland committed Apr 4, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 dcpu.c
View
4 dcpu.c
@@ -165,8 +165,12 @@ void load(struct dcpu *d, FILE *fp) {
int main(int argc, char **argv) {
struct dcpu d;
+
memset(&d, 0, sizeof(d));
+ d.sp = 0xffff;
+
load(&d, stdin);
+
dumpheader();
for (;;) {
dumpstate(&d);

0 comments on commit 4a5fdca

Please sign in to comment.