Spectrum Basic IDE with Machine Code

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
Turtle_Quality
Manic Miner
Posts: 511
Joined: Fri Dec 07, 2018 10:19 pm

Spectrum Basic IDE with Machine Code

Post by Turtle_Quality »

Saw this posted on Facebook later, haven't check it out yet but it sounds interesting

ASSEMBLY FOR BEGINNERS
As all ZX Spectrum lovers know, assembly language allows for near-total control of the computer, but it is also difficult to master. Nonetheless, it can be rewarding to try your hand at coding, and you can have some satisfactions.
From this point of view ugBASIC can help you. In fact, from version 1.14.1 it is possible to insert assembly code directly into your BASIC programs. Easily accessing variables and functions. In short, it provides a starting point.
For example, below is a short program that adds two 16-bit numbers and prints the result. The code that performs the calculation is written in assembly while BASIC is used to prepare the operands and print the result.
Uncomfortable with assembly? You can always go back to BASIC: ugBASIC generates native assembly code for your processor!
Happy (re)programming!
You can find the source by clicking here: https://github.com/.../examples/contrib ... logz80.bas
The IDE for Windows can be found here: https://spotlessmind1975.itch.io/ugbasic-ide
Official site:
https://ugbasic.iwashere.eu/
Definition of loop : see loop
User avatar
g0blinish
Manic Miner
Posts: 290
Joined: Sun Jun 17, 2018 2:54 pm

Re: Spectrum Basic IDE with Machine Code

Post by g0blinish »

good distribution: IDE is 32bit, compilers - 64.
EdToo
Manic Miner
Posts: 228
Joined: Thu Nov 03, 2022 4:23 pm

Re: Spectrum Basic IDE with Machine Code

Post by EdToo »

I've been playing with this for a little while and it's pretty good. However support for some areas are still to be developed and not all platforms support all features.

The developer is extremely active and regularly posts updates to Facebook.
spotlessmind1975
Drutt
Posts: 21
Joined: Fri Aug 25, 2023 7:24 am

Re: Spectrum Basic IDE with Machine Code

Post by spotlessmind1975 »

Hello everybody! :)

First of all thank you for reporting the information regarding the possibility of using ugBASIC to program in assembly. I'm really flattered that it interested this community and, also, I'm very interested in any comments on improving support for the ZX.

Regarding this observation:
g0blinish wrote: Sun Jul 23, 2023 5:53 amgood distribution: IDE is 32bit, compilers - 64.
I point out that, in recent days, the installation page has been completely revised, as well as the UBASIC-IDE, and now there is a more symmetrical management of the 64-bit and 32-bit versions.

In particular, this page contains, already precompiled, all executables for all targets and for all operating systems (Linux and Windows), both 64-bit and 32-bit, for the official version, for updates and for the beta. At the same time, the IDE is able to download the correct version of the executables, i.e. the 32-bit or 64-bit version, both for the stable version and for the beta version.

I hope it will come in handy!

Thank you again, and have a nice day. :D
User avatar
g0blinish
Manic Miner
Posts: 290
Joined: Sun Jun 17, 2018 2:54 pm

Re: Spectrum Basic IDE with Machine Code

Post by g0blinish »

No access or file
d:\ugbc.c64.exe
already in use.

"The version of 'ugbc.c64.exe' is not compatible with the version of Windows running on this computer. Check your system information to see which x86 (32-bit) or x64 (64-bit) version of the program you need and get it from the software vendor."
Kill the web designer, it's impossible to download anything
spotlessmind1975
Drutt
Posts: 21
Joined: Fri Aug 25, 2023 7:24 am

Re: Spectrum Basic IDE with Machine Code

Post by spotlessmind1975 »

Hi g0blinish, and thank you for your feedback!
g0blinish wrote: Sat Aug 26, 2023 3:38 am No access or file
d:\ugbc.c64.exe
already in use.
If you need to use the Windows 32-bit version, I suggest you download and run the 32-bit version of UGBASIC-IDE, which downloads all the executables and avoids running into problems related to the complexity of the installation under Windows.
User avatar
g0blinish
Manic Miner
Posts: 290
Joined: Sun Jun 17, 2018 2:54 pm

Re: Spectrum Basic IDE with Machine Code

Post by g0blinish »

spotlessmind1975 wrote: Sat Aug 26, 2023 7:20 am Hi g0blinish, and thank you for your feedback!



If you need to use the Windows 32-bit version, I suggest you download and run the 32-bit version of UGBASIC-IDE, which downloads all the executables and avoids running into problems related to the complexity of the installation under Windows.
Already downloaded.

try to change Target OS to Windows XP. maybe it helps
spotlessmind1975
Drutt
Posts: 21
Joined: Fri Aug 25, 2023 7:24 am

Re: Spectrum Basic IDE with Machine Code

Post by spotlessmind1975 »

Hi g0blinish, thank you for the feedback.
g0blinish wrote: Sat Aug 26, 2023 11:15 am try to change Target OS to Windows XP. maybe it helps
I tried:
Image
and it works:
Image
Have you already tried to download the specific compiler for ZX Spectrum?
Image
(it should overwrite the previous version)
User avatar
g0blinish
Manic Miner
Posts: 290
Joined: Sun Jun 17, 2018 2:54 pm

Re: Spectrum Basic IDE with Machine Code

Post by g0blinish »

I tried:
Image
and it works:
[/quote]

nope:

FILE HEADER :

Machine: 8664h (AMD64 (K8))
Number of Sections: 0014h
Time Date Stamp: 64B2B8EAh -> 15/07/2023 18:19:06
Symbols Pointer: 00270C00h
Number Of Symbols: 00002935h
Size Of Optional Header: 00F0h
Flags: 0026h

OPTIONAL HEADER :
Magic 020Bh ( PE32+ : 64-bit ready )
Linker version 2.39

same happens with TIC-80(virtual console emulator). After compiler changed emulator runs fine
spotlessmind1975
Drutt
Posts: 21
Joined: Fri Aug 25, 2023 7:24 am

Re: Spectrum Basic IDE with Machine Code

Post by spotlessmind1975 »

g0blinish wrote: Sun Aug 27, 2023 6:17 am After compiler changed emulator runs fine
First of all thank you for the feedback, but I didn't quite understand: does it work now or not? Is there "(32 bit)" next to "UGBASIC-IDE v1.41.1" at the top left caption window title? Did you download all compilers again? Can you verify that the modification date of the ugbc.coco.exe compiler is from now that you downloaded? If so, can you try downloading the very same file from the website, directly, instead of using the IDE? Can you try to see what format this file has?

I did all these operations and, with hex editor, I made sure that the format was the traditional one for 32 bits (signature at specific position in the header). So much so that Windows offers me compatibility up to Windows '95.

Please let me know so I can find the error.

Thank you! :D
User avatar
g0blinish
Manic Miner
Posts: 290
Joined: Sun Jun 17, 2018 2:54 pm

Re: Spectrum Basic IDE with Machine Code

Post by g0blinish »

I downloaded compilers from IDE. Running programs gives an error message. Maybe it's better for you to compile programs on a 32bit OS?
spotlessmind1975
Drutt
Posts: 21
Joined: Fri Aug 25, 2023 7:24 am

Re: Spectrum Basic IDE with Machine Code

Post by spotlessmind1975 »

Hi g0blinish , and thank you for your feedback.
g0blinish wrote: Sun Aug 27, 2023 2:27 pm I downloaded compilers from IDE.
Running programs gives an error message.
Ok, what kind of error?
It may not be related to the 32 bit issue.
g0blinish wrote: Sun Aug 27, 2023 2:27 pm Maybe it's better for you to compile programs on a 32bit OS?
If we talk about the IDE, I have no way because Microsoft no longer expressly supports 32-bit. If we talk about compilers, unfortunately, I don't think it makes much difference because the starting sources are written in C for Linux, therefore taken everywhere with the necessary (cross) compilers for those environments. In particular, I now use MingW64 with the 32-bit variant.

As I explained in the previous message, I downloaded the TRS-80 Color Computer compiler and parsed it with the hexadecimal editor, with the executable header format specification in hand. That executable is, without a doubt, for 32 bits.

So there are two possible things:
1) the executable is for 32 bit but makes use of DLL libraries that are not attached; possible, but I would need the exact error at this point (try calling the executable from the command line, with no options);
2) everything is ok but there are general problems in running executables, due (for example) to antivirus or something like that.

So, if you could be so kind as to send me more information, let's try to solve your problem.
Post Reply