flat assembler
Message board for the users of flat assembler.

Index > Main > Need help with proc (Fasm 1.62 last verion)

Author
Thread Post new topic Reply to topic
flaith



Joined: 07 Feb 2005
Posts: 122
Location: $300:20 58 FC 60 N 300G => Vietnam
flaith 16 Jun 2005, 13:11
hi,
i need to understand why it doesn't work anymore !

Code:
format PE GUI 4.0
entry start

include 'win32a.inc'

section '.code' code readable executable
start:
    stdcall Aff_Element,0
    stdcall Aff_Element,5
    invoke  ExitProcess,0
ret

proc Aff_Element, numElement
    push    ebx esi edi
    mov     edi,[numElement]
;    shl     edi,2
;    invoke  MessageBox,0,[_pointer2array+edi],_caption,0
; ou
    invoke  MessageBox,0,[_pointer2array+edi*4],_caption,0
    pop     edi esi ebx
    ret     ;return
endp                            ;after compiling: ERROR: Invalid name ???

section '.data' data readable writeable

_caption       db 'Test array',0

_simple_array:
    cat        db 'cat',0
    dog        db 'dog',0
    dolphin    db 'dolhpin',0
    monkey     db 'monkey',0
    donkey     db 'donkey',0
    pig        db 'pig',0
    end_array  db 0,0

_pointer2array dd cat,dog,dolphin,monkey,donkey,pig  ;0->cat; 5->pig

section '.idata' import data readable writeable

    library kernel32, 'KERNEL32.DLL',\
            user32,   'USER32.DLL'

    include 'apia\kernel32.inc'
    include 'apia\user32.inc'  
    


Error: Invalid name with 'endp' ???
Thx for your help Embarassed

_________________
Je suis sur de 'rien', mais je ne suis pas sur du 'tout'.
Post 16 Jun 2005, 13:11
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 16 Jun 2005, 13:14
remove a comma after proc's name:

Code:
proc Aff_Element numElement     
Post 16 Jun 2005, 13:14
View user's profile Send private message Visit poster's website Reply with quote
flaith



Joined: 07 Feb 2005
Posts: 122
Location: $300:20 58 FC 60 N 300G => Vietnam
flaith 16 Jun 2005, 13:36
oops Embarassed sorry and thanks, i need to change my glasses

_________________
Je suis sur de 'rien', mais je ne suis pas sur du 'tout'.
Post 16 Jun 2005, 13:36
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 16 Jun 2005, 13:42
Modified the new "proc" macro so it won't have problem with such comma:
Code:
macro proc [params]
 { common
    match name arg, params
    \{ if used name
       name:
       match =,args, arg \\{ defargs@proc args \\}
       match =all@args, all@args \{ defargs@proc arg \\} \}
; the rest unchanged    
Post 16 Jun 2005, 13:42
View user's profile Send private message Visit poster's website Reply with quote
flaith



Joined: 07 Feb 2005
Posts: 122
Location: $300:20 58 FC 60 N 300G => Vietnam
flaith 16 Jun 2005, 13:56
done, thanks a lot Very Happy

_________________
Je suis sur de 'rien', mais je ne suis pas sur du 'tout'.
Post 16 Jun 2005, 13:56
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.