|
@@ -3920,10 +3920,36 @@ BEGIN
|
|
|
RETURN
|
|
RETURN
|
|
|
END ;
|
|
END ;
|
|
|
IF (r.kind = 5) AND (r.cls = TString) THEN
|
|
IF (r.kind = 5) AND (r.cls = TString) THEN
|
|
|
- (* A whole string field of a run-time-indexed record element: the
|
|
|
|
|
- string paths address by symbol+boff, which is not this element.
|
|
|
|
|
- Loud until a counted-string copy through DI exists. *)
|
|
|
|
|
- Err (ENoLib) ;
|
|
|
|
|
|
|
+ (* A string field of a DI-addressed record element (CALC's
|
|
|
|
|
+ `with Sheet[I,J] do Contents := '''). DI is the field's address.
|
|
|
|
|
+ A literal's bytes are known: store <len><chars>, truncated to the
|
|
|
|
|
+ field's capacity (size-1). A string VARIABLE source uses strstore,
|
|
|
|
|
+ with DI pushed as the destination. *)
|
|
|
|
|
+ ParseExpr (src) ;
|
|
|
|
|
+ IF NOT OK () THEN
|
|
|
|
|
+ RETURN
|
|
|
|
|
+ END ;
|
|
|
|
|
+ n := VarSize (r) - 1 ; (* usable characters *)
|
|
|
|
|
+ IF src.kind = 3 THEN
|
|
|
|
|
+ IF strLen [src.strx] < n THEN
|
|
|
|
|
+ n := strLen [src.strx]
|
|
|
|
|
+ END ;
|
|
|
|
|
+ EmStDiImm (0, n) ; (* the length byte *)
|
|
|
|
|
+ k := 1 ;
|
|
|
|
|
+ WHILE k <= n DO
|
|
|
|
|
+ EmStDiImm (k, ORD (strPool [strOff [src.strx] + k - 1])) ;
|
|
|
|
|
+ INC (k)
|
|
|
|
|
+ END
|
|
|
|
|
+ ELSIF src.kind = 1 THEN
|
|
|
|
|
+ EmPushVarAddr (symtab [src.idx].local,
|
|
|
|
|
+ (symtab [src.idx].off + src.boff) MOD 10000H) ;
|
|
|
|
|
+ EmPushDi () ; (* destination = the field *)
|
|
|
|
|
+ EmMovCxi (n) ; (* strstore's limit *)
|
|
|
|
|
+ DropC (EmCall (TU_StrStore)) ;
|
|
|
|
|
+ EmAddSp (4)
|
|
|
|
|
+ ELSE
|
|
|
|
|
+ Err (ENoLib)
|
|
|
|
|
+ END ;
|
|
|
RETURN
|
|
RETURN
|
|
|
END ;
|
|
END ;
|
|
|
IF (r.kind = 1) AND symtab [r.idx].isVar THEN
|
|
IF (r.kind = 1) AND symtab [r.idx].isVar THEN
|
|
@@ -4399,7 +4425,12 @@ BEGIN
|
|
|
above is where the bytes live: a literal's are in the
|
|
above is where the bytes live: a literal's are in the
|
|
|
code stream (wrtinl) and a variable's are in the data
|
|
code stream (wrtinl) and a variable's are in the data
|
|
|
segment or the frame (wrstr). *)
|
|
segment or the frame (wrstr). *)
|
|
|
- EmPushVarAddr (symtab [arg.idx].local, symtab [arg.idx].off) ;
|
|
|
|
|
|
|
+ (* off + boff: a string FIELD of a record/array has a
|
|
|
|
|
+ non-zero boff, and the address is the field's, not the
|
|
|
|
|
+ containing variable's. `writeln (g[2,3].S)' printed
|
|
|
|
|
+ the empty first element before this. *)
|
|
|
|
|
+ EmPushVarAddr (symtab [arg.idx].local,
|
|
|
|
|
+ (symtab [arg.idx].off + arg.boff) MOD 10000H) ;
|
|
|
ent := TU_WrStr
|
|
ent := TU_WrStr
|
|
|
ELSE
|
|
ELSE
|
|
|
LoadAtom (arg) ;
|
|
LoadAtom (arg) ;
|