diff --git a/src/compare.a b/src/compare.a index 903507a..7bfb001 100644 --- a/src/compare.a +++ b/src/compare.a @@ -1,180 +1,7 @@ WILDCARD = $97 ;------------------------------- -; SearchPages subroutine -; written by qkumba -; search for a string occurring anywhere -; in 16 consecutive pages of memory -; #WILDCARD in search string matches any 1 byte -; (like "." character in regular expressions) -; in: A = page address -; Y = string length -; stack = string to find -; out: C clear if string found -; or set if not found -; If C is clear, then -; A = page where string was found -; X = starting offset where string was found -; all other registers and flags clobbered -;------------------------------- -SearchPages -;set end point for the search - - tax - clc - adc #$10 - sta .endvalue+1 - txa - bne SearchPageImm - -;------------------------------- -; SearchPage subroutine -; written by qkumba -; same as SearchPages, but for a single page -; in: A = page address -; Y = string length -; stack = string to find -; out: C clear if string found -; or set if not found -; If C is clear, then -; X = starting offset where string was found -; all other registers and flags clobbered -;------------------------------- - -SearchPage -;set end point for the search - - tax - inx - stx .endvalue+1 - -; set high part of initial search position - -SearchPageImm - sta search+2 - pla - sta match_buffer1+1 - sta match_all+1 - pla - sta match_buffer1+2 - sta match_all+2 - tax - sty match_size1+1 - sty match_size2+1 - -; fetch last byte to improve search speed - -match_buffer1 - lda $d1d1,y ; modified at runtime - sta check_byte1+1 - sta check_byte2+1 - -; set low part of initial search position - - tya - dey - sty cont_search+1 - -; set return address - - clc - adc match_buffer1+1 - tay - bcc plus01 - inx -plus01 - txa - pha - tya - pha - -; set match position - - inc match_all+1 - bne plus02 - inc match_all+2 -plus02 - - lda #