Wanted: Software guru....

ZX80 / ZX81 hardware and software requested for either sale or swapping
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Wanted: Software guru....

Post by Andy Rea »

Hi Peeps,

Thought i'd throw this into the wild, i've googled and have draw a blank, but i;m pretty sure somebody might have wanted to do what i'm trying to do already. In a nutshell i want to take a raw binary file ( say an STC music file ) and dump it's contents to a formatted text file :-

so say the first few bytes of the binary file are 0,1,2,3,4....15,16,17 ect.

the output in the text file should be

<tab> DB $00,$01,$02,$03,$04, .... $0F
<tab> DB $10,$11,$12, ....

This then allows easy inclusion into an assembler file.

my current solution is to load said binary into an hex editor, i then print ( to a file ) which has the wrong format :( and include that, then in my favorite editor i use a keystroke macro to change each line to the desired format. it works but is a pain.

Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Wanted: Software guru....

Post by sirmorris »

Morning!

You can compile this with the free visual studio 2010, or just yell and I'll amend it as required.

C
Attachments
tohex.zip
(29.76 KiB) Downloaded 270 times
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Wanted: Software guru....

Post by Andy Rea »

Top job, i knew somebody would have/be able to knock something up.

Works a treat, when you remeber to pipe the output to a file.

Thanks Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Wanted: Software guru....

Post by PokeMon »

Andy Rea wrote: the output in the text file should be

<tab> DB $00,$01,$02,$03,$04, .... $0F
<tab> DB $10,$11,$12, ....
I don't know what kind of assembler you use but this is very easy with the ZX81-IDE (based on flatassembler).
The file is a special directive and its syntax is different. This
directive includes a chain of bytes from file and it should be followed by the
quoted file name, then optionally numerical expression specifying offset in
file preceded by the colon, then - also optionally - comma and numerical
expression specifying count of bytes to include (if no count is specified, all
data up to the end of file is included). For example file 'data.bin' will
include the whole file as binary data and file 'data.bin':10h,4 will include
only four bytes starting at offset 10h.
So you could program like this:

Code: Select all

format binary as "p"

        org     $4000
        LD      HL,table_begin
        LD      DE,target
        LD      BC,table_end-table_begin
        LDIR
        ; do something more in assembler

        org     $5000
target:

        org     $7000
table_begin:
        file    'FASTLOAD.BIN':$80,$10
table_end:
which will be assembled like this

Code: Select all

                                        format binary as "p"
                                        
                                                org     $4000
0000: [4000] 21 00 70                           LD      HL,table_begin
0003: [4003] 11 00 50                           LD      DE,target
0006: [4006] 01 10 00                           LD      BC,table_end-table_begin
0009: [4009] ED B0                              LDIR
                                                ; do something more in assembler
                                        
                                                org     $5000
                                        target:
                                        
                                                org     $7000
                                        table_begin:
000B: [7000] 48 00 ED B0 C3 32 40 D3            file    'FASTLOAD.BIN':$80,$10
             FD 21 08 40 01 FE 7F 16    
                                        table_end:
                                        
Unfortunately with implementing dbzx statement for ZX81 charset I made an error which let the file instructive not work in the last version.
In the attachement you find a new version, just install the latest version of this thread:
viewtopic.php?t=795
and copy attached FASMWZ80.EXE in this directory.
And FASMWZ80 could be used for basic instructions of REM and PRINT USR - just look at the ZX81DEMO.ASM which will offer a framework for a simple BASIC (auto)starting program if you want / need.

I think it should be a standard to include binaries in a source development as blocks. ;)

I will upload a complete new version with description of changes and new features later in the evening.
FASMWZ80.zip
(52.83 KiB) Downloaded 279 times
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Wanted: Software guru....

Post by Andy Rea »

Cool, i really ought to give it a go, but you know wha it's like when your stuck using the same thing forever....

I use crimson editor, it's a good *code* editor with plenty of features but doesn't unecessarily complicate things

and then i still use the command line Tasm assembler

Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Wanted: Software guru....

Post by PokeMon »

Andy Rea wrote:Cool, i really ought to give it a go, but you know wha it's like when your stuck using the same thing forever....
It's not perfect by now, but at the end you will love it.
Only one program fits all. :mrgreen:
By the way, how do you develop your programs ?
How many tools you use and how many keys you have to press to completely load a changed source into your emulator ?
I guess that you do not use a real Zeddy for development.

When IDE is complete (in a few weeks, maybe 2 or 3 month) I think I develop faster on a real Zeddy as anybody on an emulator.
Just change something in your source, press F9 and less than a second later Zeddy has the new program in memory loaded and restarted without pressing any key more either on PC or either on Zedddy.
Or update only a memory area from $ to $. Flush. Would be nice, hä ? :mrgreen:

It's because I am so lazy. I want to have only ONE program, ONE source, ONE key to press. That's all. 8-)

And I want to have the feeling of a real Zeddy even during development process. That's most of the time I use it.
So why buy a Zeddy when you work with emulators ???
Just to let the program run at the end, only to see if emulator is compatible to real Zeddy ?
It's a kind of philosophy. :ugeek:
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Wanted: Software guru....

Post by Andy Rea »

He He i can do it in 1 key press.... F3 in command window :mrgreen: everything else can be done by the mouse...

but erm really, to many steps, save source, switch to cammand line, assemble, switch to emu, reload

it's cumbersome at times, but thats pretty much the way i've always done assembly for the zeddy, sure as hell beats paper and pencil....

Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Wanted: Software guru....

Post by PokeMon »

Well you need many steps regardless you use mouse or keyboard macros (which have to be adapted from time to time) and so on.
I trust on just F9 let it run on real hardware.
I think emulators are only used by developers due to lack of a good development engine.
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Wanted: Software guru....

Post by sirmorris »

I agree. Mostly. I wrote some code today on my laptop at my father-in-law's place, far away from a real zeddy. If development was transparent - 1 setting to switch between real and emulated - then it would be perfect.

I don't trust even the best emulators available today, I've been de-railed by incompatibility a couple of times - I only trust the bare metal :)

I think I am going to try to commit to your assembler/ide. You make a very convincing case :) I have a dual relationship at the moment with TASM/PASMO. TASM won't work on windows 7 and PASMO will silently allow errors into the code. TASM can generate a listing file which is why I favour it. PASMO could eat the tasm code without too many changes so that's why I used it. But I'm not happy with either. I used TASM's macros extensively, and had to lose them when I switched :(

C
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Wanted: Software guru....

Post by Andy Rea »

Um yeah don't trust EightyOne when it comes to custom display drivers, many times what works in EightyOne doesn't work on a real Zeddy, it's all timing related, the instructions all work of course, it's just EightyOnes not exactly 100% on the hysnc / Vsync timing.

EDIT: Oh i also think that EO is a little generous on available clock cycles bewteen Vsync's.... i was most suprised with my last creation when it started flickering ocassionally, but did not do so in EO, which resulted in a few more speed tweaks !

Andy
what's that Smell.... smells like fresh flux and solder fumes...
Post Reply