Hi everyone , I wonder if anyone is famialiar in porting this from
C to ASM

I'm trying to make a ASM procedure for a Visual C++ program
to sort it.
I'll take Masm 32 instructions too, I love MAsm32


I thank everyone for there help here, I'm just trying build a lot of
knowledge up



struct passengers
{ char fname[32];
char lname[32];
} ;

struct seats {
int sid;
int ststat;
struct passengers shold;
};




for( i = 0; i < CAP; i++)
for(j=i+1;j<CAP;j++)
{
if(strcmp(passengers.shold.lname,passengers.shold.lname) == 1 )


{temp = passengers;
passengers = passengers;
passengers = temp;}
}
Posted on 2001-12-08 09:03:09 by andy981
I dont really want to do it all.. but the basic coversion is:

struct passengers
{ char fname[32];
char lname[32];
} ;

struct seats {
int sid;
int ststat;
struct passengers shold;
};


becomes:


passengers struct
fname BYTE 32 dup(?)
lname BYTE 32 dup(?)
passengers ends

seats struct
sid DWORD ? ; or possibly just WORD
ststat DWORD ?
shold passengers <> ; defines only 1!
seats ends


Your code later on confuses me becuase its written (in C) to assume that passengers is an array of seat data??? Apples and Oranges here! Stucts are just that, untill declaired in memory they are really just nothing but something that will slow the compiler down a fraction of a second.

For more information on structures, i have a fairly good 'discussion' i ripped from the old board about a year ago. It pretty well covers A-Z in this neck of the woods...

Learn More Here....

Enjoy...
:alright:
NaN
Posted on 2001-12-10 01:39:57 by NaN
That helps a lot

I have rustled up some info on my own too,
I plan to do a simple sort with just lastname


Right now I'm plagued with the same problem I read you have
exams,
Well just 2, one in assembly, but all I want to do is just code it
not prepare for the exam
And believe me structures are not part of the exam

Thanks
Andy
Posted on 2001-12-10 07:59:59 by andy981