﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
334	call.pl1 calculation for storage used by decimal(N) unaligned numbers is incorrect.	Gary Dixon	Eric Swenson	"The Multics data types involving 4-bit decimal digits are selected by the PL/I Attributes:

- real fixed decimal (N) unaligned:  which selects data type 43: real_fix_dec_4bit_bytealigned_ls_dtype
- real float decimal (N) unaligned:   which selects data type 44: real_flt_dec_4bit_bytealigned_dtype

The calculation for storage used by this data type are made in the storage_for_pl1_dtype subroutine whose code resides in the call_dtype_fcns.incl.pl1 include segment.  The existing calculations do not account for the requirement that stored scalar or array values of these data types must begin on a word boundary and occupy a full number of words.  This is specified in the Multics Programmer's Reference Guide (AG91-04) Appendix D (page D-18), and was verified by array data descriptors created by the PL/I compiler for offset between adjacent array elements.

The proposed bug fix is shown by the following compare_ascii output.


{{{
cpa [lpn call_dtype_fcns.ip] ==

Inserted in B:
B10         3) change(2024-02-16,GDixon):
B11            Correct total words used to store fixed dec(N) unal  and  float dec(N) unal descriptor types:
B12            real_fix_dec_4bit_bytealigned_ls_dtype, and real_flt_dec_4bit_bytealigned_dtype.  These always
B13            begin on word-boundary and always occupy a full number of words of storage even though they are
B14            PL/I unaligned storage.  The unaligned attribute shifts from 9-bit to 4-bit digits.
Preceding:
A10                                                          END HISTORY COMMENTS */


A209      unalStoreSize (real_fix_dec_4bit_bytealigned_ls_dtype):     /* +2 for sign nibble + round up to full byte boundary.   */
A210                                                  call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0));
A211      unalStoreSize (real_flt_dec_4bit_bytealigned_dtype):        /* +2 for sign nibble + round up to full byte boundary.   */
A212                                                                  /*  +1 after divide for the binary exponent field.        */
A213                                                  call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0)+1);
Changed by B to:
B242      unalStoreSize (real_fix_dec_4bit_bytealigned_ls_dtype):     /* +1 for sign nibble + round up to end on word boundary. */
B243                                                  call st(BOUNDARY.Word,
B244                                                     divide( dsize + 1 +
B245                                                             (packed_digits_per_character * characters_per_word) - 1,
B246                                                             (packed_digits_per_character * characters_per_word), 24, 0);
B247      unalStoreSize (real_flt_dec_4bit_bytealigned_dtype):        /* +1 for sign nibble +2 for the binary exponent field    */
B248                                                                  /*    rounded up to full word boundary                    */
B249                                                  call st(BOUNDARY.Word,
B250                                                     divide( dsize + 3 +
B251                                                             (packed_digits_per_character * characters_per_word) - 1,
B252                                                             (packed_digits_per_character * characters_per_word), 24, 0);
}}}


"	defect	new	major		Tools	MR12.8			
