%%
-line : /* empty */
- | line statement {
+line : line_terminator {
+ /* empty */
+ }
+ | line statement line_terminator {
struct statement *s = $2;
if (section != SECTION_TEXT)
yyerror("Microcode text instruction in non .text section");
memcpy(&s->info, &cur_lineinfo, sizeof(struct lineinfo));
list_add_tail(&s->list, &infile.sl);
}
- | line section_switch {
+ | line section_switch line_terminator {
}
- | line ivals_write {
+ | line ivals_write line_terminator {
struct initval_op *io = $2;
if (section != SECTION_IVALS)
yyerror("InitVals write in non .initvals section");
}
;
+/* Allow terminating lines with the "|" char */
+line_terminator : /* Nothing */
+ | BITW_OR line_terminator
+
section_switch : SECTION_TEXT {
section = SECTION_TEXT;
}
^{WS}*"%"{WS}*arch { update_lineinfo(); return ASM_ARCH; }
^{WS}*"%"{WS}*start { update_lineinfo(); return ASM_START; }
-^{WS}*\.text{WS}*$ { update_lineinfo(); return SECTION_TEXT; }
-^{WS}*\.initvals/\({IDENTIFIER}\){WS}*{NEWLINE} { update_lineinfo(); return SECTION_IVALS; }
+^{WS}*\.text{WS}*$ { update_lineinfo(); return SECTION_TEXT; }
+^{WS}*\.initvals/\({IDENTIFIER}\) { update_lineinfo(); return SECTION_IVALS; }
spr[0-9a-fA-F]{3,3} { update_lineinfo(); return SPR; }
r/([0-9]|([1-5][0-9])|(6[0-3])) { update_lineinfo(); return GPR; }
or spr06c,0,spr06c ; Can have one spr input and one spr output
or [0],0,[0] ; Can have one mem input and one mem output
mov testlabel, r0 ; Can use label as immediate value
+ mov r0,r1|mov r2, r3 ; | does also seperate instructions
; The .initvals section generates an "Initial Values" file