× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>I cannot write an HLL program that will modify the memory allocated by
another program 

Sure you can. Just have 2 RPG programs. In program A define a character
field that's 6 bytes long and pass it on a call to program B. In program
B define that parm as 10 bytes and fill it with blanks. Where do you
think the other 4 blanks are going to go? They'll write over whatever is
in memory beyond the 6 bytes that belong to the field in program A. This
_might_ be another field in program A, or it might be unused space.

I tracked this once using debug and trace to watch a variable change. We
saw a variable that was _not_ passed from program A to program B change
after the call to program B -- why? Simple the parms that were passed
were declared as different lengths and the variable that got changed
just happened to be next in memory.

>I guess my question is, what are the system-enforced memory boundaries
for a program?

My understanding is that there aren't any. That is to say, IF you can
get a pointer to a memory location you can modify it. Your normal
everyday RPG program isn't going to be able to modify a memory space
that isn't in it's own job. However, read a couple of chapters of leif's
book and you'll see that with a little work you can modify just about
anything. 

-Walden

------------
Walden H Leverich III
Tech Software
(516) 627-3800 x11
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.