[Oberon] SYSTEM.PTR vs SYSTEM.ADDRESS
thutt at harp-project.com
thutt at harp-project.com
Mon Oct 31 22:23:43 CET 2022
Joerg writes:
> I can only guess what SYSTEM.PTR and SYSTEM.ADDRESS are; I assume
> these are TYPEs with special compatibility rules. As those are not
> defined in Oberon but by your compiler, please consult your
> compiler’s manual for details.
SYSTEM.PTR is a generic pointer type. It can be assigned any other
pointer type, and is most often (in my experience) used to accept
generic pointers as a procedure parameter. There are uses of
SYSTEM.PTR in Fonts.Mod (to gain access to font data loaded in a
system block of memory), Display.Mod (to allocate system blocks of
memory for display patterns), and in Types.Mod (to gain access to
internal information about a pointer's type at runtime).
I don't know have any information about implementation of
SYSTEM.ADDRESS.
>
> SYSTEM.PUT and SYSTEM.GET are low level procedures used to directly
> manipulate memory or HW registers.
I think SYSTEM.GETREG and SYSTEM.PUTREG are generally for getting and
setting machine registers. PUT and GET are used to directly access
memory (escaping the Oberon language safety).
> Typically used in device
> drivers. SYSTEM.GET(adr, w) is the same as w := adr^ „adr“ being
> an absolute memory address. How your memory layout and your memory
> mapped IO registers look like depends on your HW system you run
> Oberon on.
--
With sadness in my heart and joy in my mind
I thought about the ghosts that we left behind.
-- Not My Slave (Oingo Boingo)
More information about the Oberon
mailing list