Re: A83: reading external strings


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

Re: A83: reading external strings




I don't know exactly what you wnna do but here the code to find the
prgram:

	call	_zeroop1	; Clear op1
	ld	hl,Progname	; HL->Progname
	ld	de,op1		; DE->op1
	ld	bc,5		; BC=Name Legnth+1
	ldir			; Copy to op1
	call	_chkfindsym	; HL->size of prog, DE->sym table entry
	ret	c		; If the prog isn't there, return
	ex	de,hl		; Exchange HL and DE
	ld	d,(hl)		; DE=Prog size
	inc	hl
	ld	e,(hl)
	inc	hl		; HL->First byte of data

; Now you do whatever you want with the strings in the prog

Progname:
 .db 5,"Prog"			; 5=objnumber, Replace PROG with program name

-------------------------------------------------------------

If you now want to read one character and display it do this:

	ld	a,(hl)		; A=CHaracter
	call	_putc		; Disp character

-------------------------------------------------------------

Now supposing you wnated to display the whole program/string, you could
do this from the first part of code:

Disp:
	ld	a,(hl)		; A=CHaracter
	call	_putc		; Disp character
	dec	de		; DE=DE-1
	ld	a,d		; A=D
	or	e		; Is DE 0
	jr	nz,Disp	; If not, do it again


<<<<<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>>>>>>
       See ya,
       Mastermind

       http://www.bigfoot.com/~mastermind5


On Sat, 21 Nov 1998 13:42:11 -0800 "The Man in the Moon" <mecad@scv.net>
writes:
>
>Any way to read external strings from an outside program that is all
>strings?
>
>From: Chris
>(Man in the Moon)
>mecad@scv.net
>
>

___________________________________________________________________
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/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]