Subversion Repositories Kolibri OS

Rev

Rev 3906 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3906 Rev 6699
Line 1... Line -...
1
use32
-
 
2
        db      'MENUET01'
-
 
3
        dd      1
-
 
4
        dd      start
-
 
5
        dd      i_end
-
 
6
        dd      mem
-
 
7
        dd      mem
-
 
8
        dd      0
1
format PE console 0.8
9
        dd      0
-
 
10
 
-
 
11
; useful includes
-
 
12
include '../../../../macros.inc'
2
include '../../../../import.inc'
13
purge mov,add,sub
-
 
14
include '../../../../proc32.inc'
-
 
15
include '../../../../dll.inc'
-
 
Line 16... Line 3...
16
 
3
 
17
start:
-
 
18
; First 3 steps are intended to load/init console DLL
-
 
19
; and are identical for all console programs
-
 
20
 
-
 
21
; load DLL
-
 
22
        stdcall dll.Load, @IMPORT
-
 
23
        test    eax, eax
-
 
24
        jnz     exit
-
 
25
 
-
 
26
; yes! Now do some work (say helloworld in this case).
-
 
27
        push    caption
-
 
28
        push    -1
-
 
29
        push    -1
-
 
30
        push    -1
-
 
31
        push    -1
-
 
32
        call    [con_init]
4
start:
33
        push    aHelloWorld
5
        push    aHelloWorld
34
        call    [con_write_asciiz]
6
        call    [con_write_asciiz]
35
        push    0
7
        push    0
36
        call    [con_exit]
-
 
37
exit:
8
        call    [con_exit]
38
        or      eax, -1
9
        xor     eax, eax
Line 39... Line -...
39
        int     0x40
-
 
40
 
10
        ret
Line 41... Line 11...
41
caption      db 'Console test',0
11
 
42
aHelloWorld  db 'Hello, World!',10,0
12
aHelloWorld  db 'Hello, World!',10,0
43
 
13
 
44
align 4
14
align 4
45
@IMPORT:
-
 
46
library console, 'console.obj'
-
 
47
import  console,        \
15
data import
48
        con_start,      'START',        \
16
library console, 'console.dll'
49
        con_init,       'con_init',     \
-
 
50
        con_write_asciiz,       'con_write_asciiz',     \
17
import  console,        \
51
        con_exit,       'con_exit',     \
-
 
52
        con_gets,       'con_gets'
-
 
53
i_end:
-
 
54
 
-
 
55
 
-