flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > proc64 macro trouble

Author
Thread Post new topic Reply to topic
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent 01 Jan 2008, 23:49
Hi.

I wrote following code and got a wrong result:
Code:
proc tep x
   invoke wsprintf,buf,fmt,[x] ; x equ ebp+10h, but [ebp+10h] is undefined!
    ret
endp
    


So, I see the two ways to correct it: manually filling stack parameters area from registers or fix proc macro to implement copying parameters to the stack, e.g.
Code:
proc tep x
   ; prologue begin
    push rbp
    mov  rbp,rsp
        mov  [x],rcx   ; real copy parameters
       virtual at rcx ; or just aliasing it
          x dq ?
    end virtual
 ; prologue end

  invoke wsprintf,buf,fmt,[x] ; well, [x] is correct
  ret
endp
    


It would be better, if real copying block can be optional, for optimization purposes.
Post 01 Jan 2008, 23:49
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 02 Jan 2008, 09:45
Post 02 Jan 2008, 09:45
View user's profile Send private message Visit poster's website 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.