flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
pelaillo 06 May 2004, 13:05
Weird, there is a problem with macro substitution. "if-else" does it right.
I'm puzzled ¿? Compiling this: Code: macro select a,b,c { if b > c display 'b > c = TRUE',0Dh,0Ah display 'before a,b,c = ',a+30h,', ',b+30h,', ',c+30h,', ',0Dh,0Ah a equ b display 'after equ a,b,c = ',a+30h,', ',b+30h,', ',c+30h,', ',0Dh,0Ah else display 'b > c = FALSE',0Dh,0Ah display 'before a,b,c = ',a+30h,', ',b+30h,', ',c+30h,', ',0Dh,0Ah a equ c display 'after equ a,b,c = ',a+30h,', ',b+30h,', ',c+30h,', ',0Dh,0Ah end if } myvar equ 0 display 'myvar = ',myvar+30h,0Dh,0Ah select myvar,3,7 display 0Dh,0Ah,'myvar = ',myvar+30h,0Dh,0Ah select myvar,6,4 display 0Dh,0Ah,'myvar = ',myvar+30h,0Dh,0Ah myvar equ 6 display 0Dh,0Ah,'myvar = ',myvar+30h Will result in: Code: myvar = 0 b > c = FALSE before a,b,c = 3, 3, 7, after equ a,b,c = 7, 3, 7, myvar = 7 b > c = TRUE before a,b,c = 7, 6, 4, after equ a,b,c = 6, 6, 4, myvar = 4 myvar = 6 |
|||
![]() |
|
decard 06 May 2004, 13:32
maybe it's because IF's are processed at assembly stage, so they will be calculated *after* equ's.
|
|||
![]() |
|
Tomasz Grysztar 06 May 2004, 14:37
See the third question in the FAQ.
Last edited by Tomasz Grysztar on 11 Jun 2005, 18:40; edited 1 time in total |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.