A83: User selected list


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

A83: User selected list




I need to do two things: load a list (L1-L6) and then make sure its 
dimensions are between 1 and 254.  I'm having trouble.  Could someone 
lead me the right way?

get list name into op1:
	ld	a,TL1
	ld	(op1+2),a
	ld	a,OT_REALLIST	;01h = object type:real list
	ld	(op1),a
	ld	a,TVARLST
	ld	(op1+1),a

get the address of the list:
	call	_chkfindsym	;look up list
	jp	c,_errundefined	;no list! quit!

check dimensions of list:
	ld	hl,(VAR_STARTLIST);get the list ptr back from RAM
	ld	c,(hl)
	inc	hl
	ld	b,(hl)
	inc	hl
	ld	(VAR_COUNT),bc	;store this for later

	inc	bc		;this needs to be 1 larger for djnz use (as far as I can tell)

	ld	a,b		;acc = high byte of size
	or	a		;compare high byte to 0
	jp	nz,_erroverflow	;too big

	ld	a,c		;acc = low byte of size
	or	a		;compare low byte to 0
	jp	z,_errdimension	;too small

	ld	a,c		;store useable count
	ld	(VAR_COUNTUSE),a

Any help?  Thanks.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: