Simple problem


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

Simple problem



Hi!

I can't seem to figure out why this doesn't work:
What it should do, is take the (elem)th element of a list of words
(bytepairs) starting at 'location', then put the first byte into e and the
second into a. This compiles fine, but does not give the expected result:

ld b,0
ld a,(elem) ; elem is 0<elem<104
ld c,a
ld hl,location
add hl,bc
add hl,bc
dec hl
dec hl
ld e,(hl)
inc hl
ld a,(hl)

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************