Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. format ELF
  2.  
  3. include "proc32.inc"
  4.  
  5. section '.text' executable
  6.  
  7. public _ksys_debug_out
  8. public debug_out_str
  9.  
  10. align 4
  11. proc _ksys_debug_out stdcall, c:dword
  12.  
  13.   pushad
  14.  
  15.   xor ecx,ecx
  16.   mov   cl,byte[c]
  17.   mov   ebx,1
  18.   mov   eax,63
  19.   int   0x40
  20.  
  21.   popad
  22.  
  23.   ret
  24.  
  25. endp
  26.  
  27. align 4
  28. proc debug_out_str stdcall, s:dword
  29.  
  30.         pushad
  31.      
  32.         mov eax,[s] ;eax=pointer to string
  33.         next_simbol_print:
  34.  
  35.                 xor ebx,ebx
  36.                 mov bl,[eax]
  37.                 test bl,bl
  38.                 jz exit_print_str
  39.  
  40.                 cmp bl,10
  41.                 jne no_new_line
  42.                         mov ecx,13
  43.                         stdcall _ksys_debug_out, ecx
  44.                 no_new_line:
  45.  
  46.                 stdcall _ksys_debug_out, ebx
  47.                 add eax,1
  48.  
  49.         jmp next_simbol_print
  50.  
  51.         exit_print_str:
  52.  
  53.         popad
  54.  
  55.         ret
  56. endp
  57.