News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

tried to use REPT macro with iterator number failing.

Started by ggmasm32, December 28, 2015, 10:31:30 AM

Previous topic - Next topic

ggmasm32

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

jj2007

   i=0
   REPEAT 32
    @CatStr(<descIdt>, %i, < db   'int-gate'>)
    i=i+1
   ENDM

rrr314159

Hi ggmasm32,

You can also do it this way:

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.
I am NaN ;)