Hi
I try to translate this from C to Masm32
and i think it is a Struct array and this read out in a while or?
for (i = pBuffer->StructXyz.FirstItem; i <= pBuffer->StructXyz.LastItem + 1; i++) {
int index = i - pBuffer->StructXyz.FirstItem;
if (i <= pBuffer->StructXyz.LastItem) {
pBuffer->StructXyz.pData[index].Address[1]
pBuffer->StructXyz.pData[index].Address[2]
pBuffer->StructXyz.pData[index].Address[3]
}
}
Can any please post an example in masm32
Greets,
It looks like a structure that contains an array of structures, used as a template to access a buffer. I think you are going to need the structure definition to do anything with this. And the following lines are not complete statements:
pBuffer->StructXyz.pData[index].Address[1]
pBuffer->StructXyz.pData[index].Address[2]
pBuffer->StructXyz.pData[index].Address[3]
Here is this with structur definition
typedef struct _p_DATA {
UCHAR Reserved;
UCHAR Control :4;
UCHAR Adr :4;
UCHAR Number;
UCHAR Reserved1;
UCHAR Address[4];
} p_DATA, *Pp_DATA;
typedef struct _StructXyz {
UCHAR Length[2];
UCHAR FirstItem;
UCHAR LasttItem;
p_DATA pData[MAXIMUM_NUMBER];
} StructXyz, *PStructXyz;
StructXyz pBuffer;
for (i = xyz->pBuffer.FirstItem; i <= xyz->pBuffer.LasttItem + 1; i++) {
int index = i - xyz->pBuffer.FirstItem;
if (i <= xyz->pBuffer.LasttItem) {
;wsprintf for this items " %02d %02d %02d\n",
xyz->pBuffer.pData[index].Address[1],
xyz->pBuffer.pData[index].Address[2],
xyz->pBuffer.pData[index].Address[3]);
}
}
I hope its better
Put this in a c++ project.
ADD option /FA in the c++ command line nd .... you have it translate in a .asm
Thanks for this tip :U