Loading binaries created by asm6809.pl

A place to discuss everything Dragon related that doesn't fall into the other categories.
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Loading binaries created by asm6809.pl

Post 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!
tjewell
Posts: 348
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: Loading binaries created by asm6809.pl

Post 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!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Loading binaries created by asm6809.pl

Post 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
Last edited by zephyr on Mon Sep 13, 2010 1:48 am, edited 3 times in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Loading binaries created by asm6809.pl

Post 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?
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Loading binaries created by asm6809.pl

Post 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.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Loading binaries created by asm6809.pl

Post by zephyr »

Are you going to add 'binmode $output_file;' to your v1.1 (change version to 1.2) Perl script?
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Loading binaries created by asm6809.pl

Post by sixxie »

Looks like I already had something called 1.2 in git, so this is 1.3, and uploaded!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Loading binaries created by asm6809.pl

Post by zephyr »

Thanks! :)
Post Reply