let's say I have these 2 procedures: dummy_proc_1 proc pusha call function_from_dummy_proc2 popa ret dummy_proc_1 endp dummy_proc_2 proc pusha function_from_dummy_proc2: xor eax,eax ret popa dummy_proc_2 endp ok,the problem is that MASM says that function_from_dummy_proc2 is undefined symbol?I even switched the places of the procedures. wtf,old TASM 5.0 compiles this code flawlessly...the problem is that it aint free.
Posted on 2001-05-06 06:09:00 by Shaolinwu
i'm not sure if i understand this well, but you want to execute the commands under "function_from_dummy_proc2:" by calling it from dummy_proc_1? i don't think that this is possible. you'll have to define "function_form_dummy_proc2" as a procedure as you did with "dummy_proc_1" and "dummy_proc_2" or (but i'm not sure) you can jump to "function_from_dummy_proc2" like this:

jmp function_from_dummy_proc2
but i'm not sure if it is possible to jump from one procedure to the other.....
Posted on 2001-05-06 06:39:00 by [SaFc0n]
afaik all labels in masm are local - you can achieve the same effect in tasm by using '@@' as a prefix for label names. as i'm not using masm i don't know if it's possible to access these labels from other procs.
Posted on 2001-05-06 06:43:00 by tola
Define your label with a double colon to make it visible outside the procedure, like this : function_label::
Posted on 2001-05-06 06:50:00 by karim
Shaolinwu,
let's say I have these 2 procedures:

    dummy_proc_1 proc               ;
    pusha                           ; This is OK
    call function_from_dummy_proc2  ;
    popa                            ;
    ret                             ;
    dummy_proc_1 endp               ;

dummy_proc_2 proc               ;
pusha                           ; Demage stack as only PUSH and never POP
function_from_dummy_proc2:      ;
xor eax,eax                     ;
ret                             ;
popa                            ; Useless - never executed
dummy_proc_2 endp               ;


This way it will be OK :

    dummy_proc_1 proc               ;
    pusha                           ; This is OK
    call function_from_dummy_proc2  ;
    popa                            ;
    ret                             ;
    dummy_proc_1 endp               ;


    function_from_dummy_proc2:      ;
    xor eax,eax                     ;
    retn                            ; Have to be a near return
Good luck!
Posted on 2001-05-06 08:15:00 by forge
thanks karim,that fixed the problem;) forge,those were just some dummy procs i quickly wrote up,all instructions were dummy,no need to comment them:)
Posted on 2001-05-06 11:02:00 by Shaolinwu