i have the following macro:

(this is not the entire macro, it's just a template to demonstrate the problem)

foo macro
.code
invoke bar
endm

the problem:

;...
foo ;macro-call

.code
start:
;must process results of bar
end start

actually, bar is not called, so i cannot get the results of it

since the code "invoke bar" is placed before the start-label and the program execution
begins at start-label, the invoke-instruction is skipped

do you have any solutions?

thx
Posted on 2002-03-12 13:54:25 by exzito
first, code should always be in a code segment (in your case, placed
below .code). As for getting the code executed... place the macro
"call" below the start label ;), or put it somewhere else and call/invoke
that...
Posted on 2002-03-12 14:19:12 by f0dder
The whole idea of using a "start:" label is to tell the assembler where to start. If you have existing code and you want to execute other code before it, just place the other code before it but AFTER the start label.

The only other method I know about is to write code into the PE sections so that you run it before the main code but it will be problematic to do and will probably trigger virus scanners.

Regards,

hutch@movsd.com
Posted on 2002-03-12 17:47:32 by hutch--
Before_Start:

foo
jmp After_Start
Start:
jmp Before_Start
After_Start:
call Process_Results
end start
Posted on 2002-03-12 23:24:28 by eet_1024