C/C++ on Linux/Unix

Moderators: Lundin
Number of threads: 314
Number of posts: 633

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
gcc inline asm question Posted by vv40in on 17 Apr 2009 at 1:44 AM
hello!
1) stack var (e.g. pBuff) contains pointer to byte array
2) register (e.g. ebx) contains index to this array

i need take as follows:
movzbl <offsetof_pBuff_from_esp>(%esp,%ebx), %eax
i.e. i need access to byte pBuff[ebx]

how do write such asm command on gcc inline asm?
note: it must be single command!

thanks!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.