The MASM Forum

Miscellaneous => 16 bit DOS Programming => Topic started by: ggmasm32 on December 28, 2015, 10:31:30 AM

Title: tried to use REPT macro with iterator number failing.
Post by: ggmasm32 on December 28, 2015, 10:31:30 AM
Hi Anyone see issue with following? As far as I concerned and according this tutorial
http://users.cis.fiu.edu/~downeyt/cop3402/rept.html, it all looks legitimate code to declare range of variables whose name is:
decsIdt0, descIdt1 and so on.

   i=0   
   REPT    32
   descIdt&i&   db   'int-gate'   
   i=i+1
   ENDM
   ENDIF


This is the compiler error thrown at every iteration:

pmode.asm(152) : error A2008: syntax error : &
 MacroLoop(1): iteration 64: Macro Called From
  pmode.asm(152): Main Line Code
pmode.asm(152) : error A2008: syntax error : &
 MacroLoop(1): iteration 65: Macro Called From
  pmode.asm(152): Main Line Code
pmode.asm(152) : error A2008: syntax error : &
 MacroLoop(1): iteration 66: Macro Called From
  pmode.asm(152): Main Line Code
pmode.asm(152) : error A2008: syntax error : &
 MacroLoop(1): iteration 67: Macro Called From
  pmode.asm(152): Main Line Code
pmode.asm(152) : error A2008: syntax error : &
 MacroLoop(1): iteration 68: Macro Called From
  pmode.asm(152): Main Line Code
pmode.asm(152) : fatal error A1012: error count exceeds 100; stopping assembly
 MacroLoop(1): iteration 69: Macro Called From
  pmode.asm(152): Main Line Code
Title: Re: tried to use REPT macro with iterator number failing.
Post by: jj2007 on December 28, 2015, 11:35:29 AM
   i=0
   REPEAT 32
    @CatStr(<descIdt>, %i, < db   'int-gate'>)
    i=i+1
   ENDM
Title: Re: tried to use REPT macro with iterator number failing.
Post by: rrr314159 on December 28, 2015, 11:38:36 AM
Hi ggmasm32,

You can also do it this way:

Code: [Select]
i=0   
   REPT    32
    i$ textequ %i
%   descIdt&i$   db   'int-gate'
   i=i+1
   ENDM

I don't know why your reference is wrong, but it is.
Title: Re: tried to use REPT macro with iterator number failing.
Post by: ggmasm32 on December 28, 2015, 03:10:57 PM
THANKS YOU!!!