Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here



Hey there I'm a newbie at assembly so I'd like someone to help me out w/ the following.

On the following code:

mov esi, offset Vec
mov eax, [esi]

Esi contains the 1st position of the vector and Eax contains the 1st number of the same vector.

And here:
mov edi, offset (vec + 4)
mov ebx, [edi]

Edi gets the 2nd position of the vector and ebx contais the 2nd number or is it incorrect?

Consider it to be DWORDS.

RE: Doubt

It's a very long time since I did any assembler programming, but from memory I think you are right.

As far as I can see esi is set as a pointer to the start of the vector and eax picks up the value at that point. The next line the vector pointer is moved 4 bytes and the value loaded into ebx.

Personally I would have left the pointer esi in its inital position - the start of the vector and picked up the value as mov ebx, [esi + 4].

But as I said I am very rusty.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close