Re: pyz80 question

2007-08-30 Thread Simon Owen

Stefan Drissen wrote:

1. the downloaded file, although being shown as pyz80.tgz is
miraculously downloaded as pyz80.tar - use 7-zip to open this file.


Dunno if that's a browser or Windows quirk, but I also find .tar.gz 
files are renamed as .tar.tar on download!




3. from a command prompt ensure that python is in your path (set
path=%path%;c:\python) and then invoke as:

python pyz80 pang.z80


I think ActivePython defaulted to adding it to my path and setting an 
executable extension, so just use pyz80.py pang.z80.


I use a small batch file to assemble and, if successful, launch the disk 
image in SimCoupe:


pyz80.py -I samdos2 blah.asm
@if %errorlevel%==0 start blah.dsk

The -I injects a local samdos2 file into the disk image, so it's also 
suitable for booting on a real SAM (the bare image only works in 
SimCoupe due to the automagical booting feature).  If you also use the 
autoboot keyword in your source file, your code file also launches on 
bootup for faster testing.



 Which automatically adds an item to the feature list for SimCoupe:
 detect that Comet is printing a file and run at maximum speed ;-)

Implemented :-)



pass  1 ...
Error: Allocated invalid space  0 bytes
pang.z80:414 DEFS $/256+1*256-$


I think the  0 is due to Comet using left-to-right evaluation and 
pyz80 using proper operator precedence.  You could try using --nobodmas 
with pyz80 to force the old behaviour, or use the simple expression 
Andrew suggested to me:  defs -$\256


Si


Re: pyz80 question

2007-08-30 Thread Andrew Collier


On 30 Aug 2007, at 08:42, Simon Owen wrote:


pass  1 ...
Error: Allocated invalid space  0 bytes
pang.z80:414 DEFS $/256+1*256-$


I think the  0 is due to Comet using left-to-right evaluation  
and pyz80 using proper operator precedence.  You could try using -- 
nobodmas with pyz80 to force the old behaviour, or use the simple  
expression Andrew suggested to me:  defs -$\256


I'll check this - with --nobodmas pyz80 should be completely  
compatible with comet files.


(If the code is already 256-byte aligned, doesn't Stefan's version  
leave a 256-byte gap?)


The other option is to use a new pyz80 extension, whose intent should  
be much clearer:


DEFS ALIGN 256

HTH,
Andrew

--
 ---   Andrew Collier 
   http://www.intensity.org.uk/ ---
  --




Re: pyz80 question

2007-08-30 Thread Simon Owen

Andrew Collier wrote:
The other option is to use a new pyz80 extension, whose intent should be 
much clearer:


DEFS ALIGN 256


Despite having used it in more recent source files, I'd completely 
forgotten you added that!  *blush*


Si



pyz80 question

2007-08-29 Thread Stefan Drissen
Hi all,

For some strange reason I decided to have a look at my old sources and
although Comet was a treat at the time, it simply is underpowered in
today's world. So I thought I'd have a shot at Andrew's pyz80. Here are
the steps to get it working on WinXP:

1. the downloaded file, although being shown as pyz80.tgz is
miraculously downloaded as pyz80.tar - use 7-zip to open this file.
(Ultimate zip totally botched this, resulting in fruitless attempts at
running the .tar from python). Also ensure that you browse PAST the
[contents] 'file' since Windows does not like this. The files you need
to extract are (at least) pyz80. 

2. download and install python (I used 2.51) 

3. from a command prompt ensure that python is in your path (set
path=%path%;c:\python) and then invoke as:

python pyz80 pang.z80

In this case pang.z80 is my text source file. I have given up trying to
use drive letters etc, so simply ensure that pyz80 and pang.z80 are
located in the same directory. 

Hurrah - a pang.dsk image results containing the compiled code. 

The easiest way of getting your current source files from SimCoupe to
the outside world is to print them in Comet with the printer set to a
text file in SimCoupe (this has been mentioned before). Which
automatically adds an item to the feature list for SimCoupe: detect that
Comet is printing a file and run at maximum speed ;-)

Ok, so far so good.

Now, my 'functional' pyz80 problem:

pass  1 ...
Error: Allocated invalid space  0 bytes
pang.z80:414 DEFS $/256+1*256-$
Error: OpCode not recognised
pang.z80:414 DEFS $/256+1*256-$

These statements are used to align blocks of code to 256 byte
boundaries. 

Regards,

Stefan