Re: A85: VAT search


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

Re: A85: VAT search




Here is the code i use in Solomon's Key, maybe this helps:

;input:
;  b - the Nth entry sol's key v1.0 level ( 0,1,2,..,N-1 if N levels )
;output:
;  c flag set if entry does not exist
;  c flag reset
;    hl - pointer to Level name (length indexed, not null terminated)
;destroys:
;  af,bc,de,hl
FindVATEntry:
   inc b                        ;start at 1 instead of 0
   ld hl,VAT_START-10           ;scan VAT, skip first entry
FVE_Loop:
   ld a,$0C                     ;search for strings
   push bc
   call SEARCH_VAT              ;de now has first byte of data for string
   pop bc
   ret c                        ;finished searching VAT and didn't find
   ld a,(de)
   cp 5                         ;is it a sol's key lvl? (1st byte of string
is 5)
   jr nz,FVE_Loop               ;string was not a sol level so look for next
   inc de
   ld a,(de)                    ;put level version in a
   or a                         ;is level version 0 (1st version)?
   jr nz,FVE_Loop               ;version not supported sol look for next

   ;if you get here, string is a Sol's Key level v1.0
   djnz FVE_Loop                ;find the Nth sol's key level, dec b

   ;if you get here, string is level N
   inc de                       ;after version number comes level's name
   ex de,hl                     ;put pointer to level name in hl
   or a                         ;reset carry flag
   ret

-mike pearce


-----Original Message-----
From: PXGray@aol.com <PXGray@aol.com>
To: assembly-85@lists.ticalc.org <assembly-85@lists.ticalc.org>
Date: Tuesday, December 08, 1998 10:01 PM
Subject: Re: A85: VAT search


>
>In a message dated 12/8/98 8:25:29 PM US Eastern Standard Time,
>dines@resnet.gatech.edu writes:
>
>> RST 20 \ RST10 searches for a var you knwo the name of, if you need a
list
>>  of vars of a special type/with a specific header etc, they don't really
>>  help.
>
>I need to search for data with a specific header, I would not know the name
of
>it.  I know Usgard has a VAT_SEARCH command, but I don't know how to use
it.
>I can't interpret how the shells use it either.  I have seen source
examples,
>but I am still confused.
>