Re: [BLACKBOX] ARRAY as CONSTANT

From: [at]} <Aubrey.McIntosh{>
Date: Wed, 13 Feb 2008 21:50:56 -0600

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

On Feb 13, 2008 9:04 PM, Oleg N. Cher <allot{([at]})nowhere.xy

> BlackBox compiler saves array data one step:
> in machine code, and two step - in memory, when code runned.
> The uneffective use of memory. (It's not good for embedded
> development.)
>

Thanks Oleg,

I have done a lot of assembly programming. There, I can usually
assign a 'group' and the linker will put the same group together in
memory even if it is from different assembly subprograms. So I could
define a group named 'parts' and enter hard coded data
.group part
  db 'screw', 'bin 5', 7
  db 'nut', 'bin 6', 12

The C environment usually restricts this choice of groups to a
standard set of choices, with names such as bss, text. I'm not really
fluent on those choices and their meanings.

I can envision a system where I put data into the ram area and use it
from there. The loader does the work of reading the file and
assigning memory, and I just access it where I expect it to be. The
assembly module might have some descriptive name such as InitDB.asm

When I do embedded programming on a PIC, this fails. The part is a
Harvard architecture. RAM is not defined at power up, and the program
lives in ROM. So, the practice of executing statements from ROM code
works across power cycles with no loader present. This works with the
standard Oberon language with no dross.

Oberon was very aggressive about efficiency, and BlackBox carries this
tradition. In BlackBox, when you execute a command a second time, the
loader is not called. The program is already loaded, why do it twice?
 But, you will still want to have variables correctly initialized.
The choices seem to be to have a routine, typically "Init" that
executes only the data initialization statements. If they do it from
a file, the file has to be online. This is a problem if, say, a
supervisor has taken his memory stick and gone for coffee. If they do
it in the program, it is just there.

So, yes, it is fairly tedious to type all these statements. I
strongly suspect that most of us have little macros that take rows of
values and produce the call to InitHelper. But I am convinced that
the system is well designed.

What I don't know, however, is how Delpi deals with this issue. Do
they do the load trick of loading RAM space once?
The example using a CONST string happens to be one where the Oberon (&
BB?) compilers do put values into permanent place and internally pass
the address around, so duplicate copying is not done.

I suppose at the language design level this is a request for CONST
structures. e.g., CONST a =(record type) 'this', 'that', 42 END;
Hmm. Chris?




-- 
-- 
Aubrey McIntosh, Ph.D.
1502 Devon Circle
Austin TX 78723-1814
http://home.grandecom.net/~amcintosh/aubrey/Search/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1221914355_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIE9uIEZlYiAxMywgMjAwOCA5OjA0IFBNLCBPbGVn
IE4uIENoZXIgPGFsbG90QHVrci5uZXQ+IHdyb3RlOlxwYXINClxwYXINCj4gQmxhY2tCb3ggY29t
cGlsZXIgc2F2ZXMgYXJyYXkgZGF0YSBvbmUgc3RlcDpccGFyDQo+IGluIG1hY2hpbmUgY29kZSwg
YW5kIHR3byBzdGVwIC0gaW4gbWVtb3J5LCB3aGVuIGNvZGUgcnVubmVkLlxwYXINCj4gVGhlIHVu
ZWZmZWN0aXZlIHVzZSBvZiBtZW1vcnkuIChJdCdzIG5vdCBnb29kIGZvciBlbWJlZGRlZFxwYXIN
Cj4gZGV2ZWxvcG1lbnQuKVxwYXINCj5ccGFyDQpccGFyDQpUaGFua3MgT2xlZyxccGFyDQpccGFy
DQpJIGhhdmUgZG9uZSBhIGxvdCBvZiBhc3NlbWJseSBwcm9ncmFtbWluZy4gIFRoZXJlLCBJIGNh
biB1c3VhbGx5XHBhcg0KYXNzaWduIGEgJ2dyb3VwJyBh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g0KXHBhcg0KSSBzdXBw
b3NlIGF0IHRoZSBsYW5ndWFnZSBkZXNpZ24gbGV2ZWwgdGhpcyBpcyBhIHJlcXVlc3QgZm9yIENP
TlNUXHBhcg0Kc3RydWN0dXJlcy4gIGUuZy4sIENPTlNUIGEgPShyZWNvcmQgdHlwZSkgJ3RoaXMn
LCAndGhhdCcsIDQyIEVORDtccGFyDQpIbW0uICBDaHJpcz9ccGFyDQpccGFyDQpccGFyDQpccGFy
DQpccGFyDQotLSBccGFyDQotLSBccGFyDQpBdWJyZXkgTWNJbnRvc2gsIFBoLkQuXHBhcg0KMTUw
MiBEZXZvbiBDaXJjbGVccGFyDQpBdXN0aW4gVFggNzg3MjMtMTgxNFxwYXINCmh0dHA6Ly9ob21l
LmdyYW5kZWNvbS5uZXQvfmFtY2ludG9zaC9hdWJyZXkvU2VhcmNoL1xwYXINClxwYXINClxwYXIN
Ci0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdO
T0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9fQAgZm9y
----boundary-LibPST-iamunique-1221914355_-_---
Received on Thu Feb 14 2008 - 04:50:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:02 UTC