Fixed-form calculations: CABxx, TAG and their C lines #671
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-l7-fixed-calculations-20261029"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixed-form calculations: CABxx, TAG and their C lines
A program with CABxx and TAG (FLOW/return-fixed) has no free-form text: free
form has no branch to a label. The reader now proves both
(
rpg_fixed_branch.zig): CABxx is the comparison of its factors, a jump ontrue to a label whose code jumps to the TAG label, and the label after it
(
CAB N > 50 L311); TAG is a statement with no code at a label that thestatement before defines and that an unconditional jump of the procedure
takes, where that jump is the TAG jump of a CABxx or the whole of its
statement (a GOTO):
TAG L311. The ends of blocks have the same shape(ON-ERROR and ENDMON of MONITOR/limits, the jumps of their MONITOR) and keep
their failure.
With either, the emitter writes the calculations as C lines in columns
(
fixedMode), when the program has nothing that columns cannot write yet: nocontrol options, files, SQL, subprocedures or parameters. The mixed source of
gotos-static (free code with GOTO and TAG lines) has control options and
parameters: it stays free form, its TAG a failure line as before. Calibration H on the host (captures/calH-20261029): the source
with generated names matches its object, and so does it with EXSR, BEGSR and
ENDSR in free form; free arithmetic (
N = N + 1: an add in 6 digits with anoverflow check inside an exception bracket, where
ADD 1 Ntruncates to the5 digits of N) and a free IF (
if N > 3: the comparison inside a bracket,where IFGT compares the opposite and jumps on true) compile to other
operations. So each C line is taken only from the operations of its fixed
form: Z-ADD (
27 c; 61 p 0 0; 37 N), ADD, SUB and MULT (29; 27; 54/52/57 p s 0; 37 N, p the digits of the result field), IFxx (29; 27; compare; 17)and CABxx; BEGSR, EXSR, ENDSR, ENDIF, RETURN and SETON LR as before. A
statement without a rule is a failure line, never free code. The first
assignment to a packed field without an initial value declares it in columns
64 to 70 (
Z-ADD 1 N 5 0), so that no D line moves statement 1.A decimal literal compared with a field with no rescale between them has the
decimal positions of the field: the compiler rescales one side before the
comparison when they differ (ftwin3-h7,
I >= 12.25:61 7 2 0before10).resolveMarkstakes those comparisons as targets (N CABGT 50).The emitted text of FLOW/return-fixed matched its object on the host
(calibration I, captures/calI-20261029).
Gates