flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Complex conditions in .IF, .WHILE...

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 201
alorent
Hello Tomasz,

I found another problem with new IF.INC macros.

The following code worked OK with previous IF.INC:


Quote:

include 'if.inc'

jmp .mylabel

.if eax
.endif

.mylabel:



But it fails with "undefined symbol .mylabel" for the new version of IF.INC.

Thanks.
Post 11 Jan 2006, 23:39
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
Hey, you just found a bug in the IRPS directive! Wink Try with 1.65.6.

As for the second problem, it needs correction in the macro.
Post 11 Jan 2006, 23:47
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
I updated the above attachment with the correction (just some labels needed to get preceded with double dots). Also the fasmw 1.65.6 package already contains the new version of IF.INC.
Post 11 Jan 2006, 23:52
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 201
alorent
Tomasz, you are not only a genious but you also offer the perfect support for a software!!!

It worked just FINE! Very Happy

Thanks man!
Post 11 Jan 2006, 23:59
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Can the macros be nested, for instance a .if within .if?

_________________
silkodyssey
Post 13 Jan 2006, 02:03
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
Of course. Wink
Post 13 Jan 2006, 03:07
View user's profile Send private message Visit poster's website Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Ah yes, I did a little test that produced an error but I just saw the source of the error was something else. Sorry for the annoyance but thanks for replying anyway. Very Happy

_________________
silkodyssey
Post 13 Jan 2006, 03:13
View user's profile Send private message MSN Messenger Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
I've tried clicking of the download link for the IF.INC file in the post dated: 11 Jan 2006, 15:54.

All I get is a 0 byte file named 2001.

What am I doing wrong? I don't think I've ever had a problem downloading a file from this site.

Thanks for these new features Tomasz!

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 13 Jan 2006, 04:32
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Tomasz Grysztar wrote:
Well, BTW, I have almost no comments in fasm's sources, but still have no such problems with my code, even the parts written six years ago. Wink Well, the label naming and some code conventions do help, anyway...


I noticed (in 1.65.7 for DOS) that you commented only 192 lines of code (out of 21,832). That's less than one percent!!! Shocked
Nevertheless, I'm glad you didn't use too much high-level stuff in there.

P.S. Why not just upload a diff of the changes from 1.64 to the current experimental release (e.g., for 1.65.8)? Got something against diff and patch? Or how about just the updated .EXE?

P.P.S. Today's the day to load up on Lucky Charms. Bon appetit! Laughing
Post 13 Jan 2006, 10:50
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
The updated version of macros allows now also the "signed" prefix for <, >, <=, >= comparisons, like:
Code:
.if signed eax > 0
 ; ...
.endif    

farrier: is this problem repeating?
Post 15 Jan 2006, 17:25
View user's profile Send private message Visit poster's website Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
Tomasz,

I just tried it again and the same thing happened. But, I have DownLoad Accelerator Plus set up to intercept and handle downloads. It creats either a zero byte length file or a 5kB file with HTML code. I just tried right clicking on the download link and chose Save File As and it saved a file named Download.php with the If.Inc file contents. Usually the right click doesn't work for me with the download.php thing. It seems to be working the opposite way it usually does; it might be my machine. But, problems solved. I had looked at the file in the source code for 1.65, and so far everything seems to work as expected Very Happy .

Thanks again,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 15 Jan 2006, 17:44
View user's profile Send private message Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 201
alorent
Thanks for the signed updated. This is becoming a real powerful macro Smile
Post 16 Jan 2006, 06:43
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
shism2 wrote:
is there a possibilty of you adding author ( asmgges ) hll .on macros ?

The condition parsing macros are made in a way which allows to add easily any new syntaxes, like:
Code:
macro .on cond,[instr]
{
  common local ..else
  JNCOND ..else,cond
  instr
  ..else:
}

.on eax=ecx & signed ebx>0, invoke ExitProcess,0    
Post 08 Feb 2006, 10:22
View user's profile Send private message Visit poster's website Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
code:
Code:
.if eax = 0
 inc eax
.endif
    

generate:
Code:
cmp eax,0
jnz ...
    

maybe it possible to do it like in masm, to generate
Code:
test eax,eax
jnz ...
    
Post 11 Feb 2006, 15:34
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
Simple
Code:
.if eax    

does it with the TEST instruction.

It's very simple to add such optimization there, anyway. And possibly even some more?
Post 11 Feb 2006, 15:44
View user's profile Send private message Visit poster's website Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
Tomasz Grysztar
Thank you for quick reply.
Post 11 Feb 2006, 17:01
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Has the syntax for doing signed comparisons with the .if macros changed? The example shown in this thread doesn't seem to work. I am using fasm 1.65.7

_________________
silkodyssey
Post 14 Apr 2006, 16:58
View user's profile Send private message MSN Messenger Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Ah I've found the problem, I was testing it with the equality operator. It works fine.

_________________
silkodyssey
Post 14 Apr 2006, 17:06
View user's profile Send private message MSN Messenger Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
I think a .break (and maybe .continue) macro would be a good addition to the .if macro set. Any thoughts on the idea?

_________________
silkodyssey
Post 14 Apr 2006, 17:31
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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.