flat assembler
Message board for the users of flat assembler.

Index > Main > "rb" vs "db ?" -- difference

Author
Thread Post new topic Reply to topic
jorido



Joined: 23 Jan 2017
Posts: 53
jorido
What's the difference between

Code:
var1 rb 123
    


and

Code:
var1 db 123 dup ?
    


?
Post 30 Jan 2017, 16:18
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
No difference for this very example. However, in general `dup` directive allows defining repeated sequences.

From the manual (https://flatassembler.net/docs.php?article=manual), 1.2.2 Data definitions:
Quote:
...directive allows the usage of special dup operator to make multiple copies of given values. The count of duplicates should precede this operator and the value to duplicate should follow - it can even be the chain of values separated with commas, but such set of values needs to be enclosed with parenthesis, like db 5 dup (1,2), which defines five copies of the given two byte sequence.
Post 30 Jan 2017, 19:36
View user's profile Send private message Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 53
jorido
"dup" is just used in this specific example. Without "dup:

Code:
var1 rd 1
var1 dd ?
    


Any difference?
Post 31 Jan 2017, 02:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17281
Location: In your JS exploiting you and your system
revolution
No.
Post 31 Jan 2017, 03:04
View user's profile Send private message Visit poster's website Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 53
jorido
thanks!
Post 31 Jan 2017, 06:01
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.