Re: [NTLK] Emulation on newt / Newton Programming is a PAIN!

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Wed Sep 04 2002 - 21:28:44 PDT


On Wed, 4 Sep 2002, J. Eagan Rackley wrote:

> What I don't understand is, why can't we create global variables in some
> way? If you can create them in NS, why isn't there an interface in the
> MPW newton libs that allows you to do the same thing? (maybe I'm wrong?)

You can't create global variables because:
a/ in the current ARM runtime architecture that is used in the Newton,
global variables shall have absolute address
b/ the relocation mechanism doesn't include a R/W space

But global variables are a bad practice. You can use classes. Methods
receive a pointer to the class via register R0 (if you look at the code,
the compiler often puts that value in R4, sometimes R5).

If you need to communicate between various C++ bits without using NS
objects or kernel messages (or apple events that are based on it), or if
you want to save bits in the ram for later use, you can use the Name
Server.
There is a technote on the subject in the Newton Bowels project
(http://www.kallisys.com/newton/bowels/)

> I think anything I tried to emulate would have to be from the 8bit
> console generation. What do you guys think? Any requests?

I think this would be amazing.

Paul

-- 
NPDS: http://newton.kallisys.net:8080/
Apache: http://www.kallisys.com/
-- 
Read the List FAQ/Etiquette: http://www.newtontalk.net/faq.html
Read the Newton FAQ: http://www.chuma.org/newton/faq/
This is the NewtonTalk mailing list - http://www.newtontalk.net/


This archive was generated by hypermail 2.1.5 : Mon May 26 2003 - 12:59:20 PDT