flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
peter müller 23 Feb 2004, 19:30
Hi,
following code doesn't work. also local and @@ dosen't work 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 see also: http://board.flatassembler.net/topic.php?t=1106 with best regards peter[/url] |
|||
![]() |
|
Tomasz Grysztar 23 Feb 2004, 19:42
Here's the quick and dirty solution with numerical constant as a redefinable moving pointer for base of repeated code (we can't just use constant to keep the pointer to "no_xor", because it cannot be forward-referenced):
Code: virtual at 0 mov dh,dl shr dl,1 xor dh,al test dh,1 jz no_xor xor eax, 18005h no_xor: shr eax,1 end virtual macro crc16r_decode { local base base = $ mov dh,dl shr dl,1 xor dh,al test dh,1 jz base+no_xor xor eax, 18005h ;base+no_xor: shr eax,1 } repeat 8 crc16r_decode end repeat |
|||
![]() |
|
comrade 23 Feb 2004, 21:34
Doesn't local directive imply that given label is local for this macro?
|
|||
![]() |
|
Tomasz Grysztar 23 Feb 2004, 22:05
Yes, but this macro is processed only once, at it occurs only once in source. The "repeat" directive is processed at assembly time, when macro is already replaced with the preprocessed instructions, so the "base" is the same symbol in the each repetition, as it is just the same line of preprocessed source.
|
|||
![]() |
|
JohnFound 23 Feb 2004, 22:19
Hi, Privalov.
What if there is some preprocessor directive for "phisical" repeading macroses? I know this will enlarge the memory requirements, but if the count is reasonably small, (and it is, in most of the cases) it may solve a lot of problems like above. Regards. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.