A83: IndexOf program... Help!


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

A83: IndexOf program... Help!




Can someone help me out and tell me what's up with this? It should find
the index of str1 (1 Char) in str9, then return it to user variable A.
It works for some cases but not others... Such as,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"->Str9
"0"->Str1
The program will run but when you try to recall A it locks up. Although,
a shorter string, "ABCDEFGHI" and "H". It works fine.

	call _zeroop1
	ld hl,op1
	ld (hl),$04
	inc hl
	ld (hl),$AA
	inc hl
	ld (hl),8
	call _chkfindsym
	jp c,_errundefined
	ex de,hl
	ld c,(hl)
	inc hl
	ld b,(hl)
	push bc
	inc hl
	ld de,index
	ldir

	call _zeroop1
	ld hl,op1
	ld (hl),$04
	inc hl
	ld (hl),$AA
	inc hl
	ld (hl),0
	call _chkfindsym
	jp c,_errundefined
	ex de,hl
	inc hl
	inc hl
	ld a, (hl)

	ld hl, index
	pop bc
	ld e, c
	cpir
	
	ld a, c
	sub e
	sub 1
	call _setxxop1
	call _pushrealo1
	call _zeroop1
	ld hl,'A'
	ld (op1+1),hl
	call _stoother
	ret
index


-- 
Scott "_Wrath_" Dial
homosapian@geocities.com
ICQ#3608935
http://www.geocities.com/~homosapian/


Follow-Ups: