Subversion Repositories Kolibri OS

Rev

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

  1. ;-----------------------------------------------------------------------------
  2. proc mem.Alloc,size ;/////////////////////////////////////////////////////////
  3. ;-----------------------------------------------------------------------------
  4.         push    ebx ecx
  5.         mov     ecx,[size]
  6.         ;*** add ecx,4
  7.         mcall   68,12
  8.         ;*** add ecx,-4
  9.         ;*** mov [eax],ecx
  10.         ;*** add eax,4
  11.         pop     ecx ebx
  12.         ret
  13. endp
  14.  
  15. ;-----------------------------------------------------------------------------
  16. proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
  17. ;-----------------------------------------------------------------------------
  18.         push    ebx ecx edx
  19.         mov     ecx,[size]
  20.         or      ecx,ecx
  21.         jz      @f
  22.         ;*** add ecx,4
  23.     @@: mov     edx,[mptr]
  24.         or      edx,edx
  25.         jz      @f
  26.         ;*** add edx,-4
  27.     @@: mcall   68,20
  28.         or      eax,eax
  29.         jz      @f
  30.         ;*** add ecx,-4
  31.         ;*** mov [eax],ecx
  32.         ;*** add eax,4
  33.     @@: pop     edx ecx ebx
  34.         ret
  35. endp
  36.  
  37. ;-----------------------------------------------------------------------------
  38. proc mem.Free,mptr ;//////////////////////////////////////////////////////////
  39. ;-----------------------------------------------------------------------------
  40.         push    ebx ecx
  41.         mov     ecx,[mptr]
  42.         or      ecx,ecx
  43.         jz      @f
  44.         ;*** add ecx,-4
  45.     @@: mcall   68,13
  46.         pop     ecx ebx
  47.         ret
  48. endp
  49.