diff --git a/libvm/Makefile b/libvm/Makefile index 6d8b038..2e66895 100644 --- a/libvm/Makefile +++ b/libvm/Makefile @@ -2,11 +2,11 @@ CC = gcc CFLAGS=-O3 -all: explink expdump emulator as +all: svmln expdump emulator svmas .PHONY: as clean run -explink: explink.c +svmln: svmln.c $(CC) -g -o bin/$@ $^ $(CFLAGS) expdump: expdump.c mnemonics.c disassembler.c @@ -15,9 +15,9 @@ expdump: expdump.c mnemonics.c disassembler.c emulator: emulator.c vm.c $(CC) -g -o bin/$@ $^ -lSDL $(CFLAGS) -as: +svmas: $(MAKE) -C as - + test: exp ./exp -o test.exp $(ARGS) hexdump -C test.exp diff --git a/libvm/as/Makefile b/libvm/as/Makefile index 4f39397..458dba8 100644 --- a/libvm/as/Makefile +++ b/libvm/as/Makefile @@ -1,6 +1,6 @@ -all: as +all: svmas -as: as.c tokens.c ../mnemonics.c ../disassembler.c +svmas: as.c tokens.c ../mnemonics.c ../disassembler.c gcc -g -o ../bin/$@ $^ tokens.c: tokens.y diff --git a/libvm/bin/build b/libvm/bin/build deleted file mode 100644 index 2981a21..0000000 --- a/libvm/bin/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -ASMFILE=$1.asm -BINFILE=`echo $ASMFILE | sed "s|\.asm\$|\.bin|"` -EXPFILE=`echo $BINFILE | sed "s|\.bin\$|\.exp|"` - -echo $ASMFILE -echo $BINFILE -echo $EXPFILE - -./bin/as -o $BINFILE $ASMFILE -Ls -./bin/explink -o $EXPFILE -c $BINFILE -rm $BINFILE \ No newline at end of file diff --git a/libvm/emulator.c b/libvm/emulator.c index 97d382d..9342357 100644 --- a/libvm/emulator.c +++ b/libvm/emulator.c @@ -106,8 +106,8 @@ void update_input(SDL_Event *ev) void initialize_vm() { // Initialize memory - mainCore.memoryBase = 0x00; // Linear memory, start at 0x00 - mainCore.memorySize = 0x4000000; // 64 MB; + mainCore.memoryBase = 0x00; // Linear memory, start at 0x00 + mainCore.memorySize = 0x4000000; // 64 MB; mainCore.memory = malloc(mainCore.memorySize); // Initialize code execution diff --git a/libvm/explink.c b/libvm/svmln.c similarity index 100% rename from libvm/explink.c rename to libvm/svmln.c