Re: A86: I need help in 86 ASM...


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

Re: A86: I need help in 86 ASM...



On Fri, 1 Aug 1997, Dan Eble wrote:

> 	ex de,hl	; we can't compare BC to DE, so swap HL and DE
> 	or a		; this makes the carry flag 0
> 	sbc hl,bc	; this compares HL (input) to BC (table value)
> 	jr z, SymFound	; if HL=BC, the symbol matches
> 	add hl,bc	; restore HL to its former glory
> 	ex de,hl	; swap HL and DE again
> 	jr FindSymLoop

[..snip..]

> Please note that this code would not work if the user entered a symbol not
> in the table.

Also please note that I forgot to increment HL 4 times before the
"jr FindSymLoop."  This is to skip the atomic mass and name pointer parts
of an unmatched record.

--------
Dan Eble (mailto:eble@cis.ohio-state.edu)
         (http://www.cis.ohio-state.edu/~eble)


References: