Re: A86:Yet more questions from a newbie


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

Re: A86:Yet more questions from a newbie



Assuming the basic program is untokenized and not too big, you can copy it
onto ram page 1 and just search through it...

;name in op1
rst 10h
call _DATA_SIZE_TO_DE
push de
call _SET_ABS_SRC_ADDR
ld a,1
ld hl,$4100  ;$8100 on ram page 1
call _SET_ABS_DEST_ADDR
ex de,hl
call _MM_LDIR_SET_SIZE
call _RAM_PAGE_1

;data now copied to $8100

ld hl,$8100
pop bc
search:
push bc
ld de,compare_string
call _pStrCmp
pop bc
jr z,found_string
cpi                   ;hl=hl+1, bc=bc-1
jp pe,search      ;repeat until bc=0
not_found:
ret

found_string:
;do something


compare_string: .db "exact",0


In a message dated 11/2/2000 6:39:12 PM Eastern Standard Time, Rgdtad@aol.com
writes:


How can I look through a basic program for a specific string?  What I am
going for here is a library type thing except with user defined 'books.'  
Ex:
I want to run the user-defined segment of code that corresponds to 'exact'
(I am working on a math prog where users can define how they want things to
be done).  





----
Jonah Cohen
<ComAsYuAre@aol.com>
http://jonah.ticalc.org