Re: A86: VAT searching


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

Re: A86: VAT searching




yeah, I needed a routine like this for one of my progs...here is an
example...

 ld hl,StartingName       ; init the loop
 rst 20h                  ; copy name to OP1
VATSearchLoop:
 sub a                    ; clear A -- search only program vars
 call _FindAlphaUp        ; find next matching name in the VAT
 jr c,DoneSearchingVAT    ; if carry, then we're at the end
 rst 10h                  ; grab name from the VAT (_FINDSYM)
 call _ex_ahl_bde         ; _FINDSYM returns in AHL, swap to BDE
 call _check_asm          ; is it an asm program?
 jr z,VATSearchLoop       ; we can skip those
 call _get_word_ahl       ; copy the first to bytes to DE (we can skip
that)
 call _get_word_ahl       ; get next two bytes
                          ; yeah, this part sucks, but I'm lazy :)
 ld a,'t'                 ; 't'
 cp e                     ; check first char
 jr nz,VATSearchLoop      ; didn't find it, continue loop
 ld a,'e'
 cp d
 jr nz,VATSearchLoop
 call _get_word_ahl
 ld a,'x'
 cp e
 jr nz,VATSearchLoop
 ld a,'t'
 cp d
 jr nz,VATSearchLoop

; when you get here, you should have one of your programs
; you're on your own :)

StartingName:
 .db $12,1,0

~Nick 

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]


Follow-Ups: References: