Chapter 4: Entrypoint Function
As we well know, the result of the compilation process is a set of machine code instructions stored in a binary file containing an executable version of our program prepared for running on a computer according to its architecture.
But the programs being written nowadays generally have more than one function, several instructions, or main loops, so how does the processor recognize the first instruction it should execute? Will it execute the first instruction it finds?
To solve these questions, we will discuss the entrypoint functions, which allow programmers to define which is the first instruction to be run regardless of the position in which it has been placed in the code. We will learn how to create our own entrypoint functions in Bosque.
The following topics will be covered throughout this chapter.
- Why do we need an entrypoint function?
- Writing our first entrypoint function
- Passing arguments and returning values
At...