flat assembler
Message board for the users of flat assembler.

Index > Main > Help on macros

Author
Thread Post new topic Reply to topic
avcaballero



Joined: 02 Feb 2004
Posts: 191
Location: Madrid - Spain
avcaballero
Hello, I'm working on Fasm version 1.55 and I need help with next question:

I've a macro like this:

Code:
MACRO     WrtMes  NuMes
{
  MOV       DH, Fila+IncFil*2+4+NuMes         ; Fila
  MOV       DL, Columna-4                 ; Columna
  CALL      WriteXY
  MOV       AH, 9
  MOV       DX, Mens#`NuMes
  INT       21h
}
    


And I call it from some piece of code like this one:

Code:
  i = 1
  REPEAT 7
    WrtMes    i
    i = i + 1
  END REPEAT
    



But it gives me an error on lines

Code:
  MOV       DX, Mens#`NuMes
  [...]
  WrtMes    i
    


Can anyone help me, please?
Post 19 Dec 2006, 15:54
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
I'm not sure what labels have you declared for this (it's out of context), but should do it like:
Code:
MACRO     WrtMes  NuMes
{
  MOV       DH, Fila+IncFil*2+4+NuMes
  MOV       DL, Columna-4
  CALL      WriteXY
  MOV       AH, 9
  MOV       DX, Mens#NuMes
  INT       21h
}

REPT 7 i:1
{
    WrtMes   i
}    

No time go deep into fasm's macro syntax details, I can just recommend reading the manual and Understanding fasm article.
Post 19 Dec 2006, 16:01
View user's profile Send private message Visit poster's website 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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.