Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. CntItems = 0
  3.  
  4. ScanItems = 1 ;must be >0, temporary equal 0
  5.  
  6. EleSize = 6 ;xxh.Size
  7.  
  8. virtual at 0
  9. Vals::
  10. rb 64*1024
  11. end virtual
  12.  
  13. macro AddElement Source
  14. {
  15. local A,B,C,Index,Found
  16. C = 0
  17. Index = 0
  18. Found = 0
  19.  if ScanItems
  20.  repeat CntItems
  21.    Found = 0
  22.    load B fword from Vals:+(%-1)*EleSize+C
  23.    load A fword from Source+C
  24.    if A=B
  25.      Found = %
  26.      Break
  27.    else
  28.      Found = 0
  29.    end if
  30.  end repeat
  31.  end if
  32.  if ~Found
  33.    load A fword from Source+C
  34.    store fword A at Vals:+CntItems*EleSize+C
  35.    dw (CntItems)*EleSize
  36.    CntItems = CntItems+1
  37.  else
  38.    dw (Found-1)*EleSize
  39.  end if
  40. }
  41.  
  42. macro CpyElements Dst
  43. {
  44. local A
  45. Dst rb CntItems*EleSize
  46.   repeat CntItems
  47.     load A fword from Vals:(%-1)*EleSize
  48.     store fword A at Dst+(%-1)*EleSize
  49.   end repeat
  50. }
  51.