Re: [BLACKBOX] Ofront supporting for unsigned types

From: Oleg N. Cher <"Oleg>
Date: Thu, 26 Apr 2012 17:22:15 +0300

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

Chris Burrows ?????:

> Attempting to target an 8-bit CPU with a higher-level like Oberon is likely
> to lead to disappointment - it wasn't designed with such targets in mind.

I think you're right, because any problem needs an appropriate
instrumental solution. For PIC is good language PICL. For more powerful
microcontrollers probably Oberon-07. For else more powerful CPU a good
choice will be Oberon-2 or Component Pascal. Z80 need a very compact and
low-level language. I've designed this language in far 1997. It was a
language runned directly on ZX Spectrum 48 Kb, called COLOSS and was
very powerful for low-level efficient coding for Z80 CPU.

Oberon-2 with GC has not much approaches for Z80 or 6502. But we use it
"for fun" (or for learn its power). Did you see the screenshots of my
games in Oberon for ZX Spectrum? It may be used for not very dynamic (or
big) games for Z80 with not bad efficiency. Z80 is more powerful than PIC.

Folks, we knows, in any good implementation of Oberon there are set of
bindings to host-platform (in Kernel, in SYSTEM). For example, untagged
pointers, alignments for good work with memory, records with union
fields. All this "bindings" to low-level possibilities are not part of
Oberon or Component Pascal language. But its are very useful in real
development for industry.

I do not want to improve Oberon. Just I need "a binding" to unsigned
types for using it, for more comfortable development for retro-computers.

You probably agree with me, that CP's union records or bindings to DLL
are usable as means of binding of target architecture (Win32 or other).
Ofront's target architecture is C language, and we need "binding" to
unsigned types to use C language possibilities in greater depth.

Btw I propose to use unsigneds in not a direct manner, and via wrapper as:

MODULE Platform;

(* Provided as incapsulated type implementation *)
(* for efficient work on different platforms where *)
(* unsigned, signed or fixed size types are perfect. *)
(* Copyright (C) 2012 Oleg N. Cher, VEDAsoft. *)
(* http://zx.oberon2.ru *)

IMPORT SYSTEM;

TYPE
(* System platform dependent types. Use its in system code. *)
        BYTE* = SYSTEM.SHORTCARD;
        WORD* = SYSTEM.CARDINAL;
        DWORD* = SYSTEM.LONGCARD;
(* System platform independent types. Use as bases in type aliasing. *)
        SHORTCARD* = SYSTEM.SHORTCARD;
        CARDINAL* = SYSTEM.CARDINAL;
        LONGCARD* = SYSTEM.LONGCARD;
(* System platform independent types. Use directly like other types. *)
        ShortCard* = SYSTEM.SHORTCARD;
        Cardinal* = SYSTEM.CARDINAL;
        LongCard* = SYSTEM.LONGCARD;

        Integer* = INTEGER; (* Native platform integer. *)

END Platform.

This way helps to hide type implementation. And in this way we can to
define different type sizes for different platforms.

For 8-bit CPU: SHORTCARD = 1 byte, CARDINAL = 2 bytes (used unsigned
types for efficiency there where it is required).

For 32-bit CPU: SHORTCARD may be = CARDINAL = 4 bytes (no any unsigned
types need - native arithmetic is good).

Thereby, alike algorithms with import of the type Platform.CARDINAL will
equally well be a portable between 8- and 32-bit CPU, in Oberon.

-- 
Oleg N. Cher
http://zx.oberon2.ru/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1251951718_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fQ0Ke1xmNFxmc3dpc3NcZmNoYXJzZXQyMDQgQXJpYWw7fX0NCntcY29sb3J0YmxccmVkMFxn
cmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRh
YjM2MCBcZjBcZnMyMCBcaHRtbHJ0ZntcZjRcZnMyMFxodG1scnRmMCBDaHJpcyBCdXJyb3dzIFwn
ZWZcJ2U4XCdmOFwnZTVcJ2YyOlxodG1scnRmXGYwfVxodG1scnRmMCB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Yml0IENQVTogU0hPUlRDQVJEID0gMSBieXRlLCBDQVJESU5BTCA9IDIgYnl0ZXMgKHVzZWQg
dW5zaWduZWQgXHBhcg0KdHlwZXMgZm9yIGVmZmljaWVuY3kgdGhlcmUgd2hlcmUgaXQgaXMgcmVx
dWlyZWQpLlxwYXINClxwYXINCkZvciAzMi1iaXQgQ1BVOiBTSE9SVENBUkQgbWF5IGJlID0gQ0FS
RElOQUwgPSA0IGJ5dGVzIChubyBhbnkgdW5zaWduZWQgXHBhcg0KdHlwZXMgbmVlZCAtIG5hdGl2
ZSBhcml0aG1ldGljIGlzIGdvb2QpLlxwYXINClxwYXINClRoZXJlYnksIGFsaWtlIGFsZ29yaXRo
bXMgd2l0aCBpbXBvcnQgb2YgdGhlIHR5cGUgUGxhdGZvcm0uQ0FSRElOQUwgd2lsbCBccGFyDQpl
cXVhbGx5IHdlbGwgYmUgYSBwb3J0YWJsZSBiZXR3ZWVuIDgtIGFuZCAzMi1iaXQgQ1BVLCBpbiBP
YmVyb24uXHBhcg0KXHBhcg0KLS0gXHBhcg0KT2xlZyBOLiBDaGVyXHBhcg0KaHR0cDovL3p4Lm9i
ZXJvbjIucnUvXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBzZW5k
IGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RT
Lk9CRVJPTi5DSH19AG90QEI=
----boundary-LibPST-iamunique-1251951718_-_---
Received on Thu Apr 26 2012 - 16:22:15 UTC

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