Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

FPC 2.6.4 released! (Announce)

posted by Rugxulo(R) Homepage, Usono, 05.04.2014, 23:55

> > there is a bug (or unimplemented feature?) that makes every program
> > say "Nil pointer assignment" on exit (even something as banal as
> > "Hello, world!").
>
> That sounds like you got either the units or the startup code for different
> memory models mixed up.

AFAIK, the ppcross8086.exe is the same for both Tiny, Small. The only difference is the compiled units, etc. Yes, I just confirmed it, latest snapshot .EXE is same size, same CRC32 in both .ZIPs.

> If the correct startup code for tiny (prt0t.o) is
> linked, you should never get a "Nil pointer assignment" error, because nil
> pointer checking can only work in the small and medium memory models (which
> have a separate data segment, so that we can initialize the first few bytes
> at DS:0000 with a preset pattern and then check it at the end of program
> execution), so it is simply ifdef'd out in the startup code for tiny.

I'm atop Win64 right now and just tested a simple hello world with latest Tiny snapshot.

ppcross8086 -XX hello -oa.exe
ppcross8086 -XX -WmTiny hello -ob.exe

Here's what DOSBox says:

C:\TMP\BLA>a
Hello, world!
Nil pointer assignment

C:\TMP\BLA>b
Hello, world!

FYI, both .EXEs contain the string "Nil pointer assignment", so it's not totally ifdef'd out. But beyond that, I don't know. Maybe it's a mistake to assume the Tiny build always builds tiny. But I just blindly assumed it wasn't necessary to tell it. Though of course the compiler .EXE probably doesn't know any better if it's the same for each. Maybe there is no default memory model. Dunno if that's a bug or (more likely) user error.

In short, we should probably always explicitly specify a memory model when compiling. Maybe it should error out if none is specified by default.

 

Complete thread:

Back to the forum
Board view  Mix view
15108 Postings in 1358 Threads, 246 registered users, 13 users online (1 registered, 12 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum