flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > "rb" vs "db ?" -- difference

Author
Thread Post new topic Reply to topic
jorido



Joined: 23 Jan 2017
Posts: 40
"rb" vs "db ?" -- difference
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: 473
Location: Belarus
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: 40
"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: 15096
Location: The Unicomplex
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: 40
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.