A83: Detection Routine Help


[Prev][Next][Index][Thread]

A83: Detection Routine Help




I need someone to look over this loop routine that I made for myself which 
uses the DETECT library from ZLIB, and it will store the Address outputted 
from that Library to a place in RAM, increase that RAM pointer to store the 
progs found sequentially, then increase the Var that tells how many progs 
were found once it leaves the routine. Although, I seems to not be working 
because this was the newest thing I included in my prog and it crashed. I 
could use some help here please, I've included the I/O for that SOS library 
below for you to reference to. Can someone help me find out whats wrong, 
thanks... =)

Jason_K


Detect_Programs:
	xor a
	ld (Num_Progs), a
	ld de, PROGPTR
	ld ix, Address_Buffer
Detect_Loop:
	push ix
	ex de, hl
	ld ix, Detect_String
	call DETECT
	pop ix
	ret z
	ld a, (Num_Progs)
	inc a
	ld (Num_Progs), a
	ld (ix), l
	ld (ix+1), h
	inc ix
	inc ix
	jp Detect_Loop

Address_Buffer = SAVESSCREEN
Num_Progs:   .db 0
DETECT = vector0     ;SOS Library
Detect_String:  .db "Detect Me!",0

;DETECT (lib 4)
;Detect a program (var type 6) on the symbol table.
;Input:	hl=place to begin looking ( (vat) if first time etc)
;	ix->String to check for in a program (0 terminated)
;Output:de=place stopped
;	hl->program data (after the string)
;	z=0 if found, z=1 if not found
;	b=0
;Registers destroyed: af bc de hl