Subversion Repositories Kolibri OS

Rev

Rev 836 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
836 diamond 1
use32
2
        db      'MENUET01'
3
        dd      1
4
        dd      start
5
        dd      i_end
6
        dd      mem
7
        dd      mem
8
        dd      0
9
        dd      0
10
 
3906 leency 11
; useful includes
12
include '../../../../macros.inc'
13
purge mov,add,sub
14
include '../../../../proc32.inc'
15
include '../../../../dll.inc'
836 diamond 16
 
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
3906 leency 22
        stdcall dll.Load, @IMPORT
836 diamond 23
        test    eax, eax
3906 leency 24
        jnz     exit
836 diamond 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]
33
        push    aHelloWorld
34
        call    [con_write_asciiz]
35
        push    0
36
        call    [con_exit]
37
exit:
38
        or      eax, -1
39
        int     0x40
40
 
3906 leency 41
caption      db 'Console test',0
42
aHelloWorld  db 'Hello, World!',10,0
836 diamond 43
 
44
align 4
3906 leency 45
@IMPORT:
46
library console, 'console.obj'
47
import  console,        \
48
        con_start,      'START',        \
49
        con_init,       'con_init',     \
50
        con_write_asciiz,       'con_write_asciiz',     \
51
        con_exit,       'con_exit',     \
52
        con_gets,       'con_gets'
53
i_end:
836 diamond 54
 
55
 
56
align 4
57
rb 2048 ; stack
58
mem: