Re: LZ: How to do self-modifying code?
[Prev][Next][Index][Thread]
Re: LZ: How to do self-modifying code?
That's not really self-modifying code. If you don't know what your'e
doing you can really mess up using self-modifying code. It can be fun,
but you have to know the opcodes well. What your'e doing does not require
it, and I would definatlly not recommend it with your prob at hand.
<pre>
---
site ignore
On Wed, 28 Aug 1996 AlanBailey@aol.com wrote:
> To store data, you have to have a label.
> stuff:
> .db $00,$00,$0F
>
> to access that data, use this:
> ld hl,PROGRAM_ADDR ;gets start of program, stored by
> ZS
> ld de,stuff ;takes the label
> offset
> add hl,de ;hl now contains the
> address of the first byte
>
> to load numbers to that location:
> ld (hl),a ;would load a into
> the first byte after stuff:
>
> Again, use this somewhere in your code:
> ld hl,ZS_BITS
> set 0,(hl)
>
> Enjoy,
> Alan B.
>
>
</pre>
References: