Initial git release
[ZeXOS.git] / apps / test / start.asm
blobe2d97d618342dbab5d1e0cd1255e5da07f47c2b0
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!
22 %macro IMP 1
23 %ifdef UNDERBARS
24 EXTERN _%1
25 %define %1 _%1
26 %else
27 EXTERN %1
28 %endif
29 %endmacro
31 %macro EXP 1
32 GLOBAL $_%1
33 $_%1:
34 GLOBAL $%1
35 $%1:
36 %endmacro
38 [BITS 32]
39 global _start
40 _start:
41 ;mov esp, _sys_stack
42 ; This points the stack to our new stack area
44 jmp stublet
46 cls:
47 mov eax, 6
48 int 0x80
49 ret
51 putch:
52 mov ebx, '.'
53 mov eax, 4
54 int 0x80
55 ret
57 ; This is an endless loop here. Make a note of this: Later on, we
58 ; will insert an 'extern _main', followed by 'call _main', right
59 ; before the 'jmp $'.
60 stublet:
61 call cls
63 mov CL, 10 ;{do registru CL dosaï 10, poèet krokù}
64 nav: ;{návì¹tí, tady umístíme opakovanou èinnost}
65 dec CL ;{odeèti od CL èíslo 1}
66 call putch
67 jnz nav ;{jestli¾e není nula skoè na návì¹tí}
69 ;jmp $
70 ret
72 ; Here is the definition of our BSS section. Right now, we'll use
73 ; it just to store the stack. Remember that a stack actually grows
74 ; downwards, so we declare the size of the data before declaring
75 ; the identifier '_sys_stack'
76 ;SECTION .bss
77 ; resb 512 ; This reserves 8KBytes of memory here
78 ;_sys_stack: