flat assembler
Message board for the users of flat assembler.

Index > Main > Indexed Variables

Author
Thread Post new topic Reply to topic
ml64



Joined: 17 Jul 2020
Posts: 6
ml64
How does fasm reach indexed members of arays?
I need to jump to the n-th member of the array/ Like this:
Code:
section '.data' data readable writeable
 lpCase dq 0,0,0,0
section '.text' code readable executable
  mov rax,2
 ;Select Case
  jmp lpCase[rax]    

or at least:
Code:
 jmp lpCase[2]    


Last edited by ml64 on 24 Aug 2020, 08:21; edited 1 time in total
Post 20 Jul 2020, 14:48
View user's profile Send private message Send e-mail Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 322
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Code:
 mov rax,2
;...
 jmp [lpCase+rax*8]    


Code:
 jmp [lpCase+2*8]    


Code:
 lea rdx,[lpCase]
;...
 mov rax,2
;...
 jmp qword [rdx+rax*8]    

_________________
smaller is better
Post 20 Jul 2020, 15:06
View user's profile Send private message Reply with quote
ml64



Joined: 17 Jul 2020
Posts: 6
ml64
Thank You, CandyMan!
Post 24 Aug 2020, 08:22
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.