Subversion Repositories Kolibri OS

Rev

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

  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.  
  11. ; useful includes
  12. include '../../../../macros.inc'
  13. purge mov,add,sub
  14. include '../../../../proc32.inc'
  15. include '../../../../dll.inc'
  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
  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]
  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.  
  41. caption      db 'Console test',0
  42. aHelloWorld  db 'Hello, World!',10,0
  43.  
  44. align 4
  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:
  54.  
  55.  
  56. align 4
  57. rb 2048 ; stack
  58. mem:
  59.