User defined functions?
Hey, I'm back with a few more questions on assembly 
Anyways, I've been trying to make my own function that adds 2 numbers but I ran into a couple of problems. Hopefully you guys can help me out a little.
Okay, so I have a question about what happens after you call the function. For some reason after I do "call Addition" all code after that is completely ignored and the program just closes. No idea why that's happening.
Second question, I sort of understand how to use the base pointer register. Inside the function I can do [ebp+8],[ebp+12]..etc for the parameters to the function but... what happens to the base pointer right after the function is called? Will [ebp+8] still give me the first parameter?
Err.. Third question. What the hell does RET do. It's killing me... I have absolutely no idea why it's there. As soon as I typed "Addition proc" into WinAsm studio it automatically puts it there for me so I'm guessing it's important.
Last question. I've seen people do "esp+12" sometimes. And I believe it's because there are 3 4 byte addresses pushed onto the stack and I guess it "removes" them.. Not sure about that and that's why i'm asking this question. ALSO... why would you ever do "esp+12", if you don't clear the stack will it affect the next time I call a function?
Alright I'm done.. Sorry for all the questions. Thanks to anyone who takes their time to even look at this.
~David

Anyways, I've been trying to make my own function that adds 2 numbers but I ran into a couple of problems. Hopefully you guys can help me out a little.
Code:
.386 .model flat,stdcall option casemap:none include\masm32\include\windows.inc .code main: Addition proc x:DWORD, y:DWORD mov eax,[ebp+8] add eax,y Ret Addition EndP push 10 push 5 call Addition end main
Second question, I sort of understand how to use the base pointer register. Inside the function I can do [ebp+8],[ebp+12]..etc for the parameters to the function but... what happens to the base pointer right after the function is called? Will [ebp+8] still give me the first parameter?
Err.. Third question. What the hell does RET do. It's killing me... I have absolutely no idea why it's there. As soon as I typed "Addition proc" into WinAsm studio it automatically puts it there for me so I'm guessing it's important.
Last question. I've seen people do "esp+12" sometimes. And I believe it's because there are 3 4 byte addresses pushed onto the stack and I guess it "removes" them.. Not sure about that and that's why i'm asking this question. ALSO... why would you ever do "esp+12", if you don't clear the stack will it affect the next time I call a function?
Alright I'm done.. Sorry for all the questions. Thanks to anyone who takes their time to even look at this.

~David