static char * objfilename = 0;
static int keep_bad_output = 0;
-static void initp1 P((void));
-static int my_creat P((char *name, char *message));
-static void process_args P((int argc, char **argv));
-static void summary P((fd_t fd));
-static void summ_number P((unsigned num));
-static void usage P((void));
+static void initp1(void);
+static int my_creat(char *name, char *message);
+static void process_args(int argc, char **argv);
+static void summary(fd_t fd);
+static void summ_number(unsigned num);
+static void usage(void);
int main(int argc, char *argv[])
{
static void initp1(void)
{
-#ifdef I80386
+#if defined(I80386)
idefsize = defsize = 2; /* I think this is probably safer (RDB) */
-#endif
-#if 0
- idefsize = defsize = sizeof (char *) > 2 ? 4 : 2;
#endif
lctabtop = lctab + NLOC;
lstfil = STDOUT;
{
int fd;
-#ifdef O_BINARY
- if ((fd = open(name, O_RDWR|O_BINARY|O_CREAT|O_TRUNC, CREAT_PERMS)) < 0 || fd > 255)
-#else
if ((fd = creat(name, CREAT_PERMS)) < 0 || fd > 255)
-#endif
as_abort(message);
return fd;
}
{
case 'v':
outfd = STDOUT;
- writes("as86 version: ");
+ writes("as version: ");
#ifdef VERSION
writesn(VERSION);
#else
#include "scan.h"
static bool_t nocolonlabel; /* set for labels not followed by ':' */
-static void (*routine) P((void));
+static void (*routine)(void);
#ifdef I80386
static opcode_t rep = 0; /* which rep/repne prefix was seen */
#endif
#include "scan.h"
#include "source.h"
-static void experror P((char * err_str));
-static void expundefined P((void));
-static void simple2 P((void));
-static void simple P((void));
-static void term P((void));
-static void factor2 P((void));
+static void experror(char * err_str);
+static void expundefined(void);
+static void simple2(void);
+static void simple(void);
+static void term(void);
+static void factor2(void);
void absexpres(void)
{
#define PT offset_t
#endif
-static void putbinoffset P((offset_t offset, count_t size));
+static void putbinoffset(offset_t offset, count_t size);
/* write header to binary file */
else
#endif
{
-#ifdef MSDOS
-static PT zapptr = 0;
-#endif
outfd = binfil;
-#ifdef MSDOS
- while (binfbuf < (PT)binmbuf && binfbuf >= zapptr+binmin)
- {
- writec(0);
- ++binfbuf;
- ++zapptr;
- }
-#endif
if( binfbuf != (PT)binmbuf)
if( lseek(binfil, (long)((PT)binmbuf-binfbuf), 1) < 0 )
error(BWRAP);
{
char buf[sizeof offset];
+ /* FIXME: implies our binary format depends on stuff we don't want it to ? */
#if SIZEOF_OFFSET_T > 0x2
u4cn(buf, offset, size);
#else
void objheader(void)
{
- static char module_header[] =
+ static unsigned char module_header[] =
{
#ifdef I80386
0xA3, 0x86,
if ((objectc = objectg) == 0)
return;
- writeobj(module_header, sizeof module_header);
+ writeobj((char *)module_header, sizeof module_header);
/* calculate number of imported/exported symbols */
/* and lengths of symbol and string tables */
/* offset to start of text */
+ /* FIXME : on 16bit need to force maths to 32bit as well ? */
putobj4((u32_T) (sizeof module_header + 4 + 4 + 2 + 1 + 1 +
sizeof seg_max_sizes + 4 + segsizebytes + 2 +
symosiz) + strsiz);
#define is8bitsignedoffset(offset) ((offset_t) (offset) + 0x80 < 0x100)
#define pass2 (pass==last_pass)
-static void mshort2 P((void));
-static reg_pt regchk P((void));
-static void reldata P((void));
-static void segadj P((void));
+static void mshort2(void);
+static reg_pt regchk(void);
+static void reldata(void);
+static void segadj(void);
#ifdef I80386
/* depends on zero = FALSE init */
static bool_t lcommflag;
-static void bumpsem P((struct flags_s *flagptr, int defval));
-static void constdata P((unsigned size));
-static void docomm P((void));
-static void doelseif P((pfv func));
-static void doequset P((unsigned char labits));
-static void doentexp P((unsigned char entbits, unsigned char impbits));
-static void dofcc P((void));
-static void doif P((pfv func));
-static struct sym_s *needlabel P((void));
-static void showredefinedlabel P((void));
-static void setloc P((unsigned seg));
+static void bumpsem(struct flags_s *flagptr, int defval);
+static void constdata(unsigned size);
+static void docomm(void);
+static void doelseif(pfv func);
+static void doequset(unsigned char labits);
+static void doentexp(unsigned char entbits, unsigned char impbits);
+static void dofcc(void);
+static void doif(pfv func);
+static struct sym_s *needlabel(void);
+static void showredefinedlabel(void);
+static void setloc(unsigned seg);
static void bumpsem(struct flags_s *flagptr, int defval)
{
WHITESPACE, WHITESPACE, WHITESPACE, WHITESPACE
};
-static void intconst P((void));
+static void intconst(void);
void context_hexconst(void)
{
unsigned nlookup;
unsigned nsym;
unsigned nx[30];
-static void printchain P((void));
+static void printchain(void);
#endif
-static void install P((register char *keyptr, unsigned char data));
+static void install(register char *keyptr, unsigned char data);
-void inst_keywords()
+void inst_keywords(void)
{
install(regs, REGBIT);
#ifdef I80386