flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > labels inside macros

Author
Thread Post new topic Reply to topic
peter müller



Joined: 18 Feb 2004
Posts: 4
Location: LE / Germany
peter müller 22 Feb 2004, 20:04
Hi got the following code

macro crc16r_decode {
mov dh,dl
shr dl,1
xor dh,al
test dh,1
jz .no_xor
xor eax, 18005h
.no_xor:
shr eax,1
}

foo:
repeat 8
crc16r_decode
end repeat

i get the the following error:
.no_xor:
error: symbol already defined.

how can this problem solved ?

with best regards
peter
Post 22 Feb 2004, 20:04
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 22 Feb 2004, 20:15
Strange behaviour, though it seems to work if you manually repeat this block 8 times, instead of using repeat directive. That is after adding "local .no_xor" to beginning of macro of course.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 22 Feb 2004, 20:15
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 22 Feb 2004, 23:13
You can use @@ as label name, and @F to refer to it:

Code:
macro crc16r_decode {
mov dh,dl
shr dl,1
xor dh,al
test dh,1
jz @F
xor eax, 18005h
@@:
shr eax,1
}

foo:
repeat 8
crc16r_decode
end repeat    


But it should work with local .no_xor, seems to be something with repeat block.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 22 Feb 2004, 23:13
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number 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.