flat assembler
Message board for the users of flat assembler.

Index > Windows > Macro Help!

Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
In dev-c++ theres a function RGB(0,0,0). And it goes like
Code:
RGB(r,g,b)
{
return r+(g<<8)+(b<<16);
}
    

I thought hmm thats gotta be easy to convert to asm.....I was wrong. I keep getting error after error. Can anyone help?

_________________
----> * <---- My star, won HERE
Post 14 Aug 2004, 19:04
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Code:
macro RGB target,r,g,b
 { mov target,r+g shl 8+b shl 16 }

RGB eax,0,0,0    
Post 14 Aug 2004, 19:11
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
havent tested yet but thanks!
Post 14 Aug 2004, 19:13
View user's profile Send private message Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
there is nothing to testing, it is raw and right Very Happy thx Privalov! every time when I see your solutions I start to believe in simplicity in fasm programming.

_________________
Microsoft: brings power of yesterday to computers of today.
Post 16 Aug 2004, 08:54
View user's profile Send private message Reply with quote
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent
Why not implemented return operator?
I mean operator like EXITM at the MASM.

I think, it's very useful macro...
Post 17 Aug 2004, 17:24
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
Agree with you, IceStudent.
Maybe it won't require to rewrite many parts of compiler to allow use of macroses in instructions e.g. mov eax,RGB(0,0,0)?
Post 17 Aug 2004, 19:08
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
It wouldn't require rewriting any parts of compiler, it would require to write a new one.

(I might suggest some HLL->FASM compiler aswell...)
Post 17 Aug 2004, 19:23
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Was that small or what Smile I did 150% scale on my font so I could finally see the writing, but also Ctrl+C -> Ctrl+V to the addressbar or Notepad helped Wink
Post 18 Aug 2004, 09:58
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Joshua



Joined: 12 Jul 2003
Posts: 56
Location: Belgium
Joshua
that's what they call the fine print Wink
Post 18 Aug 2004, 21:41
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
It wouldn't require rewriting any parts of compiler, it would require to write a new one


Would it be such hard to make equates take arguments. It would solve such problems and make preprocesor more powerful. I don't see a big problem here...
Post 20 Aug 2004, 19:59
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
The problem I see is the time needed to implement it. And it's anyway a bit out of the fasm's syntax image. For such purposes I would really recommend some alternative preprocessor, like HLA.
Post 20 Aug 2004, 20:17
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S.
Hmm.. actually return can be implemented with the help of macros. I posted some set of macro which is based on such things: http://board.flatassembler.net/topic.php?t=1889
Post 22 Aug 2004, 10:39
View user's profile Send private message 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.

Powered by rwasa.