Thanks both Hein and Arne: I will create a descriptor, fill it with the data and pass its address by value (a method I've used extensively before, 35+ years ago
)
However, I'm a bit puzzled after consulting the calling standard combined with my data.
In my propgram, I'm passing an array [1..65] of packed array [1..132] of char (as 4th argument).
In the library routine on break (as Hein suggested) the descriptor look like this:
Code: Select all
DBG> ex/long @r19:@r19+20
F+50: 0A0E0001
F+54: 7ADB6758
F+58: 02000000
F+5C: 00002184
F+60: 7ADB66D3
F+64: 00000084
F+68: 00000001
F+6C: 00000001
F+70: 00000041
Projecting on the descriptor fields (according calling standard manual) in the prototype for arrays:
Byte CLASS = x0A (10 = DSC$K_CLASS_NCA)
Byte DTYPE = x0E (14 = FSC$TYPE_T)
Word Length =x01 (incorrect, I guess. If this is one element, it should be 132 - like Arne stated)
Lonword Pointer = x7ADB6758 (of element 1)
Byte DimCT = x02 (correct: 2 dimensions)
Byte AFlags = x0 (this causes confusion)
Byte Digits = x0 (fine)
Byte Scale = x0 (fine)
Longword Arsize = x2184 (correct: 65 * 132 = 8580)
The next field: Longword A0 (or V0, I've seem both on the same location) is x7ADB66D3, being the location of element 0, if that was specified. My arrays are 1-based, so this location seems correct: The pointer refers to element 1, so element 0 is size 132 (+1) less - giving this number.
The next longwords are my bounds:
x84 = 132
x01 = 1
x01 = 1
x41 = 65
This is confusing me.
In prototype field AFlags, Starlet.pas specifies:
Code: Select all
4: (DSC$V_FL_REDIM : [POS(84)] $BOOL; (* If set, the array can be redimensioned; *)
(* i.e., DSC$A_A0, DSC$L_Mi, DSC$L_Li, and *)
(* DSC$L_Ui may be changed. The redimensioned *)
(* array cannot exceed the size allocated to *)
(* the array (i.e. DSC$L_ARSIZE). *)
DSC$V_FL_COLUMN : [POS(85)] $BOOL; (* If set, the elements of the array are *)
(* stored by columns (FORTRAN)> Otherwise *)
(* the elements are stored by rows. *)
DSC$V_FL_COEFF : [POS(86)] $BOOL; (* If set, the multiplicative coefficients in *)
(* Block 2 are present. *)
DSC$V_FL_BOUNDS : [POS(87)] $BOOL; (* If set, the bounds information in Block 3 *)
(* is present. *)
)
but this whole field is zero - so: REDIM is false, COLUMN is false, COEFF is false (so no Block 2) and BOUNDS is false (so no Block 3). But block 3 is present! Also, the order seems wrong. It should be low index of 1st dimension, low index of 2nd dimension, high index of first dimension,, high index of 2nd dimension: 1, 1, 65, 132.
Second, I guess length in the descriptor prototype should indeed be ARSIZE / Number of elements - 8580 / 55 = 132 - for one element.