rpg_display.zig, rpg_statements.zig and rpg_source_stmt.zig: DSPLY of %CHAR of a numeric field, and the source of %DEC(%CHAR(I)) and %INT(%CHAR(I)) #769

Manually merged
binjovi-bot merged 5 commits from lo15e into trunk 2026-11-08 23:49:56 +00:00
Owner

rpg_display.zig, rpg_statements.zig and rpg_source_stmt.zig: DSPLY of %CHAR of a numeric field, and the source of %DEC(%CHAR(I)) and %INT(%CHAR(I))

dsply %char(n) (probe lo15-char-dsply, statement 22) is a whole-statement proof of
rpg_display.recover, which read fields and literals as the message and stopped at
stagedAddress on the first operation of the strip. The profile of the tokens
rpg_display.recover s04, take s02, readDescriptor s01, stagedAddress s01 with
rpg_trim.charConcat s01 is this statement. rpg_display.charsMessage reads the load of the
integer and its zoned conversion (29 I 0 T; [75 4]; 86 D; 61 D 0 0; 85 D 1), the 59
operations of the strip (rpg_trim.stripShape, with the labels proved to have no jump from
outside) and the load of the pointer of the digits. The first descriptor then stores that
pointer and, for its length, the temporary of the strip in place of a constant width (the
buffer width D + 1 is the bound). The proof has chars; rpg_display.named writes the message as
%CHAR(I) (one existing line of rpg_statements.zig changed, net growth 0): DSPLY %CHAR(S260).
The queue and the response are read as before. Only the message of a DSPLY with an integer
field of the static storage is read; other built-in results are not covered by this unit.

DSPLY of %CHAR of a packed, zoned or unsigned field

The tracer gave rpg_display.charsMessage s01 (the source symbol) on the held-out line and on the
captures of lo15/dsp-char with a packed, a zoned and a packed-decimal field; the integer fields
int(5), int(10), int(20) and the queue operand already read. The load before the strip differs
by the type of the field and nothing else: 29 I 0 T; [75 4]; 86 D (integer), 88 D (unsigned),
84 D 1 (zoned) or no conversion (packed), then 61 D 0 0; 85 D 1. charsMessage reads the four
forms; the source must be a static field whose type has the width of the field (a packed field has its
digits as its length and the type the bytes). lo15-dsp-packed, -zoned, -uns and -queue are
adopted (statement 16 of each). packed(7:2) (lo15-dsp-packed-dec) is not read: its strip inserts
the decimal point (two copies), and rpg_trim.stripShape refuses it (charsMessage s04).

The emitter: %DEC(%CHAR(I): D: S) and %INT(%CHAR(I))

The lo15-char-dec and lo15-char-int-of probes recover but their emit failed
(runtime or packed template statement: _QRNX_GET_DECIMAL_NUM with a temporary
as its source, ADDRESS(A313.0, 11)). rpg_source_stmt.runtimeSummary demanded a
date conversion call for every %CHAR( of the assignment. A decimal call with no date
call (digits_only) has no such call, and the %CHAR( is the digits of an integer: the
summary is now S261 = %DEC(%CHAR(S260): 7: 0). Date conversions are unchanged.

Lane Lo15: open and negative items

Not done, with the check that still declines:

  • %SCAN(lit: %CHAR(n)) (lo15-char-scan): the strip and the source text are read, but
    rpg_eval_builtins.scan takes constant lengths only (s06), the last call argument is
    -2147483648 where it is 0 for a field (unmeasured), and the check of the result after the call
    (27 T; 27 C; 10; 17 L; ... 99 3, error signal) has no reader.
  • DSPLY of %CHAR of a data structure subfield, of an array element and of an expression
    (lo15-dsp-ds-sub, -arr-const, -arr-var, -expr, -packed-dec): the load before the strip is not
    29 I 0 T (33 DS; 27 K; 62; 32, 34 A 0; 27 K; 62; 32, a computed value, and a second 61),
    so rpg_display.charsMessage declines (s02 for the expression). %CHAR of integer, unsigned, zoned
    and packed fields is read; packed(7:2) is not (the strip inserts the decimal point).
  • %LEFT and %RIGHT with a variable length, %SUBST with a variable start and a variable
    count, %REPLACE, %CHECK, %CHECKR, %LOOKUP and %SQRT: no unit reads their range checks.
  • The %CHAR strip into a character field whose width is less than the digits (a min block
    with a data structure target) and R.c = %trimr(G), R.b = %trim(C) (h-subfill statements
    34 and 64): the copy head of copyTail stacked mode may read them; not measured.
  • A latent defect, outside this lane's files: rpg_eval op 32 reads a part of a field at byte 0
    (fieldValue) as the whole field. A copy of fewer bytes than the field to a wider target prints
    as S = C. %LEFT and %RIGHT avoid it by owning the typed copy; any other reader of a partial
    read at byte 0 meets it.
# rpg_display.zig, rpg_statements.zig and rpg_source_stmt.zig: DSPLY of %CHAR of a numeric field, and the source of %DEC(%CHAR(I)) and %INT(%CHAR(I)) `dsply %char(n)` (probe `lo15-char-dsply`, statement 22) is a whole-statement proof of `rpg_display.recover`, which read fields and literals as the message and stopped at `stagedAddress` on the first operation of the strip. The profile of the tokens `rpg_display.recover s04`, `take s02`, `readDescriptor s01`, `stagedAddress s01` with `rpg_trim.charConcat s01` is this statement. `rpg_display.charsMessage` reads the load of the integer and its zoned conversion (`29 I 0 T; [75 4]; 86 D; 61 D 0 0; 85 D 1`), the 59 operations of the strip (`rpg_trim.stripShape`, with the labels proved to have no jump from outside) and the load of the pointer of the digits. The first descriptor then stores that pointer and, for its length, the temporary of the strip in place of a constant width (the buffer width D + 1 is the bound). The proof has `chars`; `rpg_display.named` writes the message as `%CHAR(I)` (one existing line of `rpg_statements.zig` changed, net growth 0): `DSPLY %CHAR(S260)`. The queue and the response are read as before. Only the message of a DSPLY with an integer field of the static storage is read; other built-in results are not covered by this unit. ## DSPLY of %CHAR of a packed, zoned or unsigned field The tracer gave `rpg_display.charsMessage s01` (the source symbol) on the held-out line and on the captures of `lo15/dsp-char` with a packed, a zoned and a packed-decimal field; the integer fields `int(5)`, `int(10)`, `int(20)` and the queue operand already read. The load before the strip differs by the type of the field and nothing else: `29 I 0 T; [75 4]; 86 D` (integer), `88 D` (unsigned), `84 D 1` (zoned) or no conversion (packed), then `61 D 0 0; 85 D 1`. `charsMessage` reads the four forms; the source must be a static field whose type has the width of the field (a packed field has its digits as its length and the type the bytes). `lo15-dsp-packed`, `-zoned`, `-uns` and `-queue` are adopted (statement 16 of each). `packed(7:2)` (`lo15-dsp-packed-dec`) is not read: its strip inserts the decimal point (two copies), and `rpg_trim.stripShape` refuses it (`charsMessage s04`). ## The emitter: %DEC(%CHAR(I): D: S) and %INT(%CHAR(I)) The `lo15-char-dec` and `lo15-char-int-of` probes recover but their emit failed (`runtime or packed template statement`: `_QRNX_GET_DECIMAL_NUM` with a temporary as its source, `ADDRESS(A313.0, 11)`). `rpg_source_stmt.runtimeSummary` demanded a date conversion call for every `%CHAR(` of the assignment. A decimal call with no date call (`digits_only`) has no such call, and the `%CHAR(` is the digits of an integer: the summary is now `S261 = %DEC(%CHAR(S260): 7: 0)`. Date conversions are unchanged. ## Lane Lo15: open and negative items Not done, with the check that still declines: - `%SCAN(lit: %CHAR(n))` (`lo15-char-scan`): the strip and the source text are read, but `rpg_eval_builtins.scan` takes constant lengths only (`s06`), the last call argument is -2147483648 where it is 0 for a field (unmeasured), and the check of the result after the call (`27 T; 27 C; 10; 17 L; ... 99 3`, error signal) has no reader. - `DSPLY` of `%CHAR` of a data structure subfield, of an array element and of an expression (`lo15-dsp-ds-sub`, `-arr-const`, `-arr-var`, `-expr`, `-packed-dec`): the load before the strip is not `29 I 0 T` (`33 DS; 27 K; 62; 32`, `34 A 0; 27 K; 62; 32`, a computed value, and a second `61`), so `rpg_display.charsMessage` declines (`s02` for the expression). `%CHAR` of integer, unsigned, zoned and packed fields is read; `packed(7:2)` is not (the strip inserts the decimal point). - `%LEFT` and `%RIGHT` with a variable length, `%SUBST` with a variable start and a variable count, `%REPLACE`, `%CHECK`, `%CHECKR`, `%LOOKUP` and `%SQRT`: no unit reads their range checks. - The `%CHAR` strip into a character field whose width is less than the digits (a `min` block with a data structure target) and `R.c = %trimr(G)`, `R.b = %trim(C)` (h-subfill statements 34 and 64): the copy head of `copyTail` `stacked` mode may read them; not measured. - A latent defect, outside this lane's files: `rpg_eval` op 32 reads a part of a field at byte 0 (`fieldValue`) as the whole field. A copy of fewer bytes than the field to a wider target prints as `S = C`. `%LEFT` and `%RIGHT` avoid it by owning the typed copy; any other reader of a partial read at byte 0 meets it.
sean force-pushed lo15e from 96975b3496
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to 5be4b586e3
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-08 23:40:30 +00:00
Compare
binjovi-bot manually merged commit 5be4b586e3 into trunk 2026-11-08 23:49:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!769
No description provided.