83Plus:Software:usb8x/Asm Interface/FindDescriptor

From WikiTI
Revision as of 21:58, 15 July 2006 by Dan Englender (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Synopsis

Name: FindDescriptor

Minimum usb8x version: 0.05

Find the first instance of a descriptor entry in the config descriptor listing

Inputs

  • B: Descriptor type
  • HL: Address of descriptor list

Outputs

  • DE: Points byte after entire descriptor listing
  • HL: Points to requested descriptor
  • NC: Success

Destroys

  • AF, BC

Notes

This routine only finds the first instance of a descriptor. There is an internal routine to find additional instances, but it does not currently have an entry point. This will be fixed in future versions.

Example

ld   hl,DescriptorBuf    ;Temporary buffer to hold config descriptor
ld   b,descConfig
push hl
call ReadDescriptor      ;Read config descriptor from device
pop  hl
jp   c,Error
ld   b,descEndpoint
call FindDescriptor      ;Search for endpoint descriptor within config descriptor

See Also

  • [[../ReadDescriptor|ReadDescriptor]] - Reads a descriptor from device