Subversion Repositories Kolibri OS

Rev

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

  1. substr:
  2.         push    si di cx
  3.         movzx   cx,byte[ds:si-1]
  4.     @@: mov     al,[ds:si]
  5.         cmp     al,[es:di]
  6.         jne     @f
  7.         inc     si
  8.         inc     di
  9.         dec     cx
  10.         jnz     @b
  11. ;       cld
  12. ;       repe    cmps byte[ds:si],[es:di]
  13.     @@: pop     cx di si
  14.         ret
  15.  
  16. int2str:
  17.         dec     bl
  18.         jz      @f
  19.         xor     edx,edx
  20.         div     ecx
  21.         push    edx
  22.         call    int2str
  23.         pop     eax
  24.     @@: cmp     al,10
  25.         sbb     al,$69
  26.         das
  27.         mov     [ds:di],al
  28.         inc     di
  29.         ret
  30.  
  31. int2strnz:
  32.         cmp     eax,ecx
  33.         jb      @f
  34.         xor     edx,edx
  35.         div     ecx
  36.         push    edx
  37.         call    int2strnz
  38.         pop     eax
  39.     @@: cmp     al,10
  40.         sbb     al,$69
  41.         das
  42.         mov     [ds:di],al
  43.         inc     di
  44.         ret
  45.