flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Why this code can't be assembled?

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 310
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Code:
NumExc = 17
NumInt = 16

Count = (NumExc+NumInt)

rept Count n:0 ; invalid value
{
Interrupt#n: call Target
}
Target: mov cx,Interrupt1-Interrupt0
    

_________________
smaller is better
Post 23 Oct 2014, 14:55
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
The same reason. rept is preprocessor directive, but all numeric constants defined by "=" are assembling time constants and are unknown when the preprocessor runs.

Changing "=" to "equ" fixes it:

Code:
NumExc equ 17
NumInt equ 16

Count equ NumExc + NumInt

rept Count n:0
{
Interrupt#n: call Target
}
Target: mov cx,Interrupt1-Interrupt0    
Post 23 Oct 2014, 15:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 310
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Thank you.
Post 23 Oct 2014, 16:19
View user's profile Send private message 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.

Powered by rwasa.