OS/2, eCS & ArcaOS - Technical > Programming

QBASIC POKE IN REXX is possible?

<< < (2/2)

Mentore:

--- Quote from: roberto on November 05, 2021, 08:22:23 pm ---I wanted to know if there is an instruction similar to QBASIC Poke in Rexx

POKE &H00006281, 238 in rexx =   ...

Saludos

--- End quote ---

Hi Roberto,
as others answered, a direct POKE in a memory protected system is forbidden. It would most probably ruin everything and break the system.
Question arises then: why do you need to use POKE? I'm guessing you're trying to port some old QBASIC software...

Mentore

Lars:
Judging from what Roberto tried in the past, it looks like he wants to overwrite code of DLLs that are loaded into memory (for example by overwriting instructions that load the flat selector value into a register).

That by itself is already a problem because DLLs are NOT guaranteed to load at a specific memory address, at least not in general (if he wants to poke at linear addresses).

Then, there is the issue that any code already cached in the instruction cache will know nothing about the changes in code that have been done in memory (I seem to remember and I also seem to remember that this is DIFFERENT from data access as that will lead to cache update of the data cache on modifying memory). That is why it has become so difficult if not impossible to write self-modifying code: you would need to invalidate the cache lines in the instruction cache that hold that modified code and therefore force a reload of the instruction cache when again accessing that code (and potentially enforce cache coherency amongst multiple cores if that does not happen automatically !). This is nothing for the faint hearted.

Lars:
As to self and cross modifying code:
the proper explanation is given in the "Intel Software Developer's Manual", volume 3 in chapter "Handling Self- and Cross-Modifying Code".

Therefore, the caching issues do not apply, but the multi-core issues do.

roberto:
I answer a bit because. I only have a computer where I can try those memory modifications, each time they are more intangible things. To the point that I can not do anything in summer for the increased temperature, which affects and a lot. So I wanted to be able to do the tests on other computers where the QBASIC not works for this, for being more modern or simply different. Anyway, I have to admit that programmers have done a great job. And it is very difficult for me to improve what is currently in the last version.

Dave - The link386 give me the same error as link I am try to link the Hello word! in language E

Saludos

Navigation

[0] Message Index

[*] Previous page

Go to full version