#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/*)Module asdata.c
-/* asexpr.c */
+ /* asexpr.c */
/*
* (C) Copyright 1989-1995
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/*)Module asexpr.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/*)Module aslex.c
do {
if (p < &id[NCPS])
*p++ = c;
- } while (ctype[c=get()] & (0xFF - (SPACE|ILL)));
+ } while (ctype[c=get()] & (~(SPACE|ILL)));
unget(c);
while (p < &id[NCPS])
*p++ = 0;
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include <stdlib.h>
#include "asm.h"
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
extern VOID machine(struct mne *);
" a all user symbols made global",
" l create list output file1[LST]",
" o create object output file1[REL]",
- " s create symbol output file1[SYM]",
- " p disable listing pagination",
- " f flag relocatable references by ` in listing file",
+ " s create symbol output file1[SYM]",
+ " p disable listing pagination",
+ " f flag relocatable references by ` in listing file",
" ff flag relocatable references by mode in listing file",
"",
0
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/* Return basic file name without path or extension */
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/*
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "asm.h"
/*)Module assubr.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
#include <alloc.h>
+#endif
#include "asm.h"
/*)Module assym.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lkarea.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lkdata.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lkeval.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*Module lkhead.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lkihx.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lklex.c
#include <stdio.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lklibr.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include <stdlib.h>
#include "aslink.h"
#include <stdio.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <stdlib.h>
+#else
#include <alloc.h>
+#endif
#include "aslink.h"
/* yuck - but including unistd.h causes problems on Cygwin by redefining
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
static void DefineGlobal( char *name, addr_t value, int page );
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lkrloc.c
#include <stdio.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lks19.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
#include "aslink.h"
/*
#include <stdio.h>
#include <string.h>
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
#include <alloc.h>
+#endif
#include "aslink.h"
/*)Module lksym.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module asdata.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module asexpr.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module aslex.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module aslist.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#ifdef SDK
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#include "asm.h"
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if !defined(_MSC_VER)
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module assubr.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
+
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
#include <alloc.h>
+#endif
+
#include "asm.h"
/*)Module assym.c
#include <ctype.h>
#include <assert.h>
+#if defined(_MSC_VER)
+
+typedef unsigned char Uint8 ;
+typedef unsigned Uint16 ;
+
+#else
+
#include "config.h"
+#endif
/* A cooked line of input. */
typedef struct _Line
#include <stdlib.h>
#include <setjmp.h>
#include <stdio.h>
-#include "sdccconf.h"
+
+#if defined(_MSC_VER)
+# include "sdcc_vc.h"
+#else
+# include "sdccconf.h"
+#endif // _MSC_VER
+
#include "SDCCerr.h"
+#if defined(_MSC_VER)
+# define NATIVE_WIN32 1
+#endif
+
#ifdef __BORLANDC__
#define NATIVE_WIN32 1
#endif
+
#ifdef __MINGW32__
#define NATIVE_WIN32 1
#endif
#include "asm.h"
#include <time.h>
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#if 0 /* This should no longer be necessary. */
// This is a bit messy because we define link ourself
#define link NoLiNk
#include <unistd.h>
#undef link
#else
+
#include <unistd.h>
#endif
#else
return IC_RESULT(ic) ;
}
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(_MSC_VER)
#define LONG_LONG __int64
#else
#define LONG_LONG long long
#endif
// This is a bit messy because we define link ourself
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
+
+#if 0 // Wasn't this fixed already
#define link NoLiNk
#include <unistd.h>
#undef link
+#endif
+
#else
// No unistd.h in Borland C++
extern int access(const char *, int);
/*-----------------------------------------------------------------*/
/* my_system - will call a program with arguments */
/*-----------------------------------------------------------------*/
+
+#if defined(_MSC_VER)
+
+char *try_dir[]= {NULL}; // TODO : Fill in some default search list
+
+#else
+
char *try_dir[]= {SRCDIR "/bin",PREFIX "/bin", NULL};
+
+#endif
+
int my_system (const char *cmd, char **cmd_argv)
{
char *dir, *got= NULL; int i= 0;
}
if (got)
+ {
i= spawnv(P_WAIT,got,cmd_argv) == -1;
+ free(got) ;
+ }
else
i= spawnvp(P_WAIT,cmd,cmd_argv) == -1;
if (i) {
#ifndef SDCCSET_H
#define SDCCSET_H
#include <stdarg.h>
-#include "sdccconf.h"
+
+#if defined(_MSC_VER)
+# include "sdcc_vc.h"
+#else
+# include "sdccconf.h"
+#endif // _MSC_VER
+
#include "SDCCalloc.h"
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif
/* only remaining is code / eeprom which will need pointer reg */
/* if it is in code space */
+
+ sym->aop = aop = newAsmop(0);
+
if (IN_CODESPACE(space))
aop->code = 1;
- sym->aop = aop = newAsmop(0);
aop->aopu.aop_ptr = getFreePtr(ic,&aop,result,aop->code);
aop->size = getSize(sym->type);
emitcode ("ldi","%s,lo8(%s)",aop->aopu.aop_ptr->name,sym->rname);
return 0;
}
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(_MSC_VER)
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif
return 0;
}
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(_MSC_VER)
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif
return 0;
}
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(_MSC_VER)
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
#include <ctype.h>
#include "SDCCglobl.h"
+#if defined(_MSC_VER)
+#define __FUNCTION__ __FILE__
+#endif
+
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif
return 0;
}
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(_MSC_VER)
#define STRCASECMP stricmp
#else
#define STRCASECMP strcasecmp
+#if defined(_MSC_VER)
+
+#include <stdlib.h>
+#include "i386/i386.h"
+#include "i386/xm-i386.h"
+#define bcopy(s, d, n) memcpy(d, s, n)
+#define bcmp memcmp
+#define bzero(p, l) memset(p, 0, l)
+#define index strchr
+#define rindex strrchr
+
+#else
+
#include "i386/i386.h"
#include "i386/xm-linux.h"
#define rindex strrchr
#endif
-
+#endif // _MSC_VER
\ No newline at end of file
/* Parse a C expression from text in a string */
+#if defined(_MSC_VER)
+#include <malloc.h>
+#endif
+
#include "config.h"
#include "cpplib.h"
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding! */
+#if defined(_MSC_VER)
+
+#include "..\..\sdcc_vc.h"
+#include <io.h>
+
+#else
+
#include "sdccconf.h"
+#endif
+
#ifdef EMACS
#define NO_SHORTNAMES
#include "../src/config.h"
#else
#ifndef VMS
#ifndef USG
+#if !defined(_MSC_VER)
#include <sys/time.h> /* for __DATE__ and __TIME__ */
#include <sys/resource.h>
#else
// #include <sys/times.h>
#include <time.h>
#include <fcntl.h>
+#endif // _MSC_VER
#endif /* USG */
#endif /* not VMS */
#endif
extern enum cpp_token cpp_get_token PARAMS ((struct parse_marker*));
extern void cpp_skip_hspace PARAMS((cpp_reader*));
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
-
+extern int cpp_read_check_assertion (cpp_reader *pfile) ;
/* Maintain and search list of included files, for #import. */