Code: Alles auswählen
void matrixMultiplication(float *matrixIn, // 4x4 matrix
float *vectorIn, // 4x1 vector
float *vectorOut) // 4x1 vector
{
// pointer row points to 16 elements array (beginning of the
// matrixIn array) containing column-major elements:
// [1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 4, 8, 12, 16]
float *row = matrixIn;
__asm
{
mov esi, vectorIn // load input address
mov edi, vectorOut // load output address
// pointer to the first 4 elements of the array:
mov edx, row
Soweit bin ich schon mal gekommen.
Nun zu Frage, ist dies der richtige weg, auch was die var im Procedure-Kopf anbelangt ?
Und wie muss ich das float *row = matrixIn; umsetzen ?
Code: Alles auswählen
procedure matrixMultiplication(var matrixIn: TMatrix; var vectorIn, vectorOut: TVector4f);
{$asmmode intel}
begin
asm
Mov Esi, vectorIn // load input address
Mov Edi, vectorOut // load output address
// pointer to the first 4 elements of the array:
Mov Edx, row
Der komplette C++-Code befindet sich hier: http://www-cs.ccny.cuny.edu/~gertner/Cs ... tion_4.pdf