Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pascalated boriel zx basic for the spectrum (*solved*)
#1
Hello, good day.
will the tap program be faster with this new Pascal or is it just an optical design for the eye?

https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/

Thanks.
greeting
Reply
#2
unfortunately pascalated doesn't work with it anymore.
I've now checked this:
zxbasic-v1.18.0-beta6-win32.zip 12263 Kb 2024/Dec/20 00:38:30


as there are always new changes in zxbasic.

I will use zxbasic without pascalated.
there are new faster ASM routines in zxbasic.

thanks.
greeting
Reply
#3
What do you mean it does not work with ZXBasic anymore?

There hasn't been incompatible changes in ZX Basic for a long time. It should still work as always.
---
Boriel
Reply
#4
Yes, the v1.18.0-beta6 have problems.

Some Pascalated BASIC programs may not compile.

I got this error:

  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\ZXBC.py", line 12, in <module>
    sys.exit(zxbc.main())  # Exit
            ^^^^^^^^^^^
  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\src\zxbc\zxbc.py", line 155, in main
    asm_output = backend.emit(optimize=OPTIONS.optimization_level > 0)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\src\arch\z80\backend\main.py", line 770, in emit
    self._output_join(output, self._QUAD_TABLE[quad.instr].func(quad), optimize=optimize)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\src\arch\z80\backend\generic.py", line 366, in _cast
    output.extend(to_float(tA))
                  ^^^^^^^^^^^^
  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\src\arch\z80\backend\common.py", line 458, in to_float
    output = to_long(stype)
            ^^^^^^^^^^^^^^
  File "P:\ZX_UTIL\_UTIL__Spectrum\ZX BASIC 118_3beta6\src\arch\z80\backend\common.py", line 401, in to_long
    raise NotImplementedError(f"type conversion from {stype} to long is undefined")
NotImplementedError: type conversion from i32 to long is undefined



funkheld Wrote:Hello, good day.
will the tap program be faster with this new Pascal or is it just an optical design for the eye?


Pascalated BASIC was created to simplify the appearance of the program.
It's best for beginners.
But in the hands of beginners the code becomes slower...
Reply
#5
This is obviously a compiler bug for the 1.8.x series. I'll have a look into it.
Thanks for reporting it! :-)

EDIT: If you could provide a failing code snippet, please do. I will fix the bug much faster.
---
Boriel
Reply
#6
The following code works fine on version 17. but aborts the compiler on version 18.


Code:
#define PROGRAM REM
#define BEGIN REM
#define VAR DIM
#define INTEGER LONG
#define REAL FLOAT
#define CHAR STRING ' UBYTE is type integer
#define BOOLEAN UBYTE
#define TYPE AS
#define REPEAT DO
#define UNTIL LOOP UNTIL
#define PROCEDURE SUB
#define TRUNC INT
#define SQRT SQR
CONST TRUE TYPE BOOLEAN = 1
CONST FALSE TYPE BOOLEAN = 0


PROGRAM Longest Bridge

' CONSTant declarations
CONST Period TYPE INTEGER = 4

' VARiables
VAR CLICK TYPE INTEGER ' clicks de relogio

'-------------------------------------------------------------------

PROCEDURE PrintClock
VAR steps TYPE REAL
VAR TotalMinutes TYPE REAL
VAR min,sec TYPE UBYTE
VAR aux TYPE REAL
BEGIN
steps = 20
TotalMinutes = CLICK/steps
min = INT TotalMinutes
'sec = INT (60.0/100.0*(TotalMinutes-min))
aux = 60.0/100.0
aux = aux*(1E-4+TotalMinutes-min)
sec = INT (100*aux)
PRINT AT 8,14;PAPER 5;min;":";
IF sec<10 THEN PRINT PAPER 5;"0";
PRINT PAPER 5;sec;
END PROCEDURE

BEGIN PROGRAM '--- main ---
PrintClock
END PROGRAM '--- main ---
Reply
#7
Please try this new beta version, and let me know if it works, thanks :-)

http://www.boriel.com/files/zxb/zxbasic-...ta7.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...-beta7.zip
http://www.boriel.com/files/zxb/zxbasic-...-win32.zip
http://www.boriel.com/files/zxb/zxbasic-...x64.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...cos.tar.gz
---
Boriel
Reply
#8
hello, thanks.

now the program is ok.

thanks.
greetings
Reply
#9
hello, thank you for your loving work with
zxbasic.

what has changed in:
zxbasic-v1.18.0-beta8-win32

please?

thank you.
greetings 
Cool Cool Cool
Reply
#10
The change was this one:
https://github.com/boriel-basic/zxbasic/...e18afeL458

It was a bugfix, as previously stated.
Also, notice you can go to the issues tab and fill-in issues in a form provided there, as an alternative to this forum.
---
Boriel
Reply
#11
hello , thanks for info.

greeting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)