[Pythonmac-SIG] Read Strings from Resources
Larry Bugbee
bugbee at seanet.com
Thu Dec 23 18:36:35 CET 2004
For the useless? trivia department...
>>> So it looks like a 2-byte count followed by an array of Pascal
>>> strings.
>>
>> Ah yes. And now that I see this I seem to remember that the pstrings
>> are padded to a 2-byte boundary.
>
> Hmmm, I'd be a bit surprised if there was such alignment padding.
> Pascal string lengths are one byte, so after the single integer
> listed above everything else should just be byte-aligned.
Most Pascals including UCSD Pascal had a single byte string length
limiting strings to a maximum of 255. A real pain.
The "old" 8 and 16-bit processors saved cycles fetching things from
memory if aligned to "word" boundaries. In those days a word was
typically 16 bits.
Then came 32 and now 64. Tomorrow infinity? Actually some of the
earliest machines like the IBM 1620 had variable word lengths.
FWIW....
Larry
More information about the Pythonmac-SIG
mailing list