Document new intra-section align

Also sneak in two code style fixes forgotten in last commit
This commit is contained in:
ISSOtm
2020-04-08 15:01:36 +02:00
parent 665412c073
commit 9e3d8b22cb
2 changed files with 42 additions and 13 deletions

View File

@@ -363,12 +363,14 @@ void sect_AlignPC(uint8_t alignment, uint16_t offset)
yyerror("Section's fixed address fails required alignment (PC = $%04x)",
sym_GetValue(pPCSymbol));
} else if (sect->nAlign != 0) {
if ((((sect->alignOfs + curOffset) % (1 << sect->nAlign)) - offset) % (1 << alignment)) {
if ((((sect->alignOfs + curOffset) % (1 << sect->nAlign))
- offset) % (1 << alignment)) {
yyerror("Section's alignment fails required alignment (offset from section start = $%04x)",
curOffset);
} else if (alignment > sect->nAlign) {
sect->nAlign = alignment;
sect->alignOfs = (offset - curOffset) % (1 << alignment);
sect->alignOfs =
(offset - curOffset) % (1 << alignment);
}
} else {
sect->nAlign = alignment;