[Oberon] System V5 - Oberon Strings Compiler Pattern

Jörg Straube joerg.straube at iaeth.ch
Mon Apr 11 21:37:46 CEST 2016


Indeed, implementation of Oberon strings is different than Strings in Pascal. They are NUL terminated and padded to 32 bit boundary.

Jörg

> Am 11.04.2016 um 20:29 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> Hi,
> 
> I am still reading PO.Applications, chapters on Compiler.
> Looking at strings sample code pattern:
> 
> BEGIN
> s0 := "ABCDEF"; 
> ...
> ADD R0 SB 0 @s0 
> ADD R1 SB 64 @"ABCDEF" 
> LDR R2 R1 0 
> ADD R1 R1 4 
> STR R2 R0 0 
> ADD R0 R0 4 
> ASR R2 R2 24 test for 0X 
> BNE -6 
> ...
> 
> My understanding is that strings are copied/assigned by 4 bytes (long
> words) at a time in a loop that ends when 0X (NULL) is found. This may
> also impose Strings of even lengths may have to be padded with 0X..0X on
> long word boundary.
> 
> Correct?
> 
> This came as a surprise to me as I remember from University days about
> Pascal/Modula strings, having a length byte in front.
> 
> Many thanks.
> 
> -- 
> Tomas Kral <thomas.kral at email.cz>
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2380 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160411/15d49e15/attachment.p7s>


More information about the Oberon mailing list