* Christmas edition *; fixed irc /os command; small cleanup in fd.c; improvements...
[ZeXOS.git] / apps / invaders / start.asm
blobe4f054ebd291d733dd4e7d08627921048ba15dc4
1 ; ZeX/OS
2 ; Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
4 ; This program is free software: you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation, either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ; This is the kernel's entry point. We could either call main here,
19 ; or we can use this to setup the stack or other nice stuff, like
20 ; perhaps setting up the GDT and segments. Please note that interrupts
21 ; are disabled at this point: More on interrupts later!
23 [SECTION .text]
24 [BITS 32]
26 extern main
27 global entry
29 entry:
30 ; proc vmap
31 mov eax, 46
32 int 0x80
34 ; first we get arguments
35 mov eax, 26
36 mov ecx, 0
37 int 0x80
39 push eax ; argv
41 ; lets get count of arguments
42 mov eax, 26
43 mov ecx, 1
44 int 0x80
46 mov ebx, eax
47 push ebx ; argc
49 call main ; call our program
51 pop ebx
52 pop eax
54 ; proc exit
55 mov eax, 1
56 int 0x80
58 ret