/* */
/* */
/* */
-/* (C) 1998-2005, Ullrich von Bassewitz */
-/* Römerstraße 52 */
+/* (C) 1998-2007, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
+static void ExportWithAssign (SymEntry* Sym, unsigned char AddrSize, unsigned Flags)
+/* Allow to assign the value of an export in an .export statement */
+{
+ /* The name and optional address size spec may be followed by an assignment
+ * or equal token.
+ */
+ if (Tok == TOK_ASSIGN || Tok == TOK_EQ) {
+
+ /* Assignment means the symbol is a label */
+ if (Tok == TOK_ASSIGN) {
+ Flags |= SF_LABEL;
+ }
+
+ /* Skip the assignment token */
+ NextTok ();
+
+ /* Define the symbol with the expression following the '=' */
+ SymDef (Sym, Expression(), ADDR_SIZE_DEFAULT, Flags);
+
+ }
+
+ /* Now export the symbol */
+ SymExport (Sym, AddrSize, Flags);
+}
+
+
+
static void ExportImport (void (*Func) (SymEntry*, unsigned char, unsigned),
unsigned char DefAddrSize, unsigned Flags)
/* Export or import symbols */
static void DoExport (void)
/* Export a symbol */
{
- ExportImport (SymExport, ADDR_SIZE_DEFAULT, SF_NONE);
+ ExportImport (ExportWithAssign, ADDR_SIZE_DEFAULT, SF_NONE);
}
static void DoExportZP (void)
/* Export a zeropage symbol */
{
- ExportImport (SymExport, ADDR_SIZE_ZP, SF_NONE);
+ ExportImport (ExportWithAssign, ADDR_SIZE_ZP, SF_NONE);
}
Error ("Range error");
return;
}
- SetAbsPC (PC);
+ EnterAbsoluteMode (PC);
}
static void DoReloc (void)
/* Enter relocatable mode */
{
- RelocMode = 1;
+ EnterRelocMode ();
}