Assembly: DUP command (MASM/TASM)
how to use the DUP – duplicate command, nested or un-nested
As it sounds, DUP duplicates text.
Straight Example:
text DB 10 DUP (’W’) ;initializes 20 bytes to W
the number after DB defines how many bytes to repeat for, and then the ‘W’ defines what to repeat.
Nested:
barCode DB 4 DUP(3 DUP (’l’),2 DUP (’|’),5 DUP (’I’))
reserves 40 bytes in total, initialized to: lll||IIIIIlll||IIIIIlll||IIIIIlll||IIIII
each pass through creates lll||IIIII then this is repeated 4 times as it is nested within another DUP command.
Questions/Comments: william_a_wilson@hotmail.com
-William. § (marvin_gohan)





