[BLACKBOX] Trap while compiling SYSTEM.GET

From: Oleg N. Cher <"Oleg>
Date: Wed, 9 May 2012 21:27:02 +0300

----boundary-LibPST-iamunique-39987000_-_-
Content-type: text/plain

Dear Marc,

thank you for quick and circumstantial answer.

I'm experimenting with removing the restrictions on code procedure size
and has found a trap, which falls out when compiling of such code. I
think, this will you interesting, but can even useful.



MODULE DevTestCodeSizeProc;
IMPORT SYSTEM, StdLog;

CONST
        Rsrc1_size = 1;

PROCEDURE [code] Rsrc1 0C3H;

PROCEDURE Do* ;
VAR i, x: INTEGER;
BEGIN
        FOR i := 0 TO Rsrc1_size - 1 DO SYSTEM.GET(SYSTEM.ADR(Rsrc1) + i, x);
StdLog.Int(x) END
END Do;

END DevTestCodeSizeProc.



Is there a good way to work with address of code procedure?


What is practical reason of using of code procedures with zero size?
For example, such procedure is used in modules

(System)Kernel - PROCEDURE [code] ALLOC

(System)Math - PROCEDURE [code] FLD (x: REAL);
        PROCEDURE [code] TOP (): REAL;

etc.


Thanks.



Marc Frei wrote:

> Dear Oleg,
>
> Here the response to your question from last week from my colleaugue Beat Heeb who is maintaining the BlackBox compiler:
>
> It is a restriction of the compiler.
>
> The code of a code procedure is stored in object.conval.ext. This is byte array of arbitrary size but the number of bytes used is stored in the first byte (ext^[0]) and thus restricted to 0..255.
>
> To change that you would have to change how this length is stored. Search for "CProc" in all compiler sources.
>
> Kind regards,
> Marc

--
Oleg N. Cher
http://zx.oberon2.ru/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-39987000_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V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BhcnJheSBvZiBhcmJpdHJhcnkgc2l6ZSBidXQgdGhl
IG51bWJlciBvZiBieXRlcyB1c2VkIGlzIHN0b3JlZCBpbiB0aGUgZmlyc3QgYnl0ZSAoZXh0Xlsw
XSkgYW5kIHRodXMgcmVzdHJpY3RlZCB0byAwLi4yNTUuXHBhcg0KPiBccGFyDQo+IFRvIGNoYW5n
ZSB0aGF0IHlvdSB3b3VsZCBoYXZlIHRvIGNoYW5nZSBob3cgdGhpcyBsZW5ndGggaXMgc3RvcmVk
LiBTZWFyY2ggZm9yICJDUHJvYyIgaW4gYWxsIGNvbXBpbGVyIHNvdXJjZXMuXHBhcg0KPiBccGFy
DQo+IEtpbmQgcmVnYXJkcyxccGFyDQo+IE1hcmNccGFyDQpccGFyDQotLVxwYXINCk9sZWcgTi4g
Q2hlclxwYXINCmh0dHA6Ly96eC5vYmVyb24yLnJ1L1xwYXINClxwYXINClxwYXINCi0tLS1ccGFy
DQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNL
Qk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9fQBUTzWK
----boundary-LibPST-iamunique-39987000_-_---
Received on Wed May 09 2012 - 20:27:02 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:03 UTC