[Oberon] System V5 - Oberon Strings Compiler Pattern
Tomas Kral
thomas.kral at email.cz
Mon Apr 11 20:29:27 CEST 2016
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>
More information about the Oberon
mailing list