[Oberon] Fw: FPGA - Bitmaps.Mod
joerg.straube at iaeth.ch
Fri Apr 7 14:10:31 CEST 2017
The first parameter is declared VAR, so the address of "b.base" is handed over.
The second parameter shall be a pointer to a type tag.
The size of a type is stored at offset 0 of the type tag.
Kernel.New expects the parameter "tag" to be a pointer to type tag. SYSTEM.ADR(b.size) is interpreted as a pointer to a type tag.
The code I was providing is not something a beginner in Oberon should use! 1) It's dirty pointer hacking, something that normally C is famous for :-) 2) it's very low level, as it bases on internals of the implementation of the Oberon memory management.
But there are typos in my code
- Firstly, you have to IMPORT SYSTEM as well.
- Secondly, we have to compare "b.base" to 0 iso NIL, as "b.base" is not a pointer.
From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Tomas Kral
Sent: Freitag, 7. April 2017 12:55
To: oberon at lists.inf.ethz.ch
Subject: Re: [Oberon] Fw: FPGA - Bitmaps.Mod
Should it not be coded rather like this?
On Fri, 7 Apr 2017 11:43:45 +0200
Jörg <joerg.straube at iaeth.ch> wrote:
> Kernel.New(b.base, SYSTEM.ADR(b.size));
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon