using Boriel's ZX-Basic Compiler for creating zx81 stuff

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by nitrofurano »

Since some months ago i were using Boriel's ZX-Basic compiler for creating stuff for other z80-based machines beyond zx-spectrum

(these machines were Sega's 8bit consoles (sg1000, master-system, gamegear), msx (from 1 to 2+), mc1000 (a rare brazilian charlemagne/gem1000 clone, similar to nec-6001 in some aspects), mattel-aquarius, etc. (including some unsuccessful attempts to colecovision, vg5000, pacman (arcade machine), etc.), and recently i was trying zx-atm/evolution and sam-coupé - part of what i were trying can be found at http://nitrofurano.altervista.org/retrocoding )

So, i wanted to create stuff for zx81 as well - i guess that, for now, snippets compiled via Pasmo would help for attempting something there? and are there some "tricks" needed to create .p files?
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by PokeMon »

You may use the ZX-IDE, which allows you to mixx assembler and ZX Basic.
It creates .p and .o files automatically and supports the graphic characters. ;)

viewtopic.php?f=6&t=1064
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

Re: using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by nitrofurano »

PokeMon wrote:You may use the ZX-IDE, which allows you to mixx assembler and ZX Basic.
It creates .p and .o files automatically and supports the graphic characters. ;)

viewtopic.php?f=6&t=1064
btw, i don't know if you tried to run it on Wine (on GNU/Linux, like Ubuntu or Debian) - the text editor there really looks and behaves weirdly... :S (characters being cropped, hidden when selected, etc.) (btw, Wine is the only way i have for running .exe files)
is there any native version of ZX-IDE for GNU/Linux?
thanks anyway! :)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by PokeMon »

No, I didn't try one WINE.
You could load the source here:
http://board.flatassembler.net/topic.php?t=15062
and compile the LINUX version in directory SOURCE/LINUX as executable or a .so library in SOURCE/LIBC.
This way you need the flatassembler itself.

I did do that job for you, see attached file which contains a source.tar which contains the executable and the library (and source as well).
This way you won't benefit from the IDE extensions like the graphic character support, automatic start of emulator or the tape interface (loader/fastloader) and you won't have an IDE with multi window editor. But the rest would be compatible and you can compile the source.

I personally hate the toolchains and prefer to use an application for all. But up to you, if you work on LINUX you would be trained in toolchains and shell operations.
:mrgreen:
Attachments
SOURCE.zip
(79.58 KiB) Downloaded 160 times
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

Re: using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by nitrofurano »

PokeMon wrote:No, I didn't try one WINE.
You could load the source here:
http://board.flatassembler.net/topic.php?t=15062
and compile the LINUX version in directory SOURCE/LINUX as executable or a .so library in SOURCE/LIBC.
This way you need the flatassembler itself.

I did do that job for you, see attached file which contains a source.tar which contains the executable and the library (and source as well).
This way you won't benefit from the IDE extensions like the graphic character support, automatic start of emulator or the tape interface (loader/fastloader) and you won't have an IDE with multi window editor. But the rest would be compatible and you can compile the source.

I personally hate the toolchains and prefer to use an application for all. But up to you, if you work on LINUX you would be trained in toolchains and shell operations.
:mrgreen:
thanks!
i'm really more about using terminal, bash scripts, text editors and etc. than using ide, and this one seems perfect, thanks!
but i'm actually missing 2 things:
- where from can we find examples, or more examples, to try?
- how must we use the arguments in the command line? (just the asm file is acceptable as argument, and the compiled file appears resulting automatically?)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: using Boriel's ZX-Basic Compiler for creating zx81 stuff

Post by PokeMon »

Well - there are a few examples with the software, ZX80DEMO.ASM and ZX81DEMO.ASM and there are several examples about programming in the tutorial I posted the link to.

In fact you just give the assembler file as parameter (probably test.asm) and it will automatically create a test.p if you give "format ZX81" in the first source line or test.o for "format ZX80". If you want to program plain Z80 code you can also use format binary which will create a test.bin or you can choose the extension by using >> format binary as 'out' <<. You could also use format ZX81 as ... if you want another extension for the output file which is simply poor binary (flat) format. Thats the source of the assembler called flatassembler, which the project is based on. You should use ZX80 or ZX81 as this is controlling format of BASIC data and codetables used to create output.

You can find more information about flatassembler here:
http://flatassembler.net/

This is mainly developed for x86 programming in assembler but was ported to some other targets. I ported it to Z80, there is also an ARM version of flatassembler you maybe interested for other projects.
Post Reply