diff --git a/libvm/as/Makefile b/libvm/as/Makefile index 19cee5f..4f39397 100644 --- a/libvm/as/Makefile +++ b/libvm/as/Makefile @@ -1,8 +1,3 @@ - - - - - all: as as: as.c tokens.c ../mnemonics.c ../disassembler.c diff --git a/libvm/as/as.c b/libvm/as/as.c index 3c98c72..e8726f0 100644 --- a/libvm/as/as.c +++ b/libvm/as/as.c @@ -1,17 +1,22 @@ +#include "tokens.h" +#include "../vm.h" +#include "../mnemonics.h" +#include "../disassembler.h" + #include #include -#include #include #include #include #include #include -#include "tokens.h" -#include "../vm.h" -#include "../mnemonics.h" -#include "../disassembler.h" +#if defined(_MSC_VER) +#include "../getopt.h" +#else +#include +#endif struct llist { @@ -251,7 +256,7 @@ int main(int argc, char **argv) } listing = fopen(optarg, "w"); if(listing == NULL) { - fprintf(stderr, "Could not open %s.\n"); + fprintf(stderr, "Could not open %s.\n", optarg); exit(1); } } @@ -347,7 +352,7 @@ void apply_modifier(instruction_t *i, const char *mod) if(strncmp("cmd:", mod, 4) == 0) { - fprintf(stderr, "Command specification %s not supported yet.\n"); + fprintf(stderr, "Command specification %s not supported yet.\n", mod); exit(1); } diff --git a/libvm/build.bat b/libvm/build.bat index ac3f703..2142dc2 100644 --- a/libvm/build.bat +++ b/libvm/build.bat @@ -15,6 +15,9 @@ echo Building emulator... SET LIBS= /NXCOMPAT /DYNAMICBASE "SDL.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X64 /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 /NODEFAULTLIB:msvcrt.lib cl %INIT% /I "SDL-1.2.15\include" emulator.c vm.c getopt.c %OPTIONS% /link %LIBS% +echo Building assembler... +cl %INIT% /DYY_NO_UNISTD_H as\as.c as\tokens.c mnemonics.c disassembler.c getopt.c %OPTIONS% + echo Cleaning up... del *.obj SET PATH=%PATHSAVE%