Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

OMF records - processing SYS.OBJ with tdstrip (Developers)

posted by Rugxulo(R) Homepage, Usono, 18.02.2012, 17:12
(edited by Rugxulo on 18.02.2012, 17:28)

> > too complex for a good test, e.g. a hello world would have been better.
> params.mod (mod is the file extension used for src) which comes with the
> compiler is a good basic example. However to aid with testing I created an
> even shorter one:
> MODULE rjtest;   (* RJTEST 2012 *)
> END rjtest.

I think that's too simple for testing (see above). It doesn't have multiple modules and doesn't actually do anything. ("SYS" is, apparently, an obsolete naming convention for "SYSTEM", which itself is only used for non-portable code, low-level stuff, etc.)

> Using a tstrip processed SYS.OBJ. I copied OC.EXE and SYS.OBJ into a test
> directory and tried to compile rjtest.mod (as above) with oc, tlink etc:
> map file:
> Error: Invalid initial stack offset

I wish I knew why it was saying that or what to patch (and where).

> tdump of RJTEST.OBJ:
> Turbo Dump  Version Copyright (c) 1988, 1996 Borland
> International

I'm guessing by 1996 they either complied closer with TIS 1.1 or went their own way. Either way, probably not good for (old 1991) Oberon/M. :-/

> So processing SYS.OBJ with tdstrip didn't help much as the issue of an
> invalid entry point still exists and the blank byte record still gets
> inserted as well as the REGINT (70h) record.
> As when I get a chance I will do some more testing/investigation. Re the
> REGINT (70h) record I'm thinking that patching OC.EXE is needed to
> resolve.

Well, probably, but I figured an external tool was easier for now. Besides, it's only the single "main" .OBJ of a project that needs it, not the others.

> [edit: if IMPORT SYS:=SYSTEM; is missing it seems OC defaults to it]

It's apparently trying to be compatible with an earlier release of itself as well as a very-early Oberon System convention. All the "modern" (heh) Oberon compilers I've seen only define SYSTEM, which (like Modula-2) is a built-in module inside the compiler, although you still have to manually import it (and it's a "no no", only uses for non-portable and low-level code).

(OT): One of BWK's complaints about Pascal was that there was no escape, no casts, no type conversions like C had. Modula-2 added a bunch, but that's not typesafe, and they were only supposed to be used in limited cases, not all the time. So they were overused by programmers, hence Wirth removed most of them from Oberon. If you want VAL(), you now have to import SYSTEM. (See OBERNM12.ZIP's OBREPT.ASC for more details.)

MODULE blah;
VAR s: SET; (* same as M2 BITSET *)
  INCL(s,8); (* 2**8 = 256 *)
END blah.

EDIT: There may be some confusion regarding SYS.OBJ and the internal "module" SYS / SYSTEM. I don't think there is any connection. At least, you must always link with SYS.OBJ, but you don't have to "IMPORT SYSTEM" at all.


Complete thread:

Back to the forum
Board view  Mix view
15317 Postings in 1383 Threads, 254 registered users, 24 users online (0 registered, 24 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum