kolibrios-fun/programs/develop/koldbg/disasm/scanitem.inc
Kirill Lipatov (Leency) b34f9856cb upload koldbg by CandyMan
git-svn-id: svn://kolibrios.org@9353 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-12-02 17:13:25 +00:00

51 lines
806 B
PHP

CntItems = 0
ScanItems = 1 ;must be >0, temporary equal 0
EleSize = 6 ;xxh.Size
virtual at 0
Vals::
rb 64*1024
end virtual
macro AddElement Source
{
local A,B,C,Index,Found
C = 0
Index = 0
Found = 0
if ScanItems
repeat CntItems
Found = 0
load B fword from Vals:+(%-1)*EleSize+C
load A fword from Source+C
if A=B
Found = %
Break
else
Found = 0
end if
end repeat
end if
if ~Found
load A fword from Source+C
store fword A at Vals:+CntItems*EleSize+C
dw (CntItems)*EleSize
CntItems = CntItems+1
else
dw (Found-1)*EleSize
end if
}
macro CpyElements Dst
{
local A
Dst rb CntItems*EleSize
repeat CntItems
load A fword from Vals:(%-1)*EleSize
store fword A at Dst+(%-1)*EleSize
end repeat
}