Re: A86: Variables


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

Re: A86: Variables




If we can't read your message, how do you expect to get any help?

god-mail@mailexcite.com wrote:
> And Please Don't Just say My Method Of Typing Is Hard To Read, That Provided
> Me With No Help WhatSoEver!

You can use the registers hl, de, bc, and so on, or you can define data
bytes in your program like this:

.db "This is a string of characters"

There's scads of memory on the TI-86 that are open for your use, as
well.  _plotsscreen and _textShadow are two oft-used RAM areas.

Or... If you really need to make a variable, you have to load its name
into HL, move this to the OP1 register, and then call one of the ROM's
variable creation routines.  You also need to know its length ahead of
time if it is going to be anything but a real, complex, or pic variable
(which are of a fixed length).  After you have created the variable, you
have to move your data into it with the call _mm_ldir, which is similar
to the assembly instruction ldir, but uses absolute addressing.  Example
(makes a string):

	ld hl, varname-1		;loads name and one byte preceding it
	rst 20h				;moves it to OP1
	ld hl, dataEnd-dataStart	;length of new variable
	push hl				;save length
	call _createstrng		;this creates a string 'varname', hl bytes long
					;and leaves a pointer to its location in BDE
	ld a, b				;\
	ld h, d				; makes AHL=BDE
	ld l, e				;/
	call $4C3F			;i think 4c3f is right... this inc's AHL twice
					;so that it points past the length bytes of the 
					;new variable
 	call _set_abs_dest_addr		;set this as destination for _mm_ldir
	xor a				;a=0
	ld hl, dataStart		;your data to move
	call _set_abs_src_addr		;set this as source address for _mm_ldir
	pop hl				;recall length of data
	call _set_mm_num_bytes		;set as number of bytes for _mm_ldir to move
	call _mm_ldir			;move it
	ret
dataStart:
	.db "This is a string of characters to put in a string variable."
dataEnd:



Hope that extremely long message helped in the least.  

Cassady Roop


References: