Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.tap file code not executed
#1
Hello, I'm a newbie tinkering with the Spectrum.
I tried to get some code to test like the classic 'clock.bas' or 'circle. bas' and then converting a .bas file to .tap.
In some cases, I obtain some errors like:

manuelzompetta@Manuels-MacBook-Pro zxbasic % python zxbc.py clock.bas 
clock.bas:21: warning: [W100] Using default implicit type 'float' for 'a'
clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sx'
clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sy'
clock.bas:25: warning: [W100] Using default implicit type 'ulong' for 't2'
Traceback (most recent call last):
  File "/Users/manuelzompetta/Downloads/zxbasic/zxbc.py", line 12, in <module>
    sys.exit(zxbc.main())  # Exit
             ^^^^^^^^^^^
  File "/Users/manuelzompetta/Downloads/zxbasic/src/zxbc/zxbc.py", line 155, in main
    asm_output = backend.emit(optimize=OPTIONS.optimization_level > 0)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/main.py", line 770, in emit
    self._output_join(output, self._QUAD_TABLE[quad.instr].func(quad), optimize=optimize)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/generic.py", line 362, in _cast
    output.extend(to_long(tA))
                  ^^^^^^^^^^^
  File "/Users/manuelzompetta/Downloads/zxbasic/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 u32 to long is undefined


In other cases I obtain .tap file but when I execute it in the Spectrum or in an emulator nothing happens, I just obtain the welcome screen.

What I'm doing wrong?

Thanks
Reply
#2
It was hard to read from the attached image, it is too small (or is it my Firefox fault?).

When reporting problems, please always state explicitly:
- the compiler version you used
- which options were passed to the compiler (show the full command used when compiling)
- your operating system
Please don't get me wrong, this information helps people who are willing to help you, so you are more likely to get a useful response when you provide this info.

Anyway, I don't think that you are doing anything wrong, I tried now with "clock.bas" and the compilation failed with same output that you show.

I tried on Windows 10, ZX Basic version 1.18.0 (latest stable at the moment), using these options:

Quote:zxbc.exe --optimize 2 --output ..\clock\clock.tap --output-format=tap --BASIC --autorun examples\clock.bas

So, this example seems to have bugs.

I haven't experienced the other outcome you describe (compilation passed, but then the tap file isn't correct).

Swan, my ZX Spectrum emulator https://github.com/zoran-vucenovic/swan
Reply
#3
I have fixed the font-size of your error message. :-)
This looks like a bug in the compiler. What compiler version are you using? (run python zxbc.py --version to see it)

EDIT: I have tested 1.18.0 and it's a new bug introduced in this version. Fixing it...
---
Boriel
Reply
#4
Please download the latest version 1.18.1 (just published), that fixes this bug:  Rolleyes
http://www.boriel.com/files/zxb/zxbasic-1.18.1.tar.gz
http://www.boriel.com/files/zxb/zxbasic-1.18.1.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
#5
The clock example works well with 1.18.1 (on Windows 10).

Swan, my ZX Spectrum emulator https://github.com/zoran-vucenovic/swan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)