-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstartup_light.as
More file actions
30 lines (24 loc) · 1.15 KB
/
startup_light.as
File metadata and controls
30 lines (24 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/********************************* startup_light.as *************************
* Author: Agner Fog
* date created: 2018-03-22
* Last modified: 2021-05-26
* Version: 1.11
* Project: ForwardCom library libc_light.li
* Description: startup: program initialization
* C declaration: void _entry_point(int argc, char *argv[], char *envp[])
*
* This is the default startup code for ForwardCom programs.
* This is a light version for small systems. It does not call global
* constructors and destructors, but just calls _main
*
* Copyright 2018-2021 GNU General Public License http://www.gnu.org/licenses
*****************************************************************************/
code section execute align = 4
extern _main: function reguse = 0xFFFFFFFF,0xFFFFFFFF
// execution starts here:
__entry_point function public reguse = 0xFFFFFFFF,0xFFFFFFFF
call _main // call main, the user program
sys_call(1, 0x10) // system call exit
filler // make sure execution stops if the system call returns for some reason
__entry_point end
code end