Re: Mergesort für Array
Verfasst: 22.12.2019 20:22
P.S.
32 Bit PEEKL(@array()-8)
64 Bit PEEKQ(@array()-16)
32 Bit PEEKL(@array()-8)
64 Bit PEEKQ(@array()-16)
Code: Alles auswählen
EnableExplicit
Dim ar.s(15,2,1)
Structure PBArray
dimensions.i
elementsize.i
*point
*point1
AnzahlElemente.i
Datentyp.i
EndStructure
Define *i.PBArray
*i=@ar()-SizeOf(PBArray)
Debug *i\dimensions
Debug *i\point
Debug *i\point1
Debug *i\AnzahlElemente
Debug *i\Datentyp
; typedef struct PB_Array
; {
; int NbDimensions;
; integer ElementSize;
; integer *StructureMap;
; struct PB_Array **Address;
; integer NbElements; // Warning, if you add or change an item, the compiler needs to be modified (for runtime array bound check)
; int Type;
; } PB_Array;
Code: Alles auswählen
Structure ArrayHeaderType
Dimensions.i
ElementSize.i
*Point1
*Point2
TotalElements.i
DataType.i
EndStructure
If \endright<0
; (1)
;Protected *ArrayHeader.ArrayHeaderType=*Liste-SizeOf(ArrayHeaderType)
;\endright=*ArrayHeader\TotalElements/*ArrayHeader\Dimensions-1
; (2)
CompilerIf #PB_Compiler_Processor=#PB_Processor_x64
\endright=PeekQ(*liste-16)-1
CompilerElse
\endright=PeekL(*liste-8)-1
CompilerEndIf
EndIf