Mail Archives: djgpp/2000/03/14/05:33:13
On 14 Mar 2000, Alistair_P SHILTON wrote:
> I was wondering if it is possible to link self-modifying assembler
> code to DJGPP. When I try, I get an error message. So I checked
> the documentation, which says that the code segment is not writable.
> Is there some way around this?
Yes, put the assembly code into a data variable. This will allow to
modify it using the DS selector, but also to execute it using the CS
selector, since DJGPP runtime is set up so that both CS and DS have
the same base address and the same limit. (Translation: they both
reference the same memory area.)
- Raw text -