#define UPSEG_SIZE 0x10010L // size of 6502 code buffer, 64K+16bytes
-//
+// Internal vars
+static uint16_t orgmap[1024][2]; // Mark all 6502 org changes
+
// Exported vars
-//
const char in_6502mode[] = "directive illegal in .6502 section";
-static uint16_t orgmap[1024][2]; // Mark all 6502 org changes
uint16_t * currentorg = &orgmap[0][0]; // Current org range
//
// y,foo
//
p = string[tok[1]];
-
+ // ggn: the following code is effectively disabled as it would make
+ // single letter labels not work correctly (would not identify the
+ // label properly). And from what I understand it's something to
+ // keep compatibility with the coinop assembler which is probably
+ // something we don't care about much :D
+#if 0
if (*tok == SYMBOL && p[1] == EOS && tok[2] == ',')
{
tok += 3; // Past: SYMBOL <string> ','
}
not_coinop:
+#endif
if (expr(exprbuf, &eval, &eattr, NULL) < 0)
return;
// Generate 6502 object output file.
//
// ggn: converted into a com/exe/xex output format
-// Notes: 1. The $FFFF is only mandatory for the first segment, but let's dump it everywhere for now
-// 2. It's still dumping pages instead of more fine grained stuff. Should look into this - a8 people don't like waste so much ;)
+// Notes: 1. The $FFFF is only mandatory for the first segment, but let's
+// dump it everywhere for now
+// 2. It's still dumping pages instead of more fine grained stuff.
+// Should look into this - a8 people don't like waste so much ;)
void m6502obj(int ofd)
{
uint16_t exeheader[3];
{
exeheader[1] = l[0];
exeheader[2] = l[1] - 1;
- size_t unused = write(ofd, headpoint, headsize); // Write header
+
+ // Write header
+ size_t unused = write(ofd, headpoint, headsize);
unused = write(ofd, p + l[0], l[1] - l[0]);
- headpoint = &exeheader[1]; // Skip the $FFFF after first segment, it's not mandatory
+
+ // Skip the $FFFF after first segment, it's not mandatory
+ headpoint = &exeheader[1];
headsize = 4;
}
}
# Build RMAC executable
#
+6502.o : 6502.c 6502.h
+ $(CC) $(CFLAGS) -c 6502.c
+
amode.o : amode.c amode.h
$(CC) $(CFLAGS) -c amode.c
symbol.o : symbol.c symbol.h
$(CC) $(CFLAGS) -c symbol.c
-6502.o : 6502.c 6502.h
- $(CC) $(CFLAGS) -c 6502.c
-
token.o : token.c token.h
$(CC) $(CFLAGS) -c token.c
clean:
$(rm) $(OBJS) kwgen.o 68kgen.o rmac kwgen 68kgen kwtab.h 68ktab.h mntab.h risckw.h 6502kw.h
+#
+# Dependencies
+#
+6502.o: 6502.c direct.h rmac.h symbol.h expr.h error.h mach.h amode.h \
+ procln.h token.h riscasm.h sect.h
+68kgen.o: 68kgen.c
+amode.o: amode.c amode.h rmac.h symbol.h error.h token.h expr.h kwtab.h \
+ mntab.h parmode.h
+debug.o: debug.c debug.h rmac.h symbol.h amode.h direct.h mark.h sect.h \
+ token.h
+direct.o: direct.c direct.h rmac.h symbol.h 6502.h error.h expr.h \
+ listing.h mach.h amode.h macro.h mark.h procln.h token.h riscasm.h \
+ sect.h kwtab.h
+eagen.o: eagen.c eagen.h rmac.h symbol.h amode.h sect.h mark.h error.h \
+ mach.h riscasm.h eagen0.c
+error.o: error.c error.h rmac.h symbol.h token.h listing.h
+expr.o: expr.c expr.h rmac.h symbol.h direct.h error.h listing.h mach.h \
+ amode.h procln.h token.h riscasm.h sect.h kwtab.h
+kwgen.o: kwgen.c
+listing.o: listing.c listing.h rmac.h symbol.h version.h token.h procln.h \
+ sect.h error.h
+mach.o: mach.c mach.h amode.h rmac.h symbol.h eagen.h error.h direct.h \
+ procln.h token.h riscasm.h sect.h kwtab.h 68ktab.h
+macro.o: macro.c macro.h rmac.h symbol.h debug.h direct.h error.h expr.h \
+ listing.h procln.h token.h
+mark.o: mark.c mark.h rmac.h symbol.h error.h object.h riscasm.h sect.h
+object.o: object.c object.h rmac.h symbol.h error.h mark.h riscasm.h \
+ sect.h
+procln.o: procln.c procln.h rmac.h symbol.h token.h 6502.h amode.h \
+ direct.h error.h expr.h listing.h mach.h macro.h riscasm.h sect.h \
+ kwtab.h mntab.h risckw.h 6502kw.h
+riscasm.o: riscasm.c riscasm.h rmac.h symbol.h amode.h direct.h error.h \
+ expr.h mark.h procln.h token.h sect.h risckw.h kwtab.h
+rmac.o: rmac.c rmac.h symbol.h 6502.h debug.h direct.h error.h expr.h \
+ listing.h mark.h macro.h object.h procln.h token.h riscasm.h sect.h \
+ version.h
+sect.o: sect.c sect.h rmac.h symbol.h 6502.h direct.h error.h expr.h \
+ listing.h mach.h amode.h mark.h riscasm.h token.h
+symbol.o: symbol.c symbol.h error.h rmac.h listing.h object.h procln.h \
+ token.h
+token.o: token.c token.h rmac.h symbol.h error.h macro.h procln.h sect.h \
+ kwtab.h
+