Re: A86: creating string routines


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

Re: A86: creating string routines




In a message dated 6/21/99 20:13:09 Eastern Daylight Time, McBorder@aol.com 
writes:

> im working on a program that uses strings to store data and plan on making 
an 
> 
>  on calc editor.
>  how do you use the _CREATESTRNG   equ      472Fh   routine??
>  do you have to create it then use findsym to access it?


from asmstudio:


_createstrng Routine

Creates a new string variable. The data is not initialized to any value.


Input	OP1 = name of variable (in variable name format)
HL = number of bytes to allocate
Output	BDE = pointer to variable data (absolute)
OP4 = variable name
HL = pointer to symbol table entry
RAM page 7 is loaded, making HL a valid pointer
Defined in ti86asm.inc:


_createstrng	.EQU	472Fh


so if you want to access the string after it's created, you would do this:

	ld a,b
	ex de,hl
	call _load_ram_ahl
	inc hl \ inc hl
;now hl points to the first byte.

or if you want to copy a chunk of data (presumably in your program) into a 
string:

	ld a,b
	ex de,hl
	call _ahl_plus_2_pg3
	call _SET_ABS_DEST_ADDR
	ld hl,data_start
	xor a
	call _SET_ABS_SRC_ADDR
	ld hl,data_end-data_start
	call _SET_MM_NUM_BYTES
	call _mm_ldir			;copy data into string

note that this is very similar to a writeback routine.