Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   Finding a struct member in Assembly? (http://www.programmingforums.org/showthread.php?t=2670)

bioman Mar 9th, 2005 1:00 AM

Finding a struct member in Assembly?
 
I am trying to call a function in Assembly, but I don't know how to access a struct member of the return value. The function I am trying to call is getgrgid(), which has definition: struct group *getgrgid(gid_t gid); After I call the function and set the return value to a local register, I want to access and return a struct member of the return value.

Here are the instructions:
displayGroupName.s

This routine will call getgrgid() to get a pointer to the struct group for this gid so we can get the group's name as a string (gr_name member). If the group entry cannot be found, just print the numeric value of the gid. In either case, the group's name or gid will be printed with a field width of 8 left justified. Use the left-adjustment flag '-' in the printf format specifier.


How the hell do I do this?

Thanks.


All times are GMT -5. The time now is 2:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC