| 123456789101112131415161718192021 |
- program t47;
- (* readln (s[i]) with a VARIABLE index.
- The address of the one byte the reader must store into is off+i, and i is
- only known at run time, so the reader has to carry a computed address:
- ParseSub leaves it in DI and IoCall pushes DI instead of a constant
- off+boff. t45 covers the same path with a constant index, which folds into
- boff; the two differ in exactly where the address comes from. *)
- var
- g : string[8] ;
- i : integer ;
- begin
- g := '........' ;
- i := 3 ;
- readln (g[i]) ;
- writeln (g) ;
- i := 6 ;
- readln (g[i]) ;
- writeln (g) ;
- writeln (g[3], g[6])
- end.
|