flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > simple error but i cann't see it

Author
Thread Post new topic Reply to topic
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 11 Aug 2005, 00:31
i was making some macros to work in menuetos and i just added a few macros to a file called macros.inc that had no errors... i wanted the code to look like this


include 'macros.inc'
meos_app_start
; useful stuff
include 'TXBOX.inc' ; textbox utils
include 'ascl.inc';draw macros


code
call draw_window
meos_event_control;start one of my macros
meos_key
;bla bla something happens when you hit a key
end
meos_button
;bla bla the same with buttons
end
draw_window:
;etc etc you know the rest...

this are my macros (this is not the whole file... you can find the hole file in the tinypad sources (Menuetos project)
macro meos_event_control
{
__still:
mov eax,10
int 0x40
cmp eax,EV_REDRAW
je __red
cmp eax,EV_KEY
je __key
cmp eax,EV_BUTTON
je __button
jmp __still

__red:
call draw_window
jmp __still
}
macro key
{
__key:
mov eax,2
int 0x40
}
macro button
{
__button:
mov eax,17 ; get id
int 0x40
cmp ah,1
jne @f
close
@@:
}
macro end
{
jmp __still
}

now when i try to compile this, appears an error related to some structures that i never touched... invalid macro arguments... in the declaration of structures at the end of the page... how is that posible if i never touched them... is there something about the macros that i didn't know (very posible)
Post 11 Aug 2005, 00:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 00:41
You have redefined the "end" keyword as a macroinstruction, while it's the assembler's directive - perhaps those structures use it. But since the "end" directive always need the name of type of structure to follow it, it's possible to distinguish it from your "end" macro. Try defining it this way:
Code:
macro end param
{
match any, param \{ end param \}
match , param \{ jmp _still \}
}    

but I suggest changing "end" to some other name.
Post 11 Aug 2005, 00:41
View user's profile Send private message Visit poster's website Reply with quote
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 11 Aug 2005, 00:45
thanx, and sorry about the stupid question, i'll read the manual againa the next time Embarassed
Post 11 Aug 2005, 00:45
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.