projects
/
rmac
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d28f432
)
Various cleanups to fix compiler warnings.
author
James Hammons
<jlhamm@acm.org>
Mon, 26 Dec 2011 23:54:45 +0000
(23:54 +0000)
committer
James Hammons
<jlhamm@acm.org>
Mon, 26 Dec 2011 23:54:45 +0000
(23:54 +0000)
36 files changed:
68kgen.c
patch
|
blob
|
history
amode.c
patch
|
blob
|
history
amode.h
patch
|
blob
|
history
debug.c
patch
|
blob
|
history
debug.h
patch
|
blob
|
history
direct.c
patch
|
blob
|
history
direct.h
patch
|
blob
|
history
eagen.c
patch
|
blob
|
history
eagen0.c
patch
|
blob
|
history
error.c
patch
|
blob
|
history
expr.c
patch
|
blob
|
history
expr.h
patch
|
blob
|
history
kwgen.c
patch
|
blob
|
history
listing.c
patch
|
blob
|
history
listing.h
patch
|
blob
|
history
mach.c
patch
|
blob
|
history
mach.h
patch
|
blob
|
history
macro.c
patch
|
blob
|
history
macro.h
patch
|
blob
|
history
mark.c
patch
|
blob
|
history
mark.h
patch
|
blob
|
history
object.c
patch
|
blob
|
history
object.h
patch
|
blob
|
history
parmode.h
patch
|
blob
|
history
procln.c
patch
|
blob
|
history
procln.h
patch
|
blob
|
history
risca.c
patch
|
blob
|
history
risca.h
patch
|
blob
|
history
rmac.c
patch
|
blob
|
history
rmac.h
patch
|
blob
|
history
sect.c
patch
|
blob
|
history
sect.h
patch
|
blob
|
history
symbol.c
patch
|
blob
|
history
symbol.h
patch
|
blob
|
history
token.c
patch
|
blob
|
history
token.h
patch
|
blob
|
history
diff --git
a/68kgen.c
b/68kgen.c
index eb4df1a466d1c38e376e2f6385282c1b5951324a..ccae3e5fb7076d45e2ad456c7f5b483671d0cf6a 100644
(file)
--- a/
68kgen.c
+++ b/
68kgen.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// 68KGEN.C - Tool to Generate 68000 Opcode Table
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// 68KGEN.C - Tool to Generate 68000 Opcode Table
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
@@
-13,16
+14,17
@@
int kwnum = 1; /* current op# for kwgen output */
int kwnum = 1; /* current op# for kwgen output */
-FILE *
kfp;
/* keyword file */
+FILE *
kfp;
/* keyword file */
int lineno = 0;
void error(char *, char *);
void procln(int, char **);
int lineno = 0;
void error(char *, char *);
void procln(int, char **);
-void main(int argc, char **argv) {
- char *namv[256];
- char *s;
+void main(int argc, char ** argv)
+{
+ char * namv[256];
+ char * s;
int namcnt;
char ln[256];
int namcnt;
char ln[256];
@@
-30,7
+32,8
@@
void main(int argc, char **argv) {
if ((kfp = fopen(argv[1], "w")) == NULL)
error("Cannot create: %s", argv[1]);
if ((kfp = fopen(argv[1], "w")) == NULL)
error("Cannot create: %s", argv[1]);
- while (gets(ln) != NULL)
+// while (gets(ln) != NULL)
+ while (fgets(ln, 256, stdin) != NULL)
{
++lineno; /* bump line# */
if (*ln == '#') /* ignore comments */
{
++lineno; /* bump line# */
if (*ln == '#') /* ignore comments */
@@
-42,17
+45,22
@@
void main(int argc, char **argv) {
*/
namcnt = 0;
s = ln;
*/
namcnt = 0;
s = ln;
+
while (*s)
while (*s)
+ {
if (isspace(*s))
++s;
else
{
namv[namcnt++] = s;
if (isspace(*s))
++s;
else
{
namv[namcnt++] = s;
+
while (*s && !isspace(*s))
++s;
while (*s && !isspace(*s))
++s;
+
if (isspace(*s))
*s++ = EOS;
}
if (isspace(*s))
*s++ = EOS;
}
+ }
if (namcnt)
procln(namcnt, namv);
if (namcnt)
procln(namcnt, namv);
@@
-63,9
+71,10
@@
void main(int argc, char **argv) {
/*
* Parse line
*/
/*
* Parse line
*/
-void procln(int namc, char **namv) {
+void procln(int namc, char ** namv)
+{
int i, j;
int i, j;
- char *s;
+ char *
s;
if (namc == 1) /* alias for previous entry */
{
if (namc == 1) /* alias for previous entry */
{
@@
-92,30
+101,32
@@
void procln(int namc, char **namv) {
if (*namv[4] == '%') /* enforce little fascist percent signs */
{
if (*namv[4] == '%') /* enforce little fascist percent signs */
{
- for
(i=1, j=0; i <
17; ++i)
+ for
(i=1, j=0; i<
17; ++i)
{
j <<= 1;
{
j <<= 1;
- if (namv[4][i] == '1' ||
-
isupper(namv[4][i]))
+
+
if (namv[4][i] == '1' ||
isupper(namv[4][i]))
++j;
}
++j;
}
+
printf("0x%04x, ", j);
}
printf("0x%04x, ", j);
}
- else printf("%s, ", namv[4]);
+ else
+ printf("%s, ", namv[4]);
- if (namc == 7 &&
- *namv[6] == '+')
+ if (namc == 7 && *namv[6] == '+')
printf("%d, ", kwnum+1);
printf("%d, ", kwnum+1);
- else printf("0, ");
+ else
+ printf("0, ");
printf("%s},\n", namv[5]);
++kwnum;
}
printf("%s},\n", namv[5]);
++kwnum;
}
-void error(char *s, char *s1) {
+void error(char * s, char * s1)
+{
fprintf(stderr, s, s1);
fprintf(stderr, "\n");
exit(1);
}
fprintf(stderr, s, s1);
fprintf(stderr, "\n");
exit(1);
}
-
diff --git
a/amode.c
b/amode.c
index 93e31d315a23c61610de3a027ac5bee0cd1c737b..26934677ecde8bd76a6fcc043c1098f17b4fd553 100644
(file)
--- a/
amode.c
+++ b/
amode.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// AMODE.C - Addressing Modes
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// AMODE.C - Addressing Modes
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "amode.h"
#include "error.h"
#include "amode.h"
#include "error.h"
diff --git
a/amode.h
b/amode.h
index c7bd6febd2f834aa7eb5b3dc3154e63186402ae9..e9419d18efc9cbbb8ba10088dce269c3ac5239db 100644
(file)
--- a/
amode.h
+++ b/
amode.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// AMODE.H - Addressing Modes
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// AMODE.H - Addressing Modes
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __AMODE_H__
#define __AMODE_H__
#ifndef __AMODE_H__
#define __AMODE_H__
@@
-100,7
+101,7
@@
MNTAB {
LONG mn0, mn1; // Addressing modes
WORD mninst; // Instruction mask
WORD mncont; // Continuation (or -1)
LONG mn0, mn1; // Addressing modes
WORD mninst; // Instruction mask
WORD mncont; // Continuation (or -1)
- int (*mnfunc)(); // Mnemonic builder
+ int (*mnfunc)(
WORD, WORD
); // Mnemonic builder
};
// mnattr:
};
// mnattr:
@@
-110,4
+111,4
@@
MNTAB {
int amode(int);
int reglist(WORD *);
int amode(int);
int reglist(WORD *);
-#endif // __AMODE_H__
\ No newline at end of file
+#endif // __AMODE_H__
diff --git
a/debug.c
b/debug.c
index 8c2a8d96201c3eac08f0cf733313d3d034180690..75520486cc3b24c6bcc624aecd0ad11918f9de87 100644
(file)
--- a/
debug.c
+++ b/
debug.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DEBUG.C - Debugging Messages
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DEBUG.C - Debugging Messages
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "debug.h"
#include "sect.h"
#include "debug.h"
#include "sect.h"
@@
-16,23
+17,28
@@
static int siztab[4] = {3, 5, 9, 9};
// --- Print 'c' Visibly ---------------------------------------------------------------------------
//
// --- Print 'c' Visibly ---------------------------------------------------------------------------
//
-int visprt(char c) {
- if(c < 0x20 || c >= 0x7f)
+int visprt(char c)
+{
+ if (c < 0x20 || c >= 0x7f)
putchar('.');
else
putchar(c);
putchar('.');
else
putchar(c);
- return
(0)
;
+ return
0
;
}
//
// --- Print expression, return ptr to just past the ENDEXPR ---------------------------------------
//
}
//
// --- Print expression, return ptr to just past the ENDEXPR ---------------------------------------
//
-TOKEN *printexpr(TOKEN *tp) {
- if(tp != NULL)
- while(*tp != ENDEXPR)
- switch((int)*tp++) {
+TOKEN * printexpr(TOKEN * tp)
+{
+ if (tp != NULL)
+ {
+ while (*tp != ENDEXPR)
+ {
+ switch ((int)*tp++)
+ {
case SYMBOL:
printf("`%s' ", ((SYM *)*tp)->sname);
++tp;
case SYMBOL:
printf("`%s' ", ((SYM *)*tp)->sname);
++tp;
@@
-48,39
+54,48
@@
TOKEN *printexpr(TOKEN *tp) {
printf("%c ", (char)tp[-1]);
break;
}
printf("%c ", (char)tp[-1]);
break;
}
+ }
+ }
+
printf(";\n");
printf(";\n");
- return
(tp + 1)
;
+ return
tp + 1
;
}
//
// --- Dump data in a chunk (and maybe others) in the appropriate format ---------------------------
//
}
//
// --- Dump data in a chunk (and maybe others) in the appropriate format ---------------------------
//
-int chdump(CHUNK *ch, int format) {
- while(ch != NULL) {
+int chdump(CHUNK * ch, int format)
+{
+ while (ch != NULL)
+ {
printf("chloc=$%08lx, chsize=$%lx\n", ch->chloc, ch->ch_size);
mdump(ch->chptr, ch->ch_size, format, ch->chloc);
ch = ch->chnext;
}
printf("chloc=$%08lx, chsize=$%lx\n", ch->chloc, ch->ch_size);
mdump(ch->chptr, ch->ch_size, format, ch->chloc);
ch = ch->chnext;
}
- return
(0)
;
+ return
0
;
}
//
// --- Dump fixup records in printable format ------------------------------------------------------
//
}
//
// --- Dump fixup records in printable format ------------------------------------------------------
//
-int fudump(CHUNK *ch) {
+int fudump(CHUNK * ch)
+{
PTR p;
PTR p;
- char *ep;
+ char *
ep;
WORD attr, esiz;
WORD line, file;
LONG loc;
WORD attr, esiz;
WORD line, file;
LONG loc;
- for(; ch != NULL;) {
+ for(; ch!=NULL;)
+ {
p.cp = ch->chptr;
ep = ch->chptr + ch->ch_size;
p.cp = ch->chptr;
ep = ch->chptr + ch->ch_size;
- while(p.cp < ep) {
+
+ while(p.cp < ep)
+ {
attr = *p.wp++;
loc = *p.lp++;
file = *p.wp++;
attr = *p.wp++;
loc = *p.lp++;
file = *p.wp++;
@@
-88,66
+103,77
@@
int fudump(CHUNK *ch) {
printf("$%04x $%08lx %d.%d: ", (int)attr, loc, (int)file, (int)line);
printf("$%04x $%08lx %d.%d: ", (int)attr, loc, (int)file, (int)line);
- if(attr & FU_EXPR) {
+ if (attr & FU_EXPR)
+ {
esiz = *p.wp++;
printf("(%d long) ", (int)esiz);
p.tk = printexpr(p.tk);
esiz = *p.wp++;
printf("(%d long) ", (int)esiz);
p.tk = printexpr(p.tk);
- } else {
+ }
+ else
+ {
printf("`%s' ;\n", (*p.sy)->sname);
++p.lp;
}
}
printf("`%s' ;\n", (*p.sy)->sname);
++p.lp;
}
}
+
ch = ch->chnext;
}
ch = ch->chnext;
}
- return
(0)
;
+ return
0
;
}
//
// --- Dump marks ----------------------------------------------------------------------------------
//
}
//
// --- Dump marks ----------------------------------------------------------------------------------
//
-int mudump(void) {
- MCHUNK *mch;
+int mudump(void)
+{
+ MCHUNK * mch;
PTR p;
WORD from;
WORD w;
LONG loc;
PTR p;
WORD from;
WORD w;
LONG loc;
- SYM *symbol;
+ SYM *
symbol;
from = 0;
from = 0;
- for(mch = firstmch; mch != NULL; mch = mch->mcnext) {
+
+ for(mch=firstmch; mch!=NULL; mch=mch->mcnext)
+ {
printf("mch=$%08lx mcptr=$%08lx mcalloc=$%lx mcused=$%x\n",
printf("mch=$%08lx mcptr=$%08lx mcalloc=$%lx mcused=$%x\n",
- mch,
-
mch->mcptr
,
+
(unsigned long int)
mch,
+
(unsigned long int)(mch->mcptr.lw)
,
mch->mcalloc,
mch->mcalloc,
-
mch->mcused
);
+
(unsigned int)(mch->mcused)
);
p = mch->mcptr;
p = mch->mcptr;
- for(;;) {
+
+ for(;;)
+ {
w = *p.wp++;
w = *p.wp++;
- if(w & MCHEND)
+
+ if (w & MCHEND)
break;
symbol = NULL;
loc = *p.lp++;
break;
symbol = NULL;
loc = *p.lp++;
- if(w & MCHFROM)
+ if
(w & MCHFROM)
from = *p.wp++;
from = *p.wp++;
- if(w & MSYMBOL)
+ if
(w & MSYMBOL)
symbol = *p.sy++;
printf("m=$%04x to=%d loc=$%lx from=%d siz=%s",
w, w & 0x00ff, loc, from, (w & MLONG) ? "long" : "word");
symbol = *p.sy++;
printf("m=$%04x to=%d loc=$%lx from=%d siz=%s",
w, w & 0x00ff, loc, from, (w & MLONG) ? "long" : "word");
- if(symbol != NULL)
+ if
(symbol != NULL)
printf(" sym=`%s'", symbol->sname);
printf(" sym=`%s'", symbol->sname);
- printf("\n");
+
+ printf("\n");
}
}
}
}
- return
(0)
;
+ return
0
;
}
//
}
//
@@
-219,27
+245,31
@@
int mdump(char *start, LONG count, int flg, LONG base) {
// --- Dump list of tokens on stdout in printable form ---------------------------------------------
//
// --- Dump list of tokens on stdout in printable form ---------------------------------------------
//
-int dumptok(TOKEN *tk) {
+int dumptok(TOKEN * tk)
+{
int flg = 0;
int flg = 0;
- while(*tk != EOL) {
- if(flg++)
+ while (*tk != EOL)
+ {
+ if (flg++)
printf(" ");
printf(" ");
- if(*tk >= 128) {
+ if (*tk >= 128)
+ {
printf("REG=%ld", *tk++ - 128);
continue;
}
printf("REG=%ld", *tk++ - 128);
continue;
}
- switch((int)*tk++) {
+ switch ((int)*tk++)
+ {
case CONST: // CONST <value>
printf("CONST=%ld", *tk++);
break;
case STRING: // STRING <address>
case CONST: // CONST <value>
printf("CONST=%ld", *tk++);
break;
case STRING: // STRING <address>
- printf("STRING='%s'", *tk++);
+ printf("STRING='%s'",
(char *)
*tk++);
break;
case SYMBOL: // SYMBOL <address>
break;
case SYMBOL: // SYMBOL <address>
- printf("SYMBOL='%s'", *tk++);
+ printf("SYMBOL='%s'",
(char *)
*tk++);
break;
case EOL: // End of line
printf("EOL");
break;
case EOL: // End of line
printf("EOL");
@@
-269,13
+299,14
@@
int dumptok(TOKEN *tk) {
printf("SHL");
break;
default:
printf("SHL");
break;
default:
- printf("%c", tk[-1]);
+ printf("%c",
(int)
tk[-1]);
break;
}
}
break;
}
}
+
printf("\n");
printf("\n");
- return
(0)
;
+ return
0
;
}
//
}
//
diff --git
a/debug.h
b/debug.h
index 853d5f21147adf6098c553ef56dcdd56e4ae6078..9d6f278964f047e6be5c9b8272c060ab42c6e329 100644
(file)
--- a/
debug.h
+++ b/
debug.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DEBUG.H - Debugging Messages
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DEBUG.H - Debugging Messages
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __DEBUG_H__
#define __DEBUG_H__
#ifndef __DEBUG_H__
#define __DEBUG_H__
@@
-16,4
+17,4
@@
int mdump(char *, LONG, int, LONG);
int dumptok(TOKEN *);
int dump_everything(void);
int dumptok(TOKEN *);
int dump_everything(void);
-#endif // __DEBUG_H__
\ No newline at end of file
+#endif // __DEBUG_H__
diff --git
a/direct.c
b/direct.c
index 54a185f5ccb32890b083536f62b00da4a14ccca8..3b20a21456a14b17266fce5cff93a6055c68b2e9 100644
(file)
--- a/
direct.c
+++ b/
direct.c
@@
-88,7
+88,8
@@
int (*dirtab[])() = {
// --- .org - Set origin ---------------------------------------------------------------------------
//
// --- .org - Set origin ---------------------------------------------------------------------------
//
-int d_fail(void) {
+int d_fail(void)
+{
fatal("user abort");
return(0);
}
fatal("user abort");
return(0);
}
@@
-97,15
+98,17
@@
int d_fail(void) {
// --- .org - Set origin ---------------------------------------------------------------------------
//
// --- .org - Set origin ---------------------------------------------------------------------------
//
-int d_org(void) {
+int d_org(void)
+{
VALUE address;
VALUE address;
- if(!rgpu && !rdsp)
+ if
(!rgpu && !rdsp)
return(error(".org permitted only in gpu/dsp section"));
orgaddr = 0;
return(error(".org permitted only in gpu/dsp section"));
orgaddr = 0;
- if(abs_expr(&address) == ERROR) {
+ if (abs_expr(&address) == ERROR)
+ {
error("cannot determine org'd address");
return(ERROR);
}
error("cannot determine org'd address");
return(ERROR);
}
@@
-120,12
+123,14
@@
int d_org(void) {
// --- NOP Padding Directive -----------------------------------------------------------------------
//
// --- NOP Padding Directive -----------------------------------------------------------------------
//
-int d_jpad(void) {
+int d_jpad(void)
+{
jpad = 1;
return(0);
}
jpad = 1;
return(0);
}
-int d_nojpad(void) {
+int d_nojpad(void)
+{
jpad = 0;
return(0);
}
jpad = 0;
return(0);
}
@@
-134,7
+139,8
@@
int d_nojpad(void) {
// --- Print Directive -----------------------------------------------------------------------------
//
// --- Print Directive -----------------------------------------------------------------------------
//
-int d_print(void) {
+int d_print(void)
+{
char prntstr[LNSIZ]; // String for PRINT directive
char format[LNSIZ]; // Format for PRINT directive
int formatting = 0; // Formatting on/off
char prntstr[LNSIZ]; // String for PRINT directive
char format[LNSIZ]; // Format for PRINT directive
int formatting = 0; // Formatting on/off
@@
-651,28
+657,33
@@
int d_bss(void) {
// --- .ds[.size] expression -----------------------------------------------------------------------
//
// --- .ds[.size] expression -----------------------------------------------------------------------
//
-int d_ds(WORD siz) {
+int d_ds(WORD siz)
+{
VALUE eval;
// This gets kind of stupid. This directive is disallowed in normal 68000 mode ("for your own
// good!"), but is permitted for 6502 and Alcyon-compatibility modes.
// For obvious reasons, no auto-even is done in 8-bit processor modes.
VALUE eval;
// This gets kind of stupid. This directive is disallowed in normal 68000 mode ("for your own
// good!"), but is permitted for 6502 and Alcyon-compatibility modes.
// For obvious reasons, no auto-even is done in 8-bit processor modes.
- if(as68_flag == 0 && (scattr & SBSS) == 0)
+ if
(as68_flag == 0 && (scattr & SBSS) == 0)
return(error(".ds permitted only in BSS"));
return(error(".ds permitted only in BSS"));
- if(siz != SIZB && (sloc & 1)) // Automatic .even
+ if
(siz != SIZB && (sloc & 1)) // Automatic .even
auto_even();
auto_even();
- if(abs_expr(&eval) != OK) return(0);
+ if (abs_expr(&eval) != OK)
+ return(0);
// In non-TDB section (BSS, ABS and M6502) just advance the location counter appropriately.
// In TDB sections, deposit (possibly large) chunks of zeroed memory....
// In non-TDB section (BSS, ABS and M6502) just advance the location counter appropriately.
// In TDB sections, deposit (possibly large) chunks of zeroed memory....
- if((scattr & SBSS)) {
+ if ((scattr & SBSS))
+ {
listvalue(eval);
eval *= siz;
sloc += eval;
just_bss = 1; // No data deposited (8-bit CPU mode)
listvalue(eval);
eval *= siz;
sloc += eval;
just_bss = 1; // No data deposited (8-bit CPU mode)
- } else {
+ }
+ else
+ {
dep_block(eval, siz, (VALUE)0, (WORD)(DEFINED|ABS), NULL);
}
dep_block(eval, siz, (VALUE)0, (WORD)(DEFINED|ABS), NULL);
}
@@
-684,94
+695,120
@@
int d_ds(WORD siz) {
// --- dc.b, dc.w / dc, dc.l -----------------------------------------------------------------------
//
// --- dc.b, dc.w / dc, dc.l -----------------------------------------------------------------------
//
-int d_dc(WORD siz) {
+int d_dc(WORD siz)
+{
WORD eattr;
VALUE eval;
WORD tdb;
WORD defined;
LONG i;
WORD eattr;
VALUE eval;
WORD tdb;
WORD defined;
LONG i;
- char *p;
+ char *
p;
int movei = 0; // movei flag for dc.i
int movei = 0; // movei flag for dc.i
- if((scattr & SBSS) != 0)
+ if
((scattr & SBSS) != 0)
return(error("illegal initialization of section"));
return(error("illegal initialization of section"));
- if((siz != SIZB) && (sloc & 1))
+ if
((siz != SIZB) && (sloc & 1))
auto_even();
auto_even();
- for(;; ++tok) {
+ for(;; ++tok)
+ {
// dc.b 'string' [,] ...
// dc.b 'string' [,] ...
- if (siz == SIZB && *tok == STRING && (tok[2] == ',' || tok[2] == EOL)) {
+ if (siz == SIZB && *tok == STRING && (tok[2] == ',' || tok[2] == EOL))
+ {
i = strlen((const char*)tok[1]);
i = strlen((const char*)tok[1]);
- if((challoc - ch_size) < i)
+
+ if ((challoc - ch_size) < i)
chcheck(i);
chcheck(i);
- for(p = (char *)tok[1]; *p != EOS; ++p)
+
+ for(p=(char *)tok[1]; *p!=EOS; ++p)
D_byte(*p);
D_byte(*p);
- tok += 2;
+
+ tok += 2;
goto comma;
}
goto comma;
}
- if(*tok == 'I') {
+ if (*tok == 'I')
+ {
movei = 1;
tok++;
siz = SIZL;
}
// dc.x <expression>
movei = 1;
tok++;
siz = SIZL;
}
// dc.x <expression>
- if(expr(exprbuf, &eval, &eattr, NULL) != OK)
+ if
(expr(exprbuf, &eval, &eattr, NULL) != OK)
return(0);
return(0);
- tdb = (WORD)(eattr & TDB);
+
+ tdb = (WORD)(eattr & TDB);
defined = (WORD)(eattr & DEFINED);
defined = (WORD)(eattr & DEFINED);
- if((challoc - ch_size) < 4)
+
+ if ((challoc - ch_size) < 4)
chcheck(4L);
chcheck(4L);
- switch(siz) {
+ switch (siz)
+ {
case SIZB:
case SIZB:
- if(!defined) {
+ if (!defined)
+ {
fixup(FU_BYTE|FU_SEXT, sloc, exprbuf);
D_byte(0);
fixup(FU_BYTE|FU_SEXT, sloc, exprbuf);
D_byte(0);
- } else {
- if(tdb)
+ }
+ else
+ {
+ if (tdb)
return(error("non-absolute byte value"));
return(error("non-absolute byte value"));
- if(eval + 0x100 >= 0x200)
+
+ if (eval + 0x100 >= 0x200)
return(error(range_error));
return(error(range_error));
- D_byte(eval);
+
+ D_byte(eval);
}
break;
case SIZW:
case SIZN:
}
break;
case SIZW:
case SIZN:
- if(!defined) {
+ if (!defined)
+ {
fixup(FU_WORD|FU_SEXT, sloc, exprbuf);
D_word(0);
fixup(FU_WORD|FU_SEXT, sloc, exprbuf);
D_word(0);
- } else {
- if(tdb)
+ }
+ else
+ {
+ if (tdb)
rmark(cursect, sloc, tdb, MWORD, NULL);
rmark(cursect, sloc, tdb, MWORD, NULL);
- if(eval + 0x10000 >= 0x20000)
+
+ if (eval + 0x10000 >= 0x20000)
return(error(range_error));
return(error(range_error));
- // Deposit 68000 or 6502 (byte-reversed) word
+
+ // Deposit 68000 or 6502 (byte-reversed) word
D_word(eval);
}
break;
case SIZL:
D_word(eval);
}
break;
case SIZL:
- if(!defined) {
- if(movei)
+ if (!defined)
+ {
+ if (movei)
fixup(FU_LONG|FU_MOVEI, sloc, exprbuf);
else
fixup(FU_LONG, sloc, exprbuf);
fixup(FU_LONG|FU_MOVEI, sloc, exprbuf);
else
fixup(FU_LONG, sloc, exprbuf);
- D_long(0);
- } else {
- if(tdb)
+
+ D_long(0);
+ }
+ else
+ {
+ if (tdb)
rmark(cursect, sloc, tdb, MLONG, NULL);
rmark(cursect, sloc, tdb, MLONG, NULL);
- if(movei)
+
+ if (movei)
eval = ((eval >> 16) & 0x0000FFFF) | ((eval << 16) & 0xFFFF0000);
eval = ((eval >> 16) & 0x0000FFFF) | ((eval << 16) & 0xFFFF0000);
- D_long(eval);
- }
+
+ D_long(eval);
+ }
break;
}
comma:
break;
}
comma:
- if(*tok != ',')
+ if
(*tok != ',')
break;
}
break;
}
@@
-783,23
+820,24
@@
int d_dc(WORD siz) {
// --- dcb[.siz] expr1,expr2 - Make 'expr1' copies of 'expr2' --------------------------------------
//
// --- dcb[.siz] expr1,expr2 - Make 'expr1' copies of 'expr2' --------------------------------------
//
-int d_dcb(WORD siz) {
+int d_dcb(WORD siz)
+{
VALUE evalc, eval;
WORD eattr;
VALUE evalc, eval;
WORD eattr;
- if((scattr & SBSS) != 0)
+ if
((scattr & SBSS) != 0)
return(error("illegal initialization of section"));
return(error("illegal initialization of section"));
- if(abs_expr(&evalc) != OK)
+ if
(abs_expr(&evalc) != OK)
return(0);
return(0);
- if(*tok++ != ',')
+ if
(*tok++ != ',')
return(error("missing comma"));
return(error("missing comma"));
- if(expr(exprbuf, &eval, &eattr, NULL) < 0)
+ if
(expr(exprbuf, &eval, &eattr, NULL) < 0)
return(0);
return(0);
- if((siz != SIZB) && (sloc & 1))
+ if
((siz != SIZB) && (sloc & 1))
auto_even();
dep_block(evalc, siz, eval, eattr, exprbuf);
auto_even();
dep_block(evalc, siz, eval, eattr, exprbuf);
@@
-819,34
+857,41
@@
int d_dcb(WORD siz) {
// -------------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------------
//
-int d_init(WORD def_siz) {
+int d_init(WORD def_siz)
+{
VALUE count;
VALUE eval;
WORD eattr;
WORD siz;
VALUE count;
VALUE eval;
WORD eattr;
WORD siz;
- if((scattr & SBSS) != 0)
+ if
((scattr & SBSS) != 0)
return(error(".init not permitted in BSS or ABS"));
return(error(".init not permitted in BSS or ABS"));
- if(rgpu || rdsp)
+ if
(rgpu || rdsp)
return(error("directive forbidden in gpu/dsp mode"));
return(error("directive forbidden in gpu/dsp mode"));
- for(;;) {
+ for(;;)
+ {
// Get repeat count (defaults to 1)
// Get repeat count (defaults to 1)
- if(*tok == '#') {
+ if (*tok == '#')
+ {
++tok;
++tok;
- if(abs_expr(&count) != OK)
+
+ if (abs_expr(&count) != OK)
return(0);
return(0);
- if(*tok++ != ',')
+
+ if (*tok++ != ',')
return(error(comma_error));
return(error(comma_error));
- } else
+ }
+ else
count = 1;
// Evaluate expression to deposit
count = 1;
// Evaluate expression to deposit
- if(expr(exprbuf, &eval, &eattr, NULL) < 0)
+ if
(expr(exprbuf, &eval, &eattr, NULL) < 0)
return(0);
return(0);
- switch((int)*tok++) { // Determine size of object to deposit
+ switch ((int)*tok++)
+ { // Determine size of object to deposit
case DOTB: siz = SIZB; break;
case DOTW: siz = SIZB; break;
case DOTL: siz = SIZL; break;
case DOTB: siz = SIZB; break;
case DOTW: siz = SIZB; break;
case DOTL: siz = SIZL; break;
@@
-858,7
+903,8
@@
int d_init(WORD def_siz) {
dep_block(count, siz, eval, eattr, exprbuf);
dep_block(count, siz, eval, eattr, exprbuf);
- switch((int)*tok) {
+ switch ((int)*tok)
+ {
case EOL:
return(0);
case ',':
case EOL:
return(0);
case ',':
diff --git
a/direct.h
b/direct.h
index d88ab24390670cc3825064bc0b3f5ef10be04433..8bcc3516bf396de1a194a84b06b01236f9f169cb 100644
(file)
--- a/
direct.h
+++ b/
direct.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DIRECT.H - Directive Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// DIRECT.H - Directive Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __DIRECT_H__
#define __DIRECT_H__
#ifndef __DIRECT_H__
#define __DIRECT_H__
diff --git
a/eagen.c
b/eagen.c
index fbea6064a38c98fb40dde7c0c79c5021ac9fa34c..a45f4bd4af0a2609e724f81cacd528267124d9a7 100644
(file)
--- a/
eagen.c
+++ b/
eagen.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EAGEN.C - Effective Address Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EAGEN.C - Effective Address Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "rmac.h"
#include "amode.h"
#include "rmac.h"
#include "amode.h"
diff --git
a/eagen0.c
b/eagen0.c
index c51844aace3ed5f73a64508b1355e54622a89d69..de4f409049915edd0f9960b6084a16b1fac4f142 100644
(file)
--- a/
eagen0.c
+++ b/
eagen0.c
@@
-1,12
+1,14
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EAGEN0.C - Effective Address Code Generation
// Generated Code for eaN (Included twice by "eagen.c")
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EAGEN0.C - Effective Address Code Generation
// Generated Code for eaN (Included twice by "eagen.c")
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
-int eaNgen(WORD siz) {
+int eaNgen(WORD siz)
+{
WORD w;
VALUE v;
WORD tdb;
WORD w;
VALUE v;
WORD tdb;
diff --git
a/error.c
b/error.c
index 9a4baeba73888d75bc253ad398b74a2441b2db99..26f82b7ad02396350493f10532b7148730e4a7ec 100644
(file)
--- a/
error.c
+++ b/
error.c
@@
-158,4
+158,4
@@
int interror(int n) {
else printf("%s", buf);
exit(1);
else printf("%s", buf);
exit(1);
-}
\ No newline at end of file
+}
diff --git
a/expr.c
b/expr.c
index 2057d4f983ab77ec0ed12efdc52287a2fc2f978d..5438ff6ffbdd5d7f96eb0c9a0fd0820ce690c4c3 100644
(file)
--- a/
expr.c
+++ b/
expr.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EXPR.C - Expression Analyzer
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EXPR.C - Expression Analyzer
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "expr.h"
#include "token.h"
#include "expr.h"
#include "token.h"
diff --git
a/expr.h
b/expr.h
index 05bf918e35c9d6982c391fc2a4f94e984a6ab12d..89542a588601c659d0cb67b866c23662b6e2e261 100644
(file)
--- a/
expr.h
+++ b/
expr.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EXPR.H - Expression Analyzer
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// EXPR.H - Expression Analyzer
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __EXPR_H__
#define __EXPR_H__
#ifndef __EXPR_H__
#define __EXPR_H__
diff --git
a/kwgen.c
b/kwgen.c
index 9a077b925ad7ecb98b94f33f54a44669244d355f..b7682a520d3692677c509fbb257c6de722f4ac3d 100644
(file)
--- a/
kwgen.c
+++ b/
kwgen.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// KWGEN.C - Keyword & Mnemonic Definition and State Machine Creation Tool
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// KWGEN.C - Keyword & Mnemonic Definition and State Machine Creation Tool
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
/*
* keyword transition-table generation utility
/*
* keyword transition-table generation utility
@@
-121,7
+122,9
@@
int main(int argc, char **argv) {
*
*/
s = strpool;
*
*/
s = strpool;
- while (gets(s) != NULL)
+
+// while (gets(s) != NULL)
+ while (fgets(s, STRPOOLSIZ, stdin) != NULL)
{
if (*s == '#' || !*s) /* ignore comment and empty lines */
continue;
{
if (*s == '#' || !*s) /* ignore comment and empty lines */
continue;
diff --git
a/listing.c
b/listing.c
index e31c7efa785ca779b90b8709bce0ce5cb3695bf4..b3f40ddb44f13a35de646107aaa8814226def4a6 100644
(file)
--- a/
listing.c
+++ b/
listing.c
@@
-1,4
+1,4
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// LISTING.C - Listing Output
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// LISTING.C - Listing Output
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
diff --git
a/listing.h
b/listing.h
index 329ea9373d32636aa896c2f412049c43fa646a4c..7dd57613615bdee5191d6b73be14a32cc069b974 100644
(file)
--- a/
listing.h
+++ b/
listing.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// LISTING.H - Listing Output
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// LISTING.H - Listing Output
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __LISTING_H__
#define __LISTING_H__
#ifndef __LISTING_H__
#define __LISTING_H__
@@
-41,4
+42,4
@@
int listvalue(VALUE);
int d_subttl(void);
int d_title(void);
int d_subttl(void);
int d_title(void);
-#endif // __LISTING_H__
\ No newline at end of file
+#endif // __LISTING_H__
diff --git
a/mach.c
b/mach.c
index 414c83549e9117f8c8692f71455161f07651e957..90f047119449a504d5d44179f796f95b0335ab4a 100644
(file)
--- a/
mach.c
+++ b/
mach.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACH.C - Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACH.C - Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "mach.h"
#include "error.h"
#include "mach.h"
#include "error.h"
@@
-17,13
+18,13
@@
#include "kwtab.h"
// Common error messages
#include "kwtab.h"
// Common error messages
-char *range_error = "expression out of range";
-char *abs_error = "illegal absolute expression";
-char *seg_error = "bad (section) expression";
-char *rel_error = "illegal relative address";
-char *siz_error = "bad size specified";
-char *undef_error = "undefined expression";
-char *fwd_error = "forward or undefined expression";
+char *
range_error = "expression out of range";
+char *
abs_error = "illegal absolute expression";
+char *
seg_error = "bad (section) expression";
+char *
rel_error = "illegal relative address";
+char *
siz_error = "bad size specified";
+char *
undef_error = "undefined expression";
+char *
fwd_error = "forward or undefined expression";
extern int ea0gen(WORD);
extern int ea1gen(WORD);
extern int ea0gen(WORD);
extern int ea1gen(WORD);
diff --git
a/mach.h
b/mach.h
index c76f1095415f58da1ae68fe911eab399954c5fa1..65ea1488867b9c35d5960e4fdd0f1e43ee01d22a 100644
(file)
--- a/
mach.h
+++ b/
mach.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACH.H - Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACH.H - Code Generation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __MACH_H__
#define __MACH_H__
#ifndef __MACH_H__
#define __MACH_H__
@@
-44,4
+45,4
@@
int m_trap(WORD, WORD);
int m_movem(WORD, WORD);
int m_clra(WORD, WORD);
int m_movem(WORD, WORD);
int m_clra(WORD, WORD);
-#endif // __MACH_H__
\ No newline at end of file
+#endif // __MACH_H__
diff --git
a/macro.c
b/macro.c
index b8097f3570fe38e3c0030ad320507c46b41adb16..af105d91890e0372315e5f94ed1537491f1fda44 100644
(file)
--- a/
macro.c
+++ b/
macro.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACRO.C - Macro Definition and Invocation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACRO.C - Macro Definition and Invocation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "macro.h"
#include "token.h"
#include "macro.h"
#include "token.h"
@@
-449,8
+450,9
@@
int invokemac(SYM *mac, WORD siz) {
// -------------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------------
//
-void ib_macro(void) {
- SYM *mac;
+void ib_macro(void)
+{
+ SYM * mac;
curmac = mac = newsym("mjump", MACRO, 0);
mac->svalue = 0;
curmac = mac = newsym("mjump", MACRO, 0);
mac->svalue = 0;
@@
-486,4
+488,4
@@
void ib_macro(void) {
defmac1(" .rept (\\size/2)", -1);
defmac1(" nop", -1);
defmac1(" .endr", -1);
defmac1(" .rept (\\size/2)", -1);
defmac1(" nop", -1);
defmac1(" .endr", -1);
-}
\ No newline at end of file
+}
diff --git
a/macro.h
b/macro.h
index bd4f14729be81e10c3db9742187105c1eecc48a1..8eeff449a676ebdc2bf6b51fbaa5f7fedef857a2 100644
(file)
--- a/
macro.h
+++ b/
macro.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACRO.H - Macro Definition and Invocation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MACRO.H - Macro Definition and Invocation
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __MACRO_H__
#define __MACRO_H__
#ifndef __MACRO_H__
#define __MACRO_H__
diff --git
a/mark.c
b/mark.c
index 855d925b253e31b5021c9cb970af2b294f919f43..407cded04918d14046bf4aef6c773846b54d3958 100644
(file)
--- a/
mark.c
+++ b/
mark.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MARK.C - A record of things that are defined relative to any of the sections
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MARK.C - A record of things that are defined relative to any of the sections
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "mark.h"
#include "error.h"
#include "mark.h"
#include "error.h"
diff --git
a/mark.h
b/mark.h
index 52b8410e099849511929b6ce749002b128ef3c0b..a5af238d2ea1d679389e1e3d5cad85ac0303079f 100644
(file)
--- a/
mark.h
+++ b/
mark.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MARK.H - A record of things that are defined relative to any of the sections
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// MARK.H - A record of things that are defined relative to any of the sections
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __MARK_H__
#define __MARK_H__
#ifndef __MARK_H__
#define __MARK_H__
@@
-15,7
+16,7
@@
#define MIN_MARK_MEM (3*sizeof(WORD)+2*sizeof(LONG))
// Globals, Externals etc
#define MIN_MARK_MEM (3*sizeof(WORD)+2*sizeof(LONG))
// Globals, Externals etc
-extern MCHUNK *firstmch;
+extern MCHUNK *
firstmch;
// Prototypes
void init_mark(void);
// Prototypes
void init_mark(void);
@@
-24,4
+25,4
@@
int rmark(int, LONG, int, int, SYM *);
int amark(void);
LONG bsdmarkimg(char *, LONG, LONG, int);
int amark(void);
LONG bsdmarkimg(char *, LONG, LONG, int);
-#endif // __MARK_H__
\ No newline at end of file
+#endif // __MARK_H__
diff --git
a/object.c
b/object.c
index b6a152008c195c02c42e74b354822fd0b4b631f4..1608edeb09bc3a3ef41d486c76b92fa779b90828 100644
(file)
--- a/
object.c
+++ b/
object.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// OBJECT.C - Writing Object Files
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// OBJECT.C - Writing Object Files
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "object.h"
#include "sect.h"
#include "object.h"
#include "sect.h"
diff --git
a/object.h
b/object.h
index 6d3776d6b11747d4f9c43a3105b00a19493138d7..01f4dadd2f1fcccb3bdefc3cfc72053d1c0db55f 100644
(file)
--- a/
object.h
+++ b/
object.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// OBJECT.H - Writing Object Files
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// OBJECT.H - Writing Object Files
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __OBJECT_H__
#define __OBJECT_H__
#ifndef __OBJECT_H__
#define __OBJECT_H__
diff --git
a/parmode.h
b/parmode.h
index 93852fc5b56d3135321dda47e3015075fae1b928..108959237367d88a77774b03df03bdf84ada9f64 100644
(file)
--- a/
parmode.h
+++ b/
parmode.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PARMODE.C - Addressing Modes Parser Include
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PARMODE.C - Addressing Modes Parser Include
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
// This file is included (twice) to parse two addressing modes, into slightly different var names
{
// This file is included (twice) to parse two addressing modes, into slightly different var names
{
diff --git
a/procln.c
b/procln.c
index 3f8ade52efae07fd977388411fcbd85009b8b970..f0abc54af621152b4ad92e72a53150c51c036d3a 100644
(file)
--- a/
procln.c
+++ b/
procln.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PROCLN.C - Line Processing
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PROCLN.C - Line Processing
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "procln.h"
#include "listing.h"
#include "procln.h"
#include "listing.h"
diff --git
a/procln.h
b/procln.h
index 254486709802bc0ea9717877cb4c705d3a2c5649..053e80316c114485db543aa916672a8c835f3a24 100644
(file)
--- a/
procln.h
+++ b/
procln.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PROCLN.H - Line Processing
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// PROCLN.H - Line Processing
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __PROCLN_H__
#define __PROCLN_H__
#ifndef __PROCLN_H__
#define __PROCLN_H__
@@
-32,4
+33,4
@@
int d_else(void);
int d_endif(void);
int at_eol(void);
int d_endif(void);
int at_eol(void);
-#endif // __PROCLN_H__
\ No newline at end of file
+#endif // __PROCLN_H__
diff --git
a/risca.c
b/risca.c
index 2545158f9b55f0e5fd6e0a13b52ab4c3d0be5784..5f658dc53f8a42b59a70c6d2993266e3cbdf5680 100644
(file)
--- a/
risca.c
+++ b/
risca.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// RISCA.C - GPU/DSP Assembler
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// RISCA.C - GPU/DSP Assembler
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "risca.h"
#include "error.h"
#include "risca.h"
#include "error.h"
diff --git
a/risca.h
b/risca.h
index 0c49cf54c58b4b8bfe4f4554b1dfa2c2b18aad26..4706bf28c1de07aff76e9753aaef225e49b0029c 100644
(file)
--- a/
risca.h
+++ b/
risca.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// RISCA.H - GPU/DSP Assembler
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// RISCA.H - GPU/DSP Assembler
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __RISCA_H__
#define __RISCA_H__
#ifndef __RISCA_H__
#define __RISCA_H__
@@
-56,4
+57,3
@@
int risccg(int);
int d_orgrisc(void);
#endif // __RISCA_H__
int d_orgrisc(void);
#endif // __RISCA_H__
-
diff --git
a/rmac.c
b/rmac.c
index e5474da4f2d8370ec1056168d0a9a1bd25af3654..0e7f94508a5f7a0365a02c243b424052dd8ba658 100644
(file)
--- a/
rmac.c
+++ b/
rmac.c
@@
-725,11
+725,11
@@
void interactive(void)
// As there is no command line, print a copyright message and prompt for command line
s = "*****************************************************\n";
// As there is no command line, print a copyright message and prompt for command line
s = "*****************************************************\n";
- printf("\n%s* RMAC - Reboot's Macro Assembler for Atari Jaguar *\n", s);
+ printf("\n%s* RMAC - Reboot's Macro Assembler for Atari Jaguar
*\n", s);
printf("* Copyright (C) 199x Landon Dyer, 2011 Reboot *\n");
printf("* Copyright (C) 199x Landon Dyer, 2011 Reboot *\n");
- printf("* Version %01i.%01i.%01i Platform: %-9s *\n",MAJOR,MINOR,PATCH,PLATFORM);
+ printf("* Version %01i.%01i.%01i Platform: %-9s
*\n",MAJOR,MINOR,PATCH,PLATFORM);
printf("* ------------------------------------------------- *\n");
printf("* ------------------------------------------------- *\n");
- printf("* INTERACTIVE MODE
*\n%s\n", s);
+ printf("* INTERACTIVE MODE
(press ENTER by itself to quit)
*\n%s\n", s);
perm_verb_flag = 1; // Enter permanent verbose mode
perm_verb_flag = 1; // Enter permanent verbose mode
@@
-740,7
+740,8
@@
void interactive(void)
printf("* ");
fflush(stdout); // Make prompt visible
printf("* ");
fflush(stdout); // Make prompt visible
- if (gets(ln) == NULL || !*ln) // Get input line
+// if (gets(ln) == NULL || !*ln) // Get input line
+ if (fgets(ln, LNSIZ, stdin) == NULL || !*ln) // Get input line
break;
argcnt = 0; // Process input line
break;
argcnt = 0; // Process input line
diff --git
a/rmac.h
b/rmac.h
index b3eb171df0c69a54fdd668e126f8ca8ee3f04eb0..58fba8dcfd5ef99bd1881206e27f3724c0ac3e35 100644
(file)
--- a/
rmac.h
+++ b/
rmac.h
@@
-117,27
+117,27
@@
#define SYM struct _sym
SYM
{
#define SYM struct _sym
SYM
{
- SYM *
snext;
// * -> Next symbol on hash-chain
- SYM *
sorder;
// * -> Next sym in order of refrence
- SYM *
sdecl; // * -> Next sym in order of decle
ration
+ SYM *
snext;
// * -> Next symbol on hash-chain
+ SYM *
sorder;
// * -> Next sym in order of refrence
+ SYM *
sdecl; // * -> Next sym in order of decla
ration
BYTE stype; // Symbol type
WORD sattr; // Attribute bits
LONG sattre; // Extended attribute bits
WORD senv; // Enviroment number
LONG svalue; // Symbol value
BYTE stype; // Symbol type
WORD sattr; // Attribute bits
LONG sattre; // Extended attribute bits
WORD senv; // Enviroment number
LONG svalue; // Symbol value
- char *
sname;
// * -> Symbol's print-name
+ char *
sname;
// * -> Symbol's print-name
};
// Pointer type that can point to (almost) anything
#define PTR union _ptr
PTR
{
};
// Pointer type that can point to (almost) anything
#define PTR union _ptr
PTR
{
- char *
cp;
// Char
- WORD *
wp;
// WORD
- LONG *
lp;
// LONG
+ char *
cp;
// Char
+ WORD *
wp;
// WORD
+ LONG *
lp;
// LONG
LONG lw; // LONG
LONG lw; // LONG
- SYM **
sy;
// SYM
- TOKEN *
tk;
// TOKEN
+ SYM **
sy;
// SYM
+ TOKEN *
tk;
// TOKEN
};
// Symbol spaces
};
// Symbol spaces
@@
-186,7
+186,7
@@
extern int rgpu, rdsp;
extern int err_flag;
extern int err_fd;
extern int regbank;
extern int err_flag;
extern int err_fd;
extern int regbank;
-extern char *firstfname;
+extern char *
firstfname;
extern int list_fd;
extern int as68_flag;
extern int list_flag;
extern int list_fd;
extern int as68_flag;
extern int list_flag;
@@
-199,16
+199,16
@@
extern int in_main;
// Prototypes
void init_sym(void);
// Prototypes
void init_sym(void);
-SYM *lookup(char *, int, int);
-SYM *newsym(char *, int, int);
-char *fext(char *, char *, int);
+SYM *
lookup(char *, int, int);
+SYM *
newsym(char *, int, int);
+char *
fext(char *, char *, int);
void cantcreat(char *);
int kmatch(char *, int *, int *, int *, int *);
void autoeven(int);
int nthpath(char *, int, char *);
void clear(char *, LONG);
void cantcreat(char *);
int kmatch(char *, int *, int *, int *, int *);
void autoeven(int);
int nthpath(char *, int, char *);
void clear(char *, LONG);
-char *copy(char *, char *, LONG);
-int rmac_qsort(char *, int, int, int
(*)());
-char *amem(LONG);
+char *
copy(char *, char *, LONG);
+int rmac_qsort(char *, int, int, int (*)());
+char *
amem(LONG);
#endif // __RMAC_H__
#endif // __RMAC_H__
diff --git
a/sect.c
b/sect.c
index 07170d820b27eb2e827b4b060ea51f17e276861e..3968dd57ed485331a8aee25001e95d05d8eb32db 100644
(file)
--- a/
sect.c
+++ b/
sect.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SECT.C - Code Generation, Fixups and Section Management
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SECT.C - Code Generation, Fixups and Section Management
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "sect.h"
#include "error.h"
#include "sect.h"
#include "error.h"
diff --git
a/sect.h
b/sect.h
index 7594056e165645055fc114d400db482c0d76a1a6..1322f52a7b4f9b88ed1881f179e7db15c6637876 100644
(file)
--- a/
sect.h
+++ b/
sect.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SECT.H - Code Generation, Fixups and Section Management
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SECT.H - Code Generation, Fixups and Section Management
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __SECT_H__
#define __SECT_H__
#ifndef __SECT_H__
#define __SECT_H__
@@
-143,4
+144,4
@@
int fixup(WORD, LONG, TOKEN *);
int fixups(void);
int resfix(int);
int fixups(void);
int resfix(int);
-#endif // __SECT_H__
\ No newline at end of file
+#endif // __SECT_H__
diff --git
a/symbol.c
b/symbol.c
index 855fe447b747198c09fc65560f42e96971dd158d..b82582ad4f699853402ff6bd474520690c414c05 100644
(file)
--- a/
symbol.c
+++ b/
symbol.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SYMBOL.C - Symbol Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SYMBOL.C - Symbol Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "symbol.h"
#include "listing.h"
#include "symbol.h"
#include "listing.h"
diff --git
a/symbol.h
b/symbol.h
index 899ba6aa13fa2ec90688ea5c8d74e90b73cf31b3..d94dd35ec65ea9a5dc075e3e33a34e66aae591d0 100644
(file)
--- a/
symbol.h
+++ b/
symbol.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SYMBOL.H - Symbol Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// SYMBOL.H - Symbol Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __SYMBOL_H__
#define __SYMBOL_H__
#ifndef __SYMBOL_H__
#define __SYMBOL_H__
@@
-18,13
+19,13
@@
extern int curenv;
extern char subttl[];
// Prototypes
extern char subttl[];
// Prototypes
-SYM *lookup(char *, int, int);
+SYM *
lookup(char *, int, int);
void init_sym(void);
void init_sym(void);
-SYM *newsym(char *, int, int);
-char *nstring(char *);
+SYM *
newsym(char *, int, int);
+char *
nstring(char *);
void sym_decl(SYM *);
int syg_fix(void);
int symtable(void);
int sy_assign(char *, char *(*)());
void sym_decl(SYM *);
int syg_fix(void);
int symtable(void);
int sy_assign(char *, char *(*)());
-#endif // __SYMBOL_H__
\ No newline at end of file
+#endif // __SYMBOL_H__
diff --git
a/token.c
b/token.c
index ad462f38d2a108f418509542674e5b00777701f6..225a25778a5f8ee335738fb0ff2dbaa9cb9dcdb0 100644
(file)
--- a/
token.c
+++ b/
token.c
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// TOKEN.C - Token Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// TOKEN.C - Token Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#include "token.h"
#include "symbol.h"
#include "token.h"
#include "symbol.h"
@@
-20,7
+21,7
@@
int curlineno; // Current line numb
int totlines; // Total # of lines
int mjump_align = 0; // mjump alignment flag
char lntag; // Line tag
int totlines; // Total # of lines
int mjump_align = 0; // mjump alignment flag
char lntag; // Line tag
-char *
curfname;
// Current filename
+char *
curfname;
// Current filename
char tolowertab[128]; // Uppercase ==> lowercase
char hextab[128]; // Table of hex values
char dotxtab[128]; // Table for ".b", ".s", etc.
char tolowertab[128]; // Uppercase ==> lowercase
char hextab[128]; // Table of hex values
char dotxtab[128]; // Table for ".b", ".s", etc.
@@
-28,24
+29,25
@@
char irbuf[LNSIZ]; // Text for .rept bl
char lnbuf[LNSIZ]; // Text of current line
WORD filecount; // Unique file number counter
WORD cfileno; // Current file number
char lnbuf[LNSIZ]; // Text of current line
WORD filecount; // Unique file number counter
WORD cfileno; // Current file number
-TOKEN *
tok;
// Ptr to current token
-TOKEN *
etok;
// Ptr past last token in tokbuf[]
+TOKEN *
tok;
// Ptr to current token
+TOKEN *
etok;
// Ptr past last token in tokbuf[]
TOKEN tokeol[1] = {EOL}; // Bailout end-of-line token
// File record, used to maintain a list of every include file ever visited
#define FILEREC struct _filerec
TOKEN tokeol[1] = {EOL}; // Bailout end-of-line token
// File record, used to maintain a list of every include file ever visited
#define FILEREC struct _filerec
-FILEREC {
- FILEREC *frec_next;
- char *frec_name;
+FILEREC
+{
+ FILEREC * frec_next;
+ char * frec_name;
};
};
-FILEREC *filerec;
-FILEREC *last_fr;
+FILEREC *
filerec;
+FILEREC *
last_fr;
-INOBJ *
cur_inobj;
// Ptr current input obj (IFILE/IMACRO)
-static INOBJ *
f_inobj;
// Ptr list of free INOBJs
-static IFILE *
f_ifile;
// Ptr list of free IFILEs
-static IMACRO *
f_imacro;
// Ptr list of free IMACROs
+INOBJ *
cur_inobj;
// Ptr current input obj (IFILE/IMACRO)
+static INOBJ *
f_inobj;
// Ptr list of free INOBJs
+static IFILE *
f_ifile;
// Ptr list of free IFILEs
+static IMACRO *
f_imacro;
// Ptr list of free IMACROs
static TOKEN tokbuf[TOKBUFSIZE]; // Token buffer (stack-like, all files)
static TOKEN tokbuf[TOKBUFSIZE]; // Token buffer (stack-like, all files)
@@
-99,13
+101,13
@@
char chrtab[] = {
};
// Names of registers
};
// Names of registers
-static char *regname[] = {
+static char *
regname[] = {
"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
"pc", "ssp", "usp", "sr", "ccr"
};
"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
"a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
"pc", "ssp", "usp", "sr", "ccr"
};
-static char *riscregname[] = {
+static char *
riscregname[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
@@
-116,7
+118,8
@@
static char *riscregname[] = {
// --- Make `fnum' the Current `curfname' ----------------------------------------------------------
//
// --- Make `fnum' the Current `curfname' ----------------------------------------------------------
//
-void setfnum(WORD fnum) {
+void setfnum(WORD fnum)
+{
FILEREC *fr;
for(fr = filerec; fr != NULL && fnum--; fr = fr->frec_next)
FILEREC *fr;
for(fr = filerec; fr != NULL && fnum--; fr = fr->frec_next)
@@
-132,7
+135,8
@@
void setfnum(WORD fnum) {
// --- Allocate an IFILE or IMACRO -----------------------------------------------------------------
//
// --- Allocate an IFILE or IMACRO -----------------------------------------------------------------
//
-INOBJ *a_inobj(int typ) {
+INOBJ * a_inobj(int typ)
+{
INOBJ *inobj;
IFILE *ifile;
IMACRO *imacro;
INOBJ *inobj;
IFILE *ifile;
IMACRO *imacro;
@@
-198,7
+202,8
@@
INOBJ *a_inobj(int typ) {
// -------------------------------------------------------------------------------------------------
//
// -------------------------------------------------------------------------------------------------
//
-int mexpand(char *src, char *dest, int destsiz) {
+int mexpand(char * src, char * dest, int destsiz)
+{
char *s;
char *d = NULL;
char *dst; // Next dest slot
char *s;
char *d = NULL;
char *dst; // Next dest slot
@@
-453,7
+458,8
@@
int mexpand(char *src, char *dest, int destsiz) {
// --- Get Next Line of Text from a Macro ----------------------------------------------------------
//
// --- Get Next Line of Text from a Macro ----------------------------------------------------------
//
-char *getmln(void) {
+char * getmln(void)
+{
IMACRO *imacro;
LONG *strp;
unsigned source_addr;
IMACRO *imacro;
LONG *strp;
unsigned source_addr;
@@
-489,7
+495,8
@@
char *getmln(void) {
// --- Get Next Line of Text from a Repeat Block ---------------------------------------------------
//
// --- Get Next Line of Text from a Repeat Block ---------------------------------------------------
//
-char *getrln(void) {
+char * getrln(void)
+{
IREPT *irept;
LONG *strp;
IREPT *irept;
LONG *strp;
@@
-498,7
+505,7
@@
char *getrln(void) {
// Do repeat at end of .rept block's string list
if(strp == NULL) {
// Do repeat at end of .rept block's string list
if(strp == NULL) {
- DEBUG printf("back-to-top-of-repeat-block count=%d\n", irept->ir_count);
+ DEBUG printf("back-to-top-of-repeat-block count=%d\n",
(int)
irept->ir_count);
irept->ir_nextln = irept->ir_firstln; // copy first line
if(irept->ir_count-- == 0) {
DEBUG printf("end-repeat-block\n");
irept->ir_nextln = irept->ir_firstln; // copy first line
if(irept->ir_count-- == 0) {
DEBUG printf("end-repeat-block\n");
@@
-519,7
+526,8
@@
char *getrln(void) {
// --- Include a Source File used at the Root, and for ".include" Files ----------------------------
//
// --- Include a Source File used at the Root, and for ".include" Files ----------------------------
//
-int include(int handle, char *fname) {
+int include(int handle, char * fname)
+{
IFILE *ifile;
INOBJ *inobj;
FILEREC *fr;
IFILE *ifile;
INOBJ *inobj;
FILEREC *fr;
@@
-556,7
+564,8
@@
int include(int handle, char *fname) {
// --- Initialize Tokenizer ------------------------------------------------------------------------
//
// --- Initialize Tokenizer ------------------------------------------------------------------------
//
-void init_token(void) {
+void init_token(void)
+{
int i; // Iterator
char *htab = "0123456789abcdefABCDEF"; // Hex character table
int i; // Iterator
char *htab = "0123456789abcdefABCDEF"; // Hex character table
@@
-602,7
+611,8
@@
void init_token(void) {
//
// --- Pop the Current Input Level -----------------------------------------------------------------
//
//
// --- Pop the Current Input Level -----------------------------------------------------------------
//
-int fpop(void) {
+int fpop(void)
+{
INOBJ *inobj;
IFILE *ifile;
IMACRO *imacro;
INOBJ *inobj;
IFILE *ifile;
IMACRO *imacro;
@@
-658,7
+668,8
@@
int fpop(void) {
// --- Get line from file into buf, return NULL on EOF or ptr to the start of a null-term line -----
//
// --- Get line from file into buf, return NULL on EOF or ptr to the start of a null-term line -----
//
-char *getln(void) {
+char * getln(void)
+{
IFILE *fl;
int i, j;
char *p, *d;
IFILE *fl;
int i, j;
char *p, *d;
@@
-729,7
+740,8
@@
char *getln(void) {
// --- Tokenize a Line -----------------------------------------------------------------------------
//
// --- Tokenize a Line -----------------------------------------------------------------------------
//
-int tokln(void) {
+int tokln(void)
+{
char *ln = NULL; // Ptr to current position in line
char *p; // Random character ptr
TOKEN *tk; // Token-deposit ptr
char *ln = NULL; // Ptr to current position in line
char *p; // Random character ptr
TOKEN *tk; // Token-deposit ptr
@@
-1156,7
+1168,8
@@
int tokln(void) {
//
//int d_goto(WORD siz) {
//
//int d_goto(WORD siz) {
-int d_goto(void) {
+int d_goto(void)
+{
char *sym; // Label to search for
LONG *defln; // Macro definition strings
char *s1; // Temps for string comparison
char *sym; // Label to search for
LONG *defln; // Macro definition strings
char *s1; // Temps for string comparison
diff --git
a/token.h
b/token.h
index 1f57c905589428db0bf95ca7054f6ee0aa36d898..938e4b27ebf9e9aaee3aa68361b96cacd0b6fe92 100644
(file)
--- a/
token.h
+++ b/
token.h
@@
-1,9
+1,10
@@
-//
//////////////////////////////////////////////////////////////////////////////////////////////////
+//
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// TOKEN.H - Token Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
// TOKEN.H - Token Handling
// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source Utilised with the Kind Permission of Landon Dyer
+//
#ifndef __TOKEN_H__
#define __TOKEN_H__
#ifndef __TOKEN_H__
#define __TOKEN_H__
@@
-152,4
+153,4
@@
int fpop(void);
int d_goto(void);
INOBJ *a_inobj(int);
int d_goto(void);
INOBJ *a_inobj(int);
-#endif // __TOKEN_H__
\ No newline at end of file
+#endif // __TOKEN_H__