# ulas
-Unlink's light assembler is a C99 assembler for the 6502 without any external dependencies.
+Unlink's light assembler is a C99 assembler without any external dependencies.
## Table of content
-v, --verbose
verbose output
-.SH SYNTAX
+.SH PREPROCESSOR
+
+The preprocessor is a text based way of modifying the input before
+the assembly step.
+
+Withing preprocessor macros
+- $0 will expand to the literal argument string
+- $1 to $9 will expand to the comma separated arguments of the macro
+- $$ will expand to an internal macro call counter which can be used to make labels
+ that are expanded by a macro unique.
+
+Macros:
+
+#macro
+label$$:
+ adc $1, $2
+#endm
+
+.SH ASSEMBLY SYNTAX
union ulas_tokdat dat;
};
+enum ulas_ppdirs {
+ ULAS_PP_DEF,
+ ULAS_PP_MACRO,
+};
+
+struct ulas_ppdir {
+ enum ulas_ppdirs type;
+};
+
+/**
+ * Symbols
+ */
+
+struct ulas_sym {
+ const char *name;
+};
+
/**
* Expressions
*/
int ulas_main(struct ulas_config cfg);
+/**
+ * Tokenize and apply the preprocessor
+ */
+int ulas_preproc(FILE *dst, FILE *src);
+
char *ulas_strndup(const char *src, size_t n);
#endif
return 0;
}
+
+int ulas_preproc(FILE *dst, FILE *src) {}