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 30 Jan 2017, 16:18
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: 501
Location: Belarus
zhak 30 Jan 2017, 19:36
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 31 Jan 2017, 02:56
"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: 20451
Location: In your JS exploiting you and your system
revolution 31 Jan 2017, 03:04
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 31 Jan 2017, 06:01
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.