in reply to Z80 Assembler -> Hex Opcode
You do realise that you are forcing perl to redefine your hash with every call to your sub don't you!!!! By moving the hash definition out of the sub this will run so many orders of magnitude faster it is not funny (roughly 50,000 lines per second in my testing on a mid range single processor PIII 1.2GHz server....)
# first define our hash (just the once not for every bloody line!!!!!! + :o) my %opcodes = ( blah ); open (SOURCE, "<z80code.s") or die "Couldn't open source file."; open (DEST, ">z80code.o") or die "Couldn't open destination file."; while (<SOURCE>) { print DEST encode($_)."\n"; } sub encode{ # blah }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Z80 Assembler -> Hex Opcode
by steves (Curate) on Feb 09, 2003 at 11:36 UTC | |
by tachyon (Chancellor) on Feb 09, 2003 at 11:48 UTC | |
|
Re: Re: Z80 Assembler -> Hex Opcode
by Elgon (Curate) on Feb 09, 2003 at 12:52 UTC | |
by tachyon (Chancellor) on Feb 09, 2003 at 14:18 UTC | |
by Elgon (Curate) on Feb 09, 2003 at 14:58 UTC | |
by tachyon (Chancellor) on Feb 09, 2003 at 15:41 UTC |