'y', 121, 'z', 122
};
+
//
-// initialize 6502 assembler
+// Initialize 6502 assembler
//
void Init6502()
{
// Set up first org section (set to zero)
orgmap[0][0] = 0;
- SwitchSection(M6502); // Switch to 6502 section
- //
- // Initialise string conversion table(s)
- //
-
- char *p = a8internal;
- memset(strtoa8, 31, 128); // 31=fallback value ("?")
- for (; p < a8internal + sizeof(a8internal); p += 2)
- {
- strtoa8[p[0]] = p[1];
- }
-
- if (challoc == 0) {
- // Allocate and clear 64K of space for the 6502 section
- chcheck(UPSEG_SIZE);
- memset(sect[M6502].scode->chptr, 0, UPSEG_SIZE);
- }
- SwitchSection(TEXT); // Go back to TEXT
+ SwitchSection(M6502); // Switch to 6502 section
+
+ // Initialise string conversion table(s)
+ char * p = a8internal;
+ memset(strtoa8, 31, 128); // 31=fallback value ("?")
+
+ for(; p<a8internal+sizeof(a8internal); p+=2)
+ strtoa8[p[0]] = p[1];
+
+ if (challoc == 0)
+ {
+ // Allocate and clear 64K of space for the 6502 section
+ chcheck(UPSEG_SIZE);
+ memset(sect[M6502].scode->chptr, 0, UPSEG_SIZE);
+ }
+
+ SwitchSection(TEXT); // Go back to TEXT
}
+
//
// .6502 --- enter 6502 mode
//
// Exported variables
extern const char in_6502mode[];
extern uint16_t * currentorg; // Current org range
+extern char strtoa8[];
// Exported functions
extern void Init6502();
if ((challoc - ch_size) < i)
chcheck(i);
- if (stringtype == NORMAL)
- {
- for (p = string[tok[1]]; *p != EOS; p++)
- D_byte(*p);
- }
- else if(stringtype == A8INT)
- {
- for (p = string[tok[1]]; *p != EOS; p++)
- D_byte(strtoa8[*p]);
- }
- else
- {
- error("String format not supported yet");
- }
+ if (stringtype == NORMAL)
+ {
+ for(p=string[tok[1]]; *p!=EOS; p++)
+ D_byte(*p);
+ }
+ else if(stringtype == A8INT)
+ {
+ for(p=string[tok[1]]; *p!=EOS; p++)
+ D_byte(strtoa8[*p]);
+ }
+ else
+ {
+ error("String format not supported... yet");
+ }
tok += 2;
extern TOKEN exprbuf[];
extern SYM * symbolPtr[];
extern int (* dirtab[])();
-extern char strtoa8[];
+extern int stringtype;
// Exported functions
void auto_even(void);
// Return a size (SIZB, SIZW, SIZL) or 0, depending on what kind of fixup is
// associated with a location.
static uint8_t fusiztab[] = {
- 0, // FU_QUICK
- 1, // FU_BYTE
- 2, // FU_WORD
- 2, // FU_WBYTE
- 4, // FU_LONG
- 1, // FU_BBRA
- 0, // (unused)
- 1, // FU_6BRA
+ 0, // FU_QUICK
+ 1, // FU_BYTE
+ 2, // FU_WORD
+ 2, // FU_WBYTE
+ 4, // FU_LONG
+ 1, // FU_BBRA
+ 0, // (unused)
+ 1, // FU_6BRA
};
// Offset to REAL fixup location
static uint8_t fusizoffs[] = {
- 0, // FU_QUICK
- 0, // FU_BYTE
- 0, // FU_WORD
- 1, // FU_WBYTE
- 0, // FU_LONG
- 1, // FU_BBRA
- 0, // (unused)
- 0, // FU_6BRA
+ 0, // FU_QUICK
+ 0, // FU_BYTE
+ 0, // FU_WORD
+ 1, // FU_WBYTE
+ 0, // FU_LONG
+ 1, // FU_BBRA
+ 0, // (unused)
+ 0, // FU_6BRA
};
cursect = sno;
SECT * p = §[sno];
- m6502 = (sno == M6502); /* set 6502-mode */
+ m6502 = (sno == M6502); // Set 6502-mode flag
// Copy section vars
scattr = p->scattr;
challoc = cp->challoc;
ch_size = cp->ch_size;
chptr = cp->chptr + ch_size;
- if (m6502)
- {
- // For 6502 mode, add the last org'd address
- chptr = cp->chptr + orgaddr;
- }
+
+ // For 6502 mode, add the last org'd address
+ if (m6502)
+ chptr = cp->chptr + orgaddr;
}
else
challoc = ch_size = 0;
//
#include "token.h"
+#include "direct.h"
#include "error.h"
#include "macro.h"
#include "procln.h"
// Handle multiple-character tokens
if (c & MULTX)
{
- stringtype = 0;
+ stringtype = 0;
+
switch (*ln++)
{
case '!': // ! or !=
continue;
case '\'': // 'string'
- if (m6502)
- {
- stringtype = A8INT; // hardcoded for now, maybe this will change in the future
- }
- // Fall through
+ if (m6502)
+ stringtype = A8INT; // hardcoded for now, maybe this will change in the future
+
+ // Fall through
case '\"': // "string"
c1 = ln[-1];
*tk++ = STRING;
extern INOBJ * cur_inobj;
extern int mjump_align;
extern char * string[];
-extern int stringtype;
// Exported functions
int include(int, char *);
#define MAJOR 1 // Major version number
#define MINOR 6 // Minor version number
-#define PATCH 1 // Patch release number
+#define PATCH 2 // Patch release number
#endif // __VERSION_H__