aboutsummaryrefslogtreecommitdiff
path: root/src/binary.rs
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-04 11:09:51 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-04 11:09:51 -0700
commitb9bd878207c6b784694c15675a09636d112242d7 (patch)
tree46ee80da19c49a951eef986562c068e147e0409f /src/binary.rs
parent1e93d4c727f632cd5d6cdc90e6d8a21883d6f409 (diff)
Implement initializing memory from text/data segments
Diffstat (limited to 'src/binary.rs')
-rw-r--r--src/binary.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/binary.rs b/src/binary.rs
index 122af51..a1d447e 100644
--- a/src/binary.rs
+++ b/src/binary.rs
@@ -22,6 +22,7 @@ use std::num;
use std::path::Path;
use std::str;
+/// Representation of a binary
pub struct Binary {
pub words: Vec<u32>,
}
@@ -72,6 +73,7 @@ impl From<num::ParseIntError> for BinaryError {
}
impl Binary {
+ /// Load a binary from a hex file (generated with elf2hex)
pub fn new_from_hex_file(path: &Path) -> Result<Binary, BinaryError> {
let file = try!(File::open(path));
let file = io::BufReader::new(file);