From: Shamus Hammons Date: Fri, 21 Apr 2017 18:59:50 +0000 (-0500) Subject: Version bump for last commit. ;-) X-Git-Tag: v2.1.0~134 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=968958cccf9201debee2cb0d4856cb5b55c6867d Version bump for last commit. ;-) --- diff --git a/6502.c b/6502.c index 099c89d..8141abe 100644 --- a/6502.c +++ b/6502.c @@ -162,8 +162,9 @@ static char a8internal[] = 'y', 121, 'z', 122 }; + // -// initialize 6502 assembler +// Initialize 6502 assembler // void Init6502() { @@ -203,26 +204,26 @@ 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(; pchptr, 0, UPSEG_SIZE); + } + + SwitchSection(TEXT); // Go back to TEXT } + // // .6502 --- enter 6502 mode // diff --git a/6502.h b/6502.h index acf9ded..56c20e9 100644 --- a/6502.h +++ b/6502.h @@ -12,6 +12,7 @@ // Exported variables extern const char in_6502mode[]; extern uint16_t * currentorg; // Current org range +extern char strtoa8[]; // Exported functions extern void Init6502(); diff --git a/direct.c b/direct.c index b7dfb85..aebe566 100644 --- a/direct.c +++ b/direct.c @@ -990,20 +990,20 @@ int d_dc(WORD siz) 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; diff --git a/direct.h b/direct.h index 7b4625a..d4b22ce 100644 --- a/direct.h +++ b/direct.h @@ -15,7 +15,7 @@ extern TOKEN exprbuf[]; extern SYM * symbolPtr[]; extern int (* dirtab[])(); -extern char strtoa8[]; +extern int stringtype; // Exported functions void auto_even(void); diff --git a/sect.c b/sect.c index cbb1518..7a6f9e1 100644 --- a/sect.c +++ b/sect.c @@ -47,26 +47,26 @@ PTR fchptr; // Deposit point in fixup chunk buffer // 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 }; @@ -116,7 +116,7 @@ void SwitchSection(int sno) cursect = sno; SECT * p = §[sno]; - m6502 = (sno == M6502); /* set 6502-mode */ + m6502 = (sno == M6502); // Set 6502-mode flag // Copy section vars scattr = p->scattr; @@ -130,11 +130,10 @@ void SwitchSection(int sno) 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; diff --git a/token.c b/token.c index 1ef99cf..00ead96 100644 --- a/token.c +++ b/token.c @@ -7,6 +7,7 @@ // #include "token.h" +#include "direct.h" #include "error.h" #include "macro.h" #include "procln.h" @@ -1161,7 +1162,8 @@ if (debug) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); // Handle multiple-character tokens if (c & MULTX) { - stringtype = 0; + stringtype = 0; + switch (*ln++) { case '!': // ! or != @@ -1175,11 +1177,10 @@ if (debug) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); 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; diff --git a/token.h b/token.h index aaa4fd6..f5910d3 100644 --- a/token.h +++ b/token.h @@ -154,7 +154,6 @@ extern char tolowertab[]; extern INOBJ * cur_inobj; extern int mjump_align; extern char * string[]; -extern int stringtype; // Exported functions int include(int, char *); diff --git a/version.h b/version.h index f5be1b8..48316ae 100644 --- a/version.h +++ b/version.h @@ -15,7 +15,7 @@ #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__