Implement mid-section alignment directive

Fixes #254.
This commit is contained in:
ISSOtm
2020-04-08 12:28:53 +02:00
parent 2b0c34ecb5
commit 665412c073
7 changed files with 65 additions and 0 deletions

View File

@@ -774,6 +774,26 @@ simple_pseudoop : include
| popo
| pusho
| opt
| align
;
align : T_OP_ALIGN uconst {
if ($2 > 16)
yyerror("Alignment must be between 0 and 16, not %u",
$2);
else
sect_AlignPC($2, 0);
}
| T_OP_ALIGN uconst ',' uconst {
if ($2 > 16)
yyerror("Alignment must be between 0 and 16, not %u",
$2);
else if ($4 >= 1 << $2)
yyerror("Offset must be between 0 and %u, not %u",
(1 << $2) - 1, $4);
else
sect_AlignPC($2, $4);
}
;
opt : T_POP_OPT {