8585 DOT_SET " .set"
8686 DOT_OUT " .out"
8787 DOT_IN " .in"
88+ DOT " ."
8889
8990 JMP " jmp"
9091 WAIT " wait"
@@ -203,8 +204,8 @@ directive:
203204 | DOT_OUT value direction autop threshold { pioasm.get_current_program(@1 , " .out" , true ).set_out(@$ , $2 , $3 , $4 , $5 ); }
204205 | DOT_SET value { pioasm.get_current_program(@1 , " .set" , true ).set_set_count(@$ , $2 ); }
205206 | WRAP_TARGET { pioasm.get_current_program(@1 , " .wrap_target" ).set_wrap_target(@$ ); }
207+ | WRAP expression { pioasm.get_current_program(@1 , " .wrap" ).set_wrap(@$ , $2 ); }
206208 | WRAP { pioasm.get_current_program(@1 , " .wrap" ).set_wrap(@$ ); }
207- | WORD value { pioasm.get_current_program(@1 , " instruction" ).add_instruction(std::shared_ptr<instruction>(new instr_word(@$ , $2 ))); }
208209 | LANG_OPT NON_WS NON_WS ASSIGN INT { pioasm.get_current_program(@1 , " .lang_opt" ).add_lang_opt($2 , $3 , std::to_string($5 )); }
209210 | LANG_OPT NON_WS NON_WS ASSIGN STRING { pioasm.get_current_program(@1 , " .lang_opt" ).add_lang_opt($2 , $3 , $5 ); }
210211 | LANG_OPT NON_WS NON_WS ASSIGN NON_WS { pioasm.get_current_program(@1 , " .lang_opt" ).add_lang_opt($2 , $3 , $5 ); }
@@ -224,6 +225,7 @@ directive:
224225/* value is a more limited top level expression... requiring parenthesis */
225226%type <std::shared_ptr<resolvable>> value;
226227value : INT { $$ = resolvable_int(@$ , $1 ); }
228+ | DOT { $$ = resolvable_int(@$ , pioasm.get_current_program(@1 , " ." ).instructions.size()); }
227229 | ID { $$ = std::shared_ptr<resolvable>(new name_ref(@$ , $1 )); }
228230 | LPAREN expression RPAREN { $$ = $2 ; }
229231
@@ -257,7 +259,8 @@ instruction:
257259
258260%type <std ::shared_ptr <instruction >> base_instruction ;
259261base_instruction :
260- NOP { $$ = std::shared_ptr<instruction>(new instr_nop(@$ )); }
262+ WORD value { $$ = std::shared_ptr<instruction>(new instr_word(@$ , $2 )); }
263+ | NOP { $$ = std::shared_ptr<instruction>(new instr_nop(@$ )); }
261264 | JMP condition comma expression { $$ = std::shared_ptr<instruction>(new instr_jmp(@$ , $2 , $4 )); }
262265 | WAIT value wait_source { $$ = std::shared_ptr<instruction>(new instr_wait(@$ , $2 , $3 )); }
263266 | WAIT wait_source { $$ = std::shared_ptr<instruction>(new instr_wait(@$ , resolvable_int(@$ , 1 ), $2 )); }
0 commit comments