diff --git a/utils/disassembler/arm/Makefile b/utils/disassembler/arm/Makefile new file mode 100644 index 0000000000..786325e27d --- /dev/null +++ b/utils/disassembler/arm/Makefile @@ -0,0 +1,26 @@ +CFLAGS = -Wall + +ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) +OUTPUT=arm_disass.exe +CROSS= +CFLAGS+=-mno-cygwin +else +OUTPUT=arm_disass +CROSS=i586-mingw32msvc- +endif + +NATIVECC = gcc +CC = $(CROSS)gcc + +all: $(OUTPUT) + +arm_disass: main.c disasm_arm.c + gcc $(CFLAGS) -o arm_disass main.c disasm_arm.c + strip arm_disass + +arm_disass.exe: main.c disasm_arm.c + $(CC) $(CFLAGS) -o arm_disass.exe main.c disasm_arm.c + $(CROSS)strip arm_disass.exe + +clean: + rm -f arm_disass main.o disasm_arm.o *~ diff --git a/utils/disassembler/arm/disasm_arm.c b/utils/disassembler/arm/disasm_arm.c index 4664d0f3b2..631eb9d7db 100644 --- a/utils/disassembler/arm/disasm_arm.c +++ b/utils/disassembler/arm/disasm_arm.c @@ -1,5 +1,6 @@ #include #include +#include #define ULONG unsigned long #define UCHAR unsigned char @@ -194,7 +195,7 @@ void opcode_stg(char *stg, ULONG val, ULONG off) if(val & 0x2000000) // immidiate { - off = (ULONG)((unsigned __int64)(val&0xff) << (32 - 2 * ((val >> 8) & 15))) | ((val&0xff) >> 2 * ((val >> 8) & 15)); + off = (ULONG)((uint64_t)(val&0xff) << (32 - 2 * ((val >> 8) & 15))) | ((val&0xff) >> 2 * ((val >> 8) & 15)); sprintf(op2, FRMT" ", off); } else diff --git a/utils/disassembler/arm/main.c b/utils/disassembler/arm/main.c index 834dc5ff93..59dad48176 100644 --- a/utils/disassembler/arm/main.c +++ b/utils/disassembler/arm/main.c @@ -10,7 +10,7 @@ ULONG isdata[1000000]; /* each bit defines one byte as: code=0, data=1 */ extern void dis_asm(ULONG off, ULONG val, char *stg); -void main(int argc, char **argv) +int main(int argc, char **argv) { FILE *in, *out; char *ptr, stg[256]; @@ -20,7 +20,7 @@ void main(int argc, char **argv) if(argc == 1 || strcmp(argv[1], "--help") == 0) { printf("Usage: arm_disass [input file]\n"); - printf(" disassembles input file to 'disasm.txt'"); + printf(" disassembles input file to 'disasm.txt'\n"); exit(-1); } @@ -115,4 +115,4 @@ void main(int argc, char **argv) } fclose(in); -} \ No newline at end of file +}