Page 2 of 2

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 06, 2010 10:07 am
by sixxie
Yes, that all makes sense, or rather it doesn't make any sense at all, but I do now remember that it happens. DOS, eh?

Nice to get a bit of a kick up the arse occasionally to remind me that nothing is straightforward!

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 06, 2010 1:27 pm
by tjewell
Dont' beat yourself up about it! It's still a great piece of code, and you'd be forgiven for presuming that only a mad person would run Perl under DOS. Apologies for being that mad person and exposing the problem. Still, I'm happy because I now program the beast again!

Re: Loading binaries created by asm6809.pl

Posted: Sun Sep 12, 2010 5:03 pm
by zephyr
tjewell wrote:So the fix is simple - Sixxie, I've added a "binmode $output_file;" at line 557 in the assembler script. I guess better minds than mine could work out how to do a 'if DOS then' kinda wrapper round it.
http://alma.ch/perl/perloses.htm
http://stackoverflow.com/questions/3346 ... em-in-perl

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 13, 2010 12:55 am
by zephyr
Perl is an unknown language for me at present; but from the information above I would think the following code placed at line 558 (Perl script v1.1) would do the job.

Code: Select all

if (($^O eq 'MSWin32') || ($^O eq 'dos')) { 
   binmode $output_file; 
}
Is this correct?

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 13, 2010 8:49 am
by sixxie
That's the sort of thing, but it's not necessary: in this case, we want binary mode whatever the architecture. On non-DOS, it'll just be a no-op.

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 13, 2010 3:05 pm
by zephyr
Are you going to add 'binmode $output_file;' to your v1.1 (change version to 1.2) Perl script?

Re: Loading binaries created by asm6809.pl

Posted: Mon Sep 13, 2010 8:53 pm
by sixxie
Looks like I already had something called 1.2 in git, so this is 1.3, and uploaded!

Re: Loading binaries created by asm6809.pl

Posted: Tue Sep 14, 2010 8:15 pm
by zephyr
Thanks! :)