pub enum CodeSegmentHeader {
MpwFar,
Near {
table_offset: u16,
entry_count: u16,
},
ThinkFar {
has_relocations: bool,
first_entry_index: u16,
entry_count: u16,
},
}Expand description
Header stored at the front of each nonzero CODE resource.
MPW-style near segments use the documented tabOff, nEntries
format. Symantec/THINK far CODE uses the same four bytes differently:
word 0 stores the first jump-table entry index plus the relocation
flag, and word 1 has bit $4000 set plus the entry count.
Variants§
MpwFar
MPW far-model segment with a 40-byte header ($FFFF marker).
Near
Standard near-model segment: byte offset from the current jump table base, plus number of entries owned by the segment.
ThinkFar
Symantec/THINK far CODE segment.
Implementations§
Source§impl CodeSegmentHeader
impl CodeSegmentHeader
pub fn parse(data: &[u8]) -> Option<Self>
pub fn from_words(first: u16, second: u16) -> Self
pub fn code_header_size(self) -> u32
pub fn jump_table_start_offset(self) -> Option<u32>
pub fn jump_table_entry_count(self) -> Option<u32>
Trait Implementations§
Source§impl Clone for CodeSegmentHeader
impl Clone for CodeSegmentHeader
Source§fn clone(&self) -> CodeSegmentHeader
fn clone(&self) -> CodeSegmentHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CodeSegmentHeader
Source§impl Debug for CodeSegmentHeader
impl Debug for CodeSegmentHeader
impl Eq for CodeSegmentHeader
Source§impl PartialEq for CodeSegmentHeader
impl PartialEq for CodeSegmentHeader
impl StructuralPartialEq for CodeSegmentHeader
Auto Trait Implementations§
impl Freeze for CodeSegmentHeader
impl RefUnwindSafe for CodeSegmentHeader
impl Send for CodeSegmentHeader
impl Sync for CodeSegmentHeader
impl Unpin for CodeSegmentHeader
impl UnsafeUnpin for CodeSegmentHeader
impl UnwindSafe for CodeSegmentHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.