The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimizer bug (*solved*)
#1
I found an error in ZX BASIC optimizer. Take a look at this test program:

Code:
GO TO 10 sub FASTCALL test(flag AS UBYTE) asm cp 1 jp m,45000 jp 50000 end asm end sub 10 POKE 50000,201: POKE 45000,201 test(1)

This program produces the expected result if you compile it as follows:

Code:
zxb.exe -t -O2 prog.bas

However it will refuse to compile if you use this instead:

Code:
zxb.exe -t -O3 prog.bas

In this latter case it will produce this error message:

Code:
C:>zxb.exe -t -O3 prog.bas Traceback (most recent call last): File "zxb.py", line 348, in <module> File "zxb.py", line 301, in main File "optimizer.pyc", line 2287, in optimize File "optimizer.pyc", line 1493, in update_goes_and_comes KeyError: '45000'

EDIT: Tested using latest ZX BASIC version 1.4.0s1898.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)