Beginner needs help - accessing an array

Discussion in 'Assembly Language Programming (ALP) Forum' started by AssemblerJoe, Feb 7, 2010.

  1. AssemblerJoe

    AssemblerJoe New Member

    Joined:
    Feb 7, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello. I want to access a part of an array while only knowing it's start location in memory. As an example, say I want to access joe[2] when joe[] starts at memory cell 5,000. I need to do something like this:

    lw $t0, 8(5000)

    but am unsure of the exact syntax from knowing that the parentathes must contain a register. I dont know how to find the name of the register in memory at 5,000, so I'm currently stuck with:

    lw, $t0, 8(?)

    Please help. Thank you.
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    i think you want this one

    lw $t0,5000($0)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice