Page 1 of 1

"dup" extension for operator "Data"

Posted: Sat Aug 13, 2011 7:42 am
by 4RESTER
It would be nice to expand the directive "Data" by
"Dup" operator then make multiple copies of values (like in FASM).

Like this:
Data.B 4 Dup (5) = Data.B 5,5,5,5
Data.L 8 Dup (1,2) = Data.B 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2

Re: "dup" extension for operator "Data"

Posted: Sat Aug 13, 2011 9:55 am
by Danilo
For now you could use macros:

Code: Select all

Macro Data_B : !db
EndMacro

Macro Data_L : !dd
EndMacro

DataSection
label:
  Data.b 18
  Data_b 4 Dup (5)
  Data_l 8 Dup (1,2)
  Data.l 123, 456
  Data.q $7FFFFFFFFFFFFFFF
EndDataSection

Restore label

Read.b b
Debug b

For i=1 To 4
   Read.b b
   Debug b
Next

For i=1 To 18
   Read.l l
   Debug l
Next

Read.q q
Debug q