News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Quick indexing question

Started by Ian_B, October 25, 2005, 08:34:51 PM

Previous topic - Next topic

Ian_B

I'm lost in all these addressing options...  :eek  OK, I have a table in my .data section like so...


.data
    SomeTableData \
        db 0,1,2,3,4,5,6,7,8,9      ; etc.


Can I index into this using this form?

mov al, BYTE PTR SomeTableData[ecx]

Or do I have to do:


lea edx, SomeTableData
mov al, BYTE PTR [ecx+edx]


EDIT: my mind went blank there for a while, of course the first one is OK! I can't remove this post, maybe someone else will find the reminder useful.

IanB

shaldan

and what about using for example :)

  mov al,SomeTableData+5

or if you need:

 
mov ecx,3
mov al,SomeTableData[ecx][2]


read MASM61PROGRAMMERGUIDE ... i am beginner too, but this books is excellent to start learnig.