So here is a new version with some new and nice features. In the german forum I started a tutorial in a separate thread about the IDE and flatassembler. I will make the same here and translate from german. For getting more family with it.
The most important feature in this version 1.71.01b.Z80 is the deeply integration of BASIC commands in the parser. Sounds not spectacular but is important and caused much work. There is a difference in defining BASIC structures with DEFB commands and calculate offsets and code integers by hand or if you let do the assembler all necessary work. It was a bit tricky to support Assembler and BASIC commands as you naturally would type it down and to support all syntax rules to act mostly intuitiv.
That was not the only road work. The more easy part was integration of the emulator EightyOne which can be started with the assembled source by simply pressing F8 from assembler IDE.
- FASM_Screen1.jpg (63.72 KiB) Viewed 6867 times
The name of the IDE changed from FASMWZ80 to FASMW-ZX as it not only supports Z80 assembler instructions but add the BASIC instructions too. Okay for the moment only REM and RAND USR as first part but more commands will be added soon quite fast as all internal structures available now (preprocessor to parser and parser to assembler). Shortly it will also support ZX80 programs (BASIC) as well and as I am new owner of a ZX Spectrum I plan to support Speccy too. After ZX80 I think. So the name FASMW-ZX is more suitable to what the IDE can be used for (different targets or all ZX computers from Sinclair).
The audio interface (transfer of WAV files) was modified too. A very important hint at this point: Who ever use a security / firewall package with sandbox (I use Comodo) has to switch off the sandbox at least for the FASMW-ZX.EXE or better the corresponding directory. It took me hours to find the reason for not updating the WAV files from the IDE after several changes in source.
The main reason for modifying the audio interface was because it was a hidden transfer in the past which could not be stopped easily and there was no display when the transfer finishes or how long it will take (no progress bar). Due to switched off audio from putting the cable into ear plug you could not hear the end. Now you can use the system media player assigned to WAV files which will be started automatically when switching on in RUN menu. You should use Windows Media Player only by now as I found some mysterious problems with VLC player. Sounds same and has same loudness but transfer was not successful. I switched off all features for audio processing but anyway no luck. This has to be investigated in future. So I left the old hidden transfer using PlaySound in WINMM.DLL for maybe problems with external player. If you have different players you should assign Windows Media Player to WAV files manually.
- FASM_Screen2.jpg (52.19 KiB) Viewed 6867 times
The sample program ZX81DEMO.ASM was adapted to the new BASIC commands / structures.
The new features here shortly described, I will explain in a few days in the announced tutorial in more detail.
;labelusenumeric
;labelusenumeric can be used without ;labelautodetect for automatic detection of numeric labels only
=> ;labelautodetect should to be used with caution as all unknown instructions or statements will be interpreted as labels and this could confuse with possibly typos
format
format can be used now simply as format zx81 instead of binary. The used extension is ".p" as default.
And the codepage for translating ASCII to ZX charset will be used and format zx80 is prepared to be used in future.
AUTORUN
AUTORUN is now a label which could be placed directly in front of the desired BASIC line. If no AUTORUN is desired, it could be commented out or moved after the last BASIC line.
line numbers
BASIC line numbers are obeslete and from the IDE view only numeric labels. The lines are numbered automatically in steps of 10 which can be changed with the AUTOLINE <value> directive. AUTOLINE can appear multiple in the source with different desired values. Manual line numbers and automatic line numbers can be mixed free, for example to use a special line number for a BASIC line or to give a special new offset to a BASIC line. More in the tutorial.
REM
REM can be followed by any strings, numbers or characters which will be translated to ZX charset automatically. ZX pseudo instructions/functions as TAN, CHR$, LEN or similar are not supported as this would be done with real assembler instructions instead.
assembler blocks
To define an assembler block you can simply use REM followed by _asm and Z80 assembler code. The block has to be end with END _asm before a new BASIC statement can be processed. There are some more options with combination of _noedit or _hide, more in the tutorial later. There will be possibility to move assembler code to variables in future, too.
RAND
RAND is used by now only for executing code from assembler blocks (mainly from REM lines) in conjunction with function USR. After RAND USR a number or a label can follow. You all may know RAND USR 16514 which is supported. But there can be used RAND USR labelx for executing code at labelx placed somewhere in any REM assembler block. So there can be defined different entry points for the code easily with labels. Numbers and labels can be preceeded by the char #. RAND USR #120 will start assembler code of BASIC line 120 and will automatically add the offset of 5 bytes from the REM statement (line_number+line_lenght+command). The same can be done with RAND USR #label2 to start assembly code from the line with label2 (instead of a defined line number).
So that's all for now very short described. You will find more detailed examples later in the tutorial thread here. Have fun.
Version 1.71.01b.Z80 (this version has been replace by 1.71.01c.Z80 which can be found in the tutorial thread, first posting).
=>
viewtopic.php?f=6&t=1064