flat assembler
Message board for the users of flat assembler.

Index > Main > How to navigate by each byte of an array in FASM??

Author
Thread Post new topic Reply to topic
jhonny6721



Joined: 07 Aug 2014
Posts: 26
jhonny6721 09 Aug 2014, 16:31
Hello, I'm trying to make a XOR encryption algorithm in ASM using FASM. I need make a loop that navigates in whole array. But, when i try to use:

Code:
mov bl, [lpBuffer+cx] ;Mov value of buffer + counter, to bl
    


It shows a error: reserved word uses as a symbol.

I need a way to navigate inside an array, by each element of it. Please, show me a short fragment about how to navigate in arrays using FASM.

Thanks for read my message.[/b]

_________________
Мне нравится программирование.
Post 09 Aug 2014, 16:31
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 09 Aug 2014, 18:15
You have to get familiar with allowed addressing modes of x86.

mov bl, [lpBuffer+cx]

is not valid.

You could use

mov cl, [lpBuffer+bx]

or

mov bl, [lpBuffer+ecx]


You can find additional information here:
http://www.c-jump.com/CIS77/ASM/Addressing/lecture.html
Post 09 Aug 2014, 18:15
View user's profile Send private message Send e-mail Reply with quote
jhonny6721



Joined: 07 Aug 2014
Posts: 26
jhonny6721 10 Aug 2014, 03:18
Thanks for your help, shutdownall. I am using your suggestions, and they work properly.

_________________
Мне нравится программирование.
Post 10 Aug 2014, 03:18
View user's profile Send private message 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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.