Re: A86: Mem and _createreal


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

Re: A86: Mem and _createreal




>         .db "A3MEM"             ;In asm studio it says the first byte doesn't matter when
> creating but the second is the length of the name


Here's your problem.  Don't put the type and length bytes in quotes.  If
they are in quotes, the assembler interprets it as being an ASCII value,
and so you are effectively telling the calc to create a variable with a
name length of "3" (51) instead of just 3.  Do this instead:

NM:
	.db 3,"MEM"      ;3 is length byte, "MEM" is name. Byte before 3 is
type (doesn't matter)
       
since the first byte doesn't matter, save a byte and do <LD HL, NM-1>
instead of <LD HL, NM>.  This will point HL to the byte before NM, which
can be anything, because _createReal doesn't care what the type byte is.



>         Also, once I have made the variable, how can I move the memory into it?

Well, the var creation routine should return the variable's mem address,
in absolute form, in BDE.  You can put this in AHL and then use _mm_ldir
to copy the data, or you can decode the absolute address and load the
appropriate RAM page and load it that way.

Cassady Roop


References: