flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Looking to make something like this

Author
Thread Post new topic Reply to topic
shism2



Joined: 14 Sep 2005
Posts: 248
shism2 21 May 2006, 23:40
Hope someone helps Very Happy


Well, I'm in need of something like this

mov edx, xorcrypt <a address>,key


In puesdo form :

Code:
macro xorcrypt addressx,key

{
load addressx to b

b  = addressx xor key

store b at  ??????

}    


This would be very difficult from the looks of it. If anyone can help please do.
Post 21 May 2006, 23:40
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 25 May 2006, 17:21
AFAIK, the idea of fasm was not to allow such macros. They can be only used separately (in the way as instructions). So macro cannot be used as operand of other instruction.
Post 25 May 2006, 17:21
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 25 May 2006, 17:42
Post 25 May 2006, 17:42
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 25 May 2006, 20:15
However maybe he can take some ideas from invoke macro which allows to pass as parameter another invoke.

[edit] Maybe you want this?
Code:
macro mov dest, src
{ 
  if 1 
  match =xorcrypt imm =, key, src 
  \{
    if imm eqtype 1 | imm eqtype ''
      mov dest, imm xor key
    else
      display "Invalid immediate operand!!"
      err
    end if
  else 
  \} 
    mov dest, src 
  end if 
} 

mov edx, <xorcrypt address, -1> ; 66 BA F3 FF FF FF
mov edx, address                ; 66 BA 0C 00 00 00 

address:    
[/edit]
Post 25 May 2006, 20:15
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.