Is this board for questioning asemble?
I looked every page in the assemble book. But I can't find it why.
below, there is two procedure main and dutsem.
I didnt tell compiler to run main procedure but it keeps running when I place dutsem above the main procedure.
Here is the code.

INCLUDE irvine32.inc
.data
kill WORD 10h,20h

.code
main PROC
mov eax, 3h
mov edx, 4h
call dutsem
call DumpRegs
exit
main ENDP

dutsem PROC
add eax, edx
ret
dutsem ENDP
END main
=======================
I changed like below but result shows the same thing.
=======================


INCLUDE irvine32.inc
.data
kill WORD 10h,20h

.code

dutsem PROC
add eax, edx
ret
dutsem ENDP


main PROC
mov eax, 3h
mov edx, 4h
call dutsem
call DumpRegs
exit
main ENDP
END main

someone help me plz~~



Posted on 2009-07-06 00:54:58 by Ninerose
'Exit' doesn't do what you think it does, I suppose (not sure what it's supposed to do anyway... exit is not an x86-instruction, is it? Perhaps some kind of macro or preprocessor directive? Else it shouldn't assemble at all).
Even the main-function in an application is essentially just a function. So you leave it with a ret-instruction.
I think if you replace 'exit' with 'ret', it fixes your problem.
Posted on 2009-07-06 03:00:42 by Scali
found out that exit was for windows exiting instruction. I fix it just same you told me. Thanks~~
Posted on 2009-07-06 03:06:18 by Ninerose