Groups | Search | Server Info | Login | Register


Groups > comp.lang.modula2 > #1301

Re: Topspeed Modules in XDS Compiler - bugs?

From Martin Brown <'''newspam'''@nonad.co.uk>
Newsgroups comp.lang.modula2
Subject Re: Topspeed Modules in XDS Compiler - bugs?
Date 2021-10-23 09:05 +0100
Organization Aioe.org NNTP Server
Message-ID <sl0fnh$gbd$1@gioia.aioe.org> (permalink)
References <10372c14-f6c7-43da-8119-d89bdd2b1844n@googlegroups.com>

Show all headers | View raw


On 22/10/2021 15:11, jd63 wrote:
> This concerns the Linux version only (native compiler). Version 2.60 from github. The code uses the RANDOMIZE and RANDOM functions from the Lib module, and WrLn from IO. Compiled with "xc -topspeed+ =m randtest.mod".
> 
> MODULE randtest;
> IMPORT IO,Lib;
> VAR roll,i: CARDINAL;
> BEGIN
>    Lib.RANDOMIZE;
>    FOR i:=1 TO 6 DO
>      roll:=Lib.RANDOM(6)+1;
>      IO.WrCard(roll,1);
>      IO.WrLn;
>    END;
> END randtest.
> 
> Firstly, RANDOMIZE doesn't work because on each run the numbers are the same, and secondly, carriage return isn't working in WrLn because on successive new lines the numbers are cumulatively offset by 1 space.
> 
> The Win32 version of the compiler (using Wine) produces the expected correct output (no offsets and different numbers each time).

I have never seen that problem with the Windows version. I'd hazard a 
guess that it gets a fixed answer for system time under Linux for some 
reason. Can you set an explicit starting seed successfully?

You may have to inspect the generated code in a debugger to find out 
what is going on here. I suspect IO.WrLn is still DOSian <cr><lf>.

> I haven't raised this issue yet on github because I first wanted to see if there are any other XDS users getting the same behaviour.
> 
> Thanks!

I don't think there are many people still using it now.
(I could be wrong)

-- 
Regards,
Martin Brown

Back to comp.lang.modula2 | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Topspeed Modules in XDS Compiler - bugs? jd63 <jules1.davy@gmail.com> - 2021-10-22 07:11 -0700
  Re: Topspeed Modules in XDS Compiler - bugs? Martin Brown <'''newspam'''@nonad.co.uk> - 2021-10-23 09:05 +0100
    Re: Topspeed Modules in XDS Compiler - bugs? jd63 <jules1.davy@gmail.com> - 2021-10-23 06:50 -0700
    Re: Topspeed Modules in XDS Compiler - bugs? nemo <invalid@invalid.invalid> - 2021-10-23 10:06 -0400
  Re: Topspeed Modules in XDS Compiler - bugs? Brian Knoblauch <briank@glmotorsports.net> - 2021-10-24 05:42 -0700

csiph-web