Re: A86: For( loops and Lists


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

Re: A86: For( loops and Lists






On Wed, 25 Aug 1999 13:27:36 EDT Jeanne9005@aol.com writes:
>2) How do I get a number that is at the Xth point in a list?  In 
>BASIC, I 
>know I can just say LIST(X), but how do I do this in ASM?

if possible, it would be better to use byte or word lists instead of ti86
list vars, but if you must use them (to interact with user/other
programs)

(i haven't tested this, but it should work)

_ADRLELE($4B53)	get address of list index
	ade -> start of list
	hl = 1 based index
returns address in ahl; de=(index-1)*10

_GETLTOOP1($4B5F)	load index from list to op1
	ade -> start of list
	hl = 1 based index
returns reals in op1, complex in op1&op2
uses abs move

_PUTTOL($4B7B)	store op to index in list
	ade -> start of list
	hl = 1 based index
	op1/op2 = value to store
uses abs move


to get ade -> start of list:
	ld hl,listname-1
	rst 20h
	rst 10h
	ld a,b

now, to load index X
	ld hl,X
	call _GETLTOOP1

don't forget to have the name of the listvar somewhere:
listname:	.db 5,"xStat"

-josh


___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.