Re: A86: Strings and Asm Prgms
[Prev][Next][Index][Thread]
Re: A86: Strings and Asm Prgms
On Thu, 2 Jul 1998 12:18:15 -0400 "Roy Wong" <rcaa@ix.netcom.com> writes:
>is, how do I make my asm program read a string? I'm sure that most
people 
to read a string:
	ld hl,name_of_string-1
	rst 20h			;move 10 to op1
	rst 10h			;findsym
	ld a,b
	ld h,d
	ld l,e
	call _load_ram_ahl	;$462F
now (hl)=
.dw length of string
.db string
if you have to use absolute addresses: (probly a good idea)
(instead of _load_ram_ahl)
	call _get_word_ahl	;$521D
	push de
	call _SET_ABS_SRC_ADDR	;$4647
	ld e,l
	ld d,h
	xor a
	call _SET_MM_NUM_BYTES	;$464F
	ld hl,where_i_want_my_string
	call _SET_ABS_DEST_ADDR	;$5285
	call _mm_ldir		;$52ED
	pop de
now it's in where_i_want_my_string and de=length
remeber to have this someplace, too:
name_of_string:
	.db 5,"abcde"
that's the length of the name followed by the name itself.
-josh
19C736 1B6C36 1B673E DB61B6 71C736
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
References: