Subversion Repositories Kolibri OS

Rev

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

  1. ; --------------------------------------------------------------------------
  2. ; FILE: TString.Asm
  3. ; DATE: September 21, 2008
  4. ; --------------------------------------------------------------------------
  5.  
  6. ; --------------------------------------------------------------------------
  7. ; Input:
  8. ;   ESI = source string
  9. ;   EDI = destination string
  10. ; --------------------------------------------------------------------------
  11. align PROC_ALIGN
  12. TString_Copy:
  13.     mcZeroBits eax
  14.  
  15. .more:
  16.     lodsw
  17.     stosw
  18.     mcOnRegNotZero eax, .more
  19.  
  20.     ret
  21.  
  22. ; --------------------------------------------------------------------------
  23. ; Input:
  24. ;   ESI = source string
  25. ;   EDI = destination string
  26. ; --------------------------------------------------------------------------
  27. align PROC_ALIGN
  28. TString_AnsiCopy:
  29.     mcZeroBits eax
  30.  
  31. .more:
  32.     lodsb
  33.     stosb
  34.     mcOnRegNotZero eax, .more
  35.  
  36.     ret
  37.  
  38. ; --------------------------------------------------------------------------
  39. ; Input:
  40. ;   ESI = string #1
  41. ;   EDI = string #2
  42. ; Output:
  43. ;   CF=1 if strings are same
  44. ; --------------------------------------------------------------------------
  45. align PROC_ALIGN
  46. TString_AnsiEqual:
  47.     push    esi edi
  48.  
  49. .check_both:
  50.     cmpsb
  51.     jne     .ret_false
  52.  
  53.     cmp     byte [esi - 1], 0
  54.     jne     .check_both
  55.  
  56.     pop     edi esi
  57.     stc
  58.     ret
  59.  
  60. .ret_false:
  61.     pop     edi esi
  62.     clc
  63.     ret
  64.  
  65. ; --------------------------------------------------------------------------
  66. ; Input:
  67. ;   ESI = source string
  68. ;   EDI = destination string
  69. ; Output:
  70. ;   EDI = set to concatenate another string
  71. ; --------------------------------------------------------------------------
  72. align PROC_ALIGN
  73. TString_CopyEx:
  74.     call    TString_Copy
  75.     sub     edi, 2
  76.     ret
  77.  
  78. ; --- EOF ---
  79.