Using the read function with an offset
Lolbassett_at_aol.com
Date: 03/30/04
- Next message: Andrew Gaffney: "Re: determing number of records returned with DBI"
- Previous message: Jeff 'Japhy' Pinyan: "Re: What is happening here"
- Next in thread: Bob Showalter: "RE: Using the read function with an offset"
- Maybe reply: Bob Showalter: "RE: Using the read function with an offset"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Mar 2004 12:34:18 EST To: beginners@perl.org
Hi!
I'm writing some 68k modules, for disassembly, assembly, reading
instructions, analysing instructions, etc.
The package I'm stuck on is supposed to read a 16bit instruction, and then
break it down into an array, with each element seperated.
So far, I'm trying to read 16bits, at an offset specified by the user, but
for some reason, all I get is more white spaces infront of the first 16bits in
the file.
open SOURCE, "$File" or
die "Cannot open $File\n";
binmode SOURCE;
read SOURCE, $Instr, 2, $Offset;
return $Instr;
I find that if I read from the first byte, I get the first two bytes in my
file, but if I read from the 5, I just get three white spaces, and then the
first two bytes.
Can anybody help?
Thanks,
Lewis AS Bassett
- Next message: Andrew Gaffney: "Re: determing number of records returned with DBI"
- Previous message: Jeff 'Japhy' Pinyan: "Re: What is happening here"
- Next in thread: Bob Showalter: "RE: Using the read function with an offset"
- Maybe reply: Bob Showalter: "RE: Using the read function with an offset"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|