.SH ASSEMBLY SYNTAX
+
+.SH EXPRESSION SYNTAX
+
+Expressions are written in Reverse Polish Notation style and evaluated based on their expected data type.
+For example when an expression expects an int type the expression will assume all values that are pushed to it
+are integers.
+
+.SH ASSEMBLY DIRECTIVES
+
+During assembly sometimes it is required to set certain parameters of the assembler such as the base address (represented by the $@ symbol in expressions).
+
+Valid directives:
+
+ \.org <expression>
+ Sets the base address
+
.SH EXAMPLES
.SH SEE ALSO
* -1 denotes a NULL value
*/
-enum ulas_exprs { ULAS_EXPUNARY, ULAS_EXPBINARY, ULAS_EXPLITERAL };
+enum ulas_exprs { ULAS_EXPUN, ULAS_EXPBIN, ULAS_EXPLIT, ULAS_EXPGRP };
struct ulas_expun {
long expr;
long tok;
};
+struct ulas_expgrp {
+ // points to the first expression
+ // in this group
+ long expr;
+ // how many expressions belong to the group
+ long len;
+};
+
union ulas_expval {
struct ulas_expun un;
struct ulas_expbin bin;
struct ulas_explit lit;
+ struct ulas_expgrp grp;
};
struct ulas_expr {