Making a Programming Language From Scratch/Function Definitions

Function definitions

edit

There is nothing called functions in assembly. However, there is a mildly resembling counterpart called procedures. However procedures do not return any values. This critical problem will be discussed later on.

Syntax of function definition using PROC

edit

It is not a necessity to use the PROC keyword for all your function declarations. However it is much easier to do it this way instead of its counterpart method involving code segment pointers. The syntax for function definitions using PROC is as follows:

[ Func name ] PROC [param1] [param2]...
.
.
.
[ Func name ] ENDP

All functions have to be declared this way.