Skip to content
Snippets Groups Projects
Commit 0e1b4df5 authored by Zhaolin Deng's avatar Zhaolin Deng
Browse files

test

parent 0473a5f9
Branches
No related tags found
No related merge requests found
...@@ -24,13 +24,14 @@ public class Fuzzer { ...@@ -24,13 +24,14 @@ public class Fuzzer {
} }
pw.println("RET R0"); pw.println("RET R0");
*/ */
//pw.println("RET R-1"); /*pw.println("RET R-1");
pw.println("MOV R0 200"); pw.println("MOV R0 200");
//pw.println("DIV R0 R0 R1"); //pw.println("DIV R0 R0 R1");
for(int x=0;x<31;x++){ for(int x=0;x<31;x++){
pw.println("ADD R"+(x+1)+" R"+x +" R"+x); pw.println("ADD R"+(x+1)+" R"+x +" R"+x);
}; };
pw.println("RET R31"); pw.println("RET R31");*/
pw.println("RET R0");
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(System.err); e.printStackTrace(System.err);
System.exit(1); System.exit(1);
......
...@@ -57,14 +57,14 @@ unsigned int count = 0; /* counts number of instructions executed so far */ ...@@ -57,14 +57,14 @@ unsigned int count = 0; /* counts number of instructions executed so far */
static void machine_init(void){ static void machine_init(void){
memory = malloc(sizeof(int32_t)*MEMORY_SIZE); memory = malloc(sizeof(int32_t)*MEMORY_SIZE);
regs = malloc(sizeof(int32_t)*NUM_REGS); regs = malloc(sizeof(int32_t)*NUM_REGS);
memset(memory,0,sizeof(int32_t)*MEMORY_SIZE); //memset(memory,0,sizeof(int32_t)*MEMORY_SIZE);
memset(regs,0,sizeof(int32_t)*NUM_REGS); //memset(regs,0,sizeof(int32_t)*NUM_REGS);
count = 0; count = 0;
} }
static void machine_free(void){ static void machine_free(void){
free(memory); free(memory);
// free(regs); free(regs);
} }
static void do_add(unsigned int dest, unsigned int src1, unsigned int src2) static void do_add(unsigned int dest, unsigned int src1, unsigned int src2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment