diff --git a/simulator/Makefile b/simulator/Makefile new file mode 100644 index 0000000..c5aeecf --- /dev/null +++ b/simulator/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS=-Wall -Werror -O2 -ansi -std=gnu99 +LIBS=-lpthread + +OUT = sim +OBJ = addrmode.o alu.o bus.o core.o decoder.o exec.o main.o memory.o serial.o + +%.o: %.c + $(CC) -c -o $@ $< $(CFLAGS) + +$(OUT): $(OBJ) + gcc -o $@ $^ $(CFLAGS) $(LIBS) + +.PHONY: clean + +clean: + rm -f *.o $(OUT) diff --git a/simulator/main.c b/simulator/main.c index f6a6105..fb2535a 100644 --- a/simulator/main.c +++ b/simulator/main.c @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) while (1) { core_step(); - thread_sleep(1000); + thread_sleep(1000000); } return 0;