flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > several logics ?

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 01 Dec 2011, 23:41
Tomasz Grysztar wrote:
ouadji wrote:
one "}" to end "rept", and another "}" to end "struct" ?
Yes. Formatting it like this may help to understand what's going on:
Code:
rept 1
{
     mov eax,eax
     struc myS
     {
       .mydata dd 1
}

       abc myS
     }    
http://board.flatassembler.net/topic.php?p=137483#137483

(A)
it's like the explanation of Tomasz, just above. (does compile)

(B)
B does not compile (?)

It is very difficult to find the common logic of work between rept-engine, macro-engine, struc-engine ... It seems there are several logics and not really a common engine. It seems that nestings of "{..}" are not the same in all engines. I have a hard time to have a overall view. This is not a bad criticism Tomasz, just it is difficult to try to understand "globally" (to have an overall view of) all these engines. (sorry for bad English)


Code:
;(A) does compile
rept 1 {
struc m2 { . dd ? }
} 
    
Code:
;(B) does not compile
macro m {
struc m2 { . dd ? }
} ;<-- illegal instruction
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 01 Dec 2011, 23:41
View user's profile Send private message Send e-mail Reply with quote
addes3



Joined: 09 May 2011
Posts: 29
addes3 02 Dec 2011, 03:58
B does not compile because the "struc" is put inside the macro, so once the macro is created it is taken out of the source, leaving the last "}" all by it's self.


The "rept" leaves "struc m2 { . dd ?" behind, whereas the macro leaves nothing behind.
Post 02 Dec 2011, 03:58
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 02 Dec 2011, 10:25
addes3 wrote:
B does not compile because the "struc" is put inside the macro, so once the macro is created it is taken out of the source, leaving the last "}" all by it's self. The "rept" leaves "struc m2 { . dd ?" behind, whereas the macro leaves nothing behind.

Hmm, I think it has nothing to do with that, Because ..
Code:
;does not compile
macro m {
struc m2 { . dd ? }
}
m ;<-- (incomplete macro)

;---------------------------------------
;does compile
macro m {
struc m2 { . dd ? \}
}
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 02 Dec 2011, 10:25
View user's profile Send private message Send e-mail 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.