[Turbo Pascal] Q&A official thread

Page 4/12
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9

By Manuel

Ascended (15362)

Manuel's picture

18-06-2016, 22:21

Indeed, TP 3.3f is quite a decent compiler. You can make any kind of software with it for MSX, and MemMan is fully optional. Only if you use the GIOS stuff that comes with it, you need it. But it's not necessary at all if you do not use that.

By raymond

Champion (365)

raymond's picture

19-06-2016, 08:10

I use TP 3.3f which works very well. This can make use of multiple directories. I use a seperate directory for the include files en use {$I a:\tp\inc\filename.inc} to include them Smile

By rolandve

Expert (113)

rolandve's picture

19-06-2016, 10:28

Thanks for the answer. I tried it, made Hello World and it worked without MemMan. Seeing that people use subdirectories in include files, means it works Smile

Does TP also have option to make small code?

{uses crt;}
PROGRAM Hello;
begin
Writeln('Hello World');
end.

Is about 12KB (and slow as is well known about TP), C makes it 3.5KB, V-Basic Compiler does it in 1KB.
Anyone ever considered a bounty for a new Pascal compiler for MSX2? I would contribute.

By raymond

Champion (365)

raymond's picture

19-06-2016, 14:30

You can use popcom to make the file smaller.

By AxelStone

Prophet (2644)

AxelStone's picture

19-06-2016, 16:00

raymond wrote:

You can use popcom to make the file smaller.

Wow it seems really interesting, does it works with MSX C too?

By rolandve

Expert (113)

rolandve's picture

20-06-2016, 12:49

So I dipped my toe in the water of Turbo Pascal 3.3f and with OpenMSX at 500% its compiles.
I took some library function from Popolony2k's and decided to test this with turbo pascal. Mixed results.

PROGRAM MSXDOS;
{$I inc\types.pas}
{$I inc\msxdos.pas}
{$I inc\msxdos2.pas}
{$I inc\msxbios.pas}
{$I inc\conio.pas}

var 
   Info : TMSXDosVersion;

BEGIN
      _ClrScr;
      GetMSXDOSVersion(Info);
      With Info do
       begin
              WriteLn(nKernelMajor);
              WriteLn(nKernelMinor);
              WriteLn(nSystemMajor);
              WriteLn(nSystemMinor);
       End;
END.

Compiling works. The program hangs with OpenMSX writing "unsupported IDE command 00" to status window.
Leaving out _ClrScr; results in output. Replacing _ClrScr with ClrScr, works. I can speculate about what happens, but I prefer insights from experienced developers here.

The openMSX system I have is a boosted MSX 2 EN with IDE and a harddisk file.
Insights?

By hit9918

Prophet (2853)

hit9918's picture

20-06-2016, 15:17

when a clearscreen ends up with an unknown IDE command sent... that smells like a wild crash.
in C function names starting with an underscore mean something like "used by the system", "special, not standard", maybe it's similar in Pascal.

By rolandve

Expert (113)

rolandve's picture

20-06-2016, 16:24

I just tried running the same code on a real physical NMS 8250. It also hangs.
It looks like it goes wrong in all functions that use registers, or functions in msxbios.pas, like

{* code from popolony2k's library *}
Procedure _ClrScr;
Const
        ctCLS     = $00C3;  { Clear screen, including graphic modes }
Var
       regs   : TRegs;
       CSRY   : Byte Absolute $F3DC; { Current row-position of the cursor    }
       CSRX   : Byte Absolute $F3DD; { Current column-position of the cursor }
       EXPTB1 : Byte Absolute $FCC1; { Slot 0 }
Begin
     regs.IX := ctCLS;
     regs.IY := Mem[EXPTB1-1]; { EXPTBL-1 }
     CALSLT( regs );
     CSRX := 0;
     CSRY := 0;
End;

It goes wrong on real hardware en OpenMSX. That probably implies I am doing something wrong, but what.

By popolony2k

Hero (525)

popolony2k's picture

21-06-2016, 01:56

Hi friend.

Sound strange this issue because it is running fine in several real MSX computers, I'm using here. Maybe the difference is that I'm using the original Turbo Pascal 3.00 from Borland, but I think that should work in TP3.3f.

I'll try the TP3.3f later.

[]'s
PopolonY2k

By popolony2k

Hero (525)

popolony2k's picture

21-06-2016, 01:58

Is very good to know that TP3.3f recognizes sud-directories.

In the future I'll organize my code in sub-directories.

[]'s
PopolonY2k

Page 4/12
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9