Re: A86: Recalling string variables into programs with asm


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

Re: A86: Recalling string variables into programs with asm



On Thu, 31 Jul 1997 MTNBIKE560@aol.com wrote:

> Does anyone know of a way to write an asm program that would recall a string
> variable into a program?  i.e. if l had a program A that had 15 bytes of
> random letters inside it and had a string B that was also 15 chars. (but
> different), that the asm program would overwrite the contents of prog A with
> the contents of string B.  yeah. that's it.

Fortunately for you, I've been working on a shell that does something very
similar.  Try the following:

Step 1: Create the variable search structures:

	AStruct: .db $12,1,"A"	; $12 is type PRGM, 1 is name length
	BStruct: .db $0C,1,"B"	; $0C is type STRNG, 1 is name length

Step 2: Use rst 20h and rst 10h to find the variables.

	Point HL at AStruct
	rst 20h copies AStruct into OP1
	rst 10h finds "A" and returns its 24-bit address in BDE
		the carry flag is set on failure (I think)

Step 3: Use various functions to do what you need

	$462F translates a 24-bit address in AHL to a 16-bit address
		in HL and sets the proper RAM page.
	$4633 translates a 24-bit address in AHL to a 16-bit address
		in HL and puts the RAM page number into A
		the RAM page is unchanged

	$4637 INC AHL
	$463B DEC AHL

These should be good for getting started.  I take no responsibility for
any demons you summon into your calculator.  It is a good idea not to
release programs using unofficial information.  In fact, people who
distribute such information ought to be... hold on, my doorbell's
ringing... brb

--------
Dan Eble (mailto:eble@cis.ohio-state.edu)
         (http://www.cis.ohio-state.edu/~eble)


References: