flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [solved] proc proc / proc :

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
Code:
A)
;both without "if used name"

proc proc
nop
endp

B)
proc : jmp proc
    
"A" does compile, but "B" does not compile.

I understand why "B" does not compile, that seems obvious ...
but about "A", if "B" does not compile, why "A" does compile ?

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 03 Oct 2010, 10:04; edited 1 time in total
Post 03 Oct 2010, 08:23
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
ouadji wrote:
I understand why "B" does not compile, that seems obvious ...
That's not so obvious - if you put B into a source without including "proc" macro, it compiles without a problem.
Post 03 Oct 2010, 09:05
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
Code:
C)
;does not compile

include 'win32a.inc'
proc : jmp proc

D)
;does compile

;include 'win32a.inc'
proc : jmp proc
    

Quote:

That's not so obvious - if you put B into a source without including "proc" macro, it compiles without a problem.
ok Tomasz, I understood why "B" does not compile, and "A" does compile. (both with 'win32a.inc')
The compiler when alone allows the label "proc",
the problem arises when one add the "macro proc".
ok, it makes sense, i understand now. Thank you.


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 03 Oct 2010, 09:43
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
ouadji wrote:
The compiler when alone allows the label "proc",
the problem arises when one add the "macro proc".
And you can still bypass that problem then:
Code:
include 'win32a.inc'
label proc
jmp proc    
Post 03 Oct 2010, 09:47
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

Indeed, your example above compiles without problem. perfect, thank you Tomasz.
(I'll also have to manage the directive "label" in next "wink" <-- Smile )

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 03 Oct 2010, 10:00
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.