return 0;
}
+int ulas_asmdirbank(FILE *dst, FILE *src, const char **line,
+ unsigned long n, int *rc) {
+ ULAS_EVALEXPRS(ulas.bank = ulas_intexpr(line, strnlen(*line, n), rc));
+ return *rc;
+}
+
int ulas_asmline(FILE *dst, FILE *src, const char *line, unsigned long n) {
// this buffer is written both to dst and to verbose output
char outbuf[ULAS_OUTBUFMAX];
ULAS_ASMSTR_CHR,
ULAS_ASMSTR_REP,
ULAS_ASMSTR_SECTION,
+ ULAS_ASMSTR_BANK,
NULL};
enum ulas_asmdir dirs[] = {
ULAS_ASMDIR_ORG, ULAS_ASMDIR_SET,
ULAS_ASMDIR_CHKSM, ULAS_ASMDIR_ADV,
ULAS_ASMDIR_SET_ENUM_DEF, ULAS_ASMDIR_DEFINE_ENUM,
ULAS_ASMDIR_SETCHRCODE, ULAS_ASMDIR_CHR,
- ULAS_ASMDIR_REP, ULAS_ASMDIR_SECTION};
+ ULAS_ASMDIR_REP, ULAS_ASMDIR_SECTION, ULAS_ASMDIR_BANK};
enum ulas_asmdir dir = ULAS_ASMDIR_NONE;
case ULAS_ASMDIR_SECTION:
rc = ulas_asmdirsection(dst, src, &line, n);
break;
+ case ULAS_ASMDIR_BANK:
+ rc = ulas_asmdirbank(dst, src, &line, n, &rc);
+ break;
case ULAS_ASMDIR_PAD:
// TODO: pad is the same as .fill n, $ - n
case ULAS_ASMDIR_NONE:
#define ULAS_ASMSTR_CHR ".chr"
#define ULAS_ASMSTR_REP ".rep"
#define ULAS_ASMSTR_SECTION ".section"
+#define ULAS_ASMSTR_BANK ".bank"
// configurable tokens
#define ULAS_TOK_COMMENT ';'
// .section <name>
// set the current section
ULAS_ASMDIR_SECTION,
+
+ // .bank <banknum>
+ // sets the current bank number
+ ULAS_ASMDIR_BANK
};
#define ULAS_INSTRTOKMAX 16