diff options
| author | iximeow <me@iximeow.net> | 2019-03-10 17:25:12 -0700 | 
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2020-01-12 17:28:07 -0800 | 
| commit | e4eff1a3edec523a5ac0c2716573f9ad1ca432ad (patch) | |
| tree | 936d6983ce1740a1edc29cebd37c9ee0cf1b844e /src/lib.rs | |
| parent | f62de4c3eff32c4f3709d5d690671771fd453701 (diff) | |
update a bunch of arm stuff
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 45 | 
1 files changed, 1 insertions, 44 deletions
@@ -1,46 +1,3 @@  extern crate yaxpeax_arch; -use yaxpeax_arch::{Arch, Decodable, LengthedInstruction}; - -#[derive(Debug)] -pub enum Opcode { -    NOP -} - -#[derive(Debug)] -pub struct Instruction { -    pub opcode: Opcode -} - -impl LengthedInstruction for Instruction { -    type Unit = <PIC24 as Arch>::Address; -    fn len(&self) -> Self::Unit { -        3 // ish -    } -} - -impl Decodable for Instruction { -    fn decode<'a, T: IntoIterator<Item=&'a u8>>(bytes: T) -> Option<Self> { -        let mut blank = Instruction { opcode: Opcode::NOP }; -        match blank.decode_into(bytes) { -            Some(_) => Some(blank), -            None => None -        } -    } -    fn decode_into<'a, T: IntoIterator<Item=&'a u8>>(&mut self, bytes: T) -> Option<()> { -        match bytes.into_iter().next() { -            Some(0x00) => { -                self.opcode = Opcode::NOP; -                Some(()) -            }, -            _ => None -        } -    } -} - -pub struct PIC24; -impl Arch for PIC24 { -    type Address = u32; -    type Instruction = Instruction; -    type Operand = (); -} +pub mod armv7;  | 
