[Oberon] Why is RSC string data word-aligned?
andreas_pirklbauer at yahoo.com
Sun Jan 31 11:11:11 CET 2021
> The unaligned data in a .rsc file is, I agree, unfortunate, as it could
> have been aligned relatively easily and then data could have been
> copied into memory a word at a time.
Isn’t any data - including string data . already word-aligned in the
compiler (and therefore also in the .rsc file)?
1. The array ORG.str itself is word-aligned, because...
- Modules.AllocPtr is word-aligned (see Modules.Load)
- Modules.DescSize is a multiple of 4, so mod.data is word-aligned
- All type descriptors are word-aligned (see ORG.BuildTD)
- All variables are word-aligned (see ORG.Declarations)
- All strings are word-aligned (see ORG.MakeStringItem)
WHILE strx MOD 4 # 0 DO str[strx] := 0X; INC(strx) END
IF sym = ORS.var THEN
IF tp.size > 1 THEN varsize := (varsize + 3) DIV 4 * 4 (*align*) END ;
varsize := (varsize + 3) DIV 4 * 4;
More information about the Oberon