pub(crate) struct Directive {
pub(crate) blocks: BTreeMap<BlockIdentifier, LocatedBlock>,
pub(crate) equalities: Vec<Equality>,
pub(crate) entry_point: Option<Address>,
}
Expand description
The Directive
is the abstract syntax representation of the
user’s program (i.e. the assembler’s input). A Directive
is
generated (from a super::manuscript::SourceFile
instance) by
the assembler once it has deduced the absolute address at which
each block will be located.
Symbolic information is included in the equalities table, but also within the blocks of the program itself.
Fields§
§blocks: BTreeMap<BlockIdentifier, LocatedBlock>
§equalities: Vec<Equality>
Equalities (we use the term from the TX-2 Users Handbook). In more modern terminology, these would be assignments. An equality can be re-assigned, and the last value assigned takes effect everywhere in the program.
When evaluated, however, the value of an equality can vary in
different places, because it can refer to local tags (which
may be dfefined differently inside macro bodies) or (directly
or indirectly) to #
which is the address of the word
currently being assembled.
entry_point: Option<Address>
The address at which execution should begin, as specified by
the ☛☛PUNCH
meta-command, if one was given. See Users
Handbook, section
6-3.4
and super::manuscript::ManuscriptMetaCommand::Punch
.
Implementations§
Source§impl Directive
impl Directive
pub(crate) fn new( blocks: BTreeMap<BlockIdentifier, LocatedBlock>, equalities: Vec<Equality>, entry_point: Option<Address>, ) -> Self
Sourcepub(crate) fn position_rc_block(&mut self) -> Address
pub(crate) fn position_rc_block(&mut self) -> Address
Determine the address of the RC-block.
The real TX-2 assembler (“M4”) allowed the program optionally
to select a location using the☛☛RC
meta
command,
but this is not yet supported.
pub(crate) fn entry_point(&self) -> Option<Address>
Trait Implementations§
impl Eq for Directive
impl StructuralPartialEq for Directive
Auto Trait Implementations§
impl Freeze for Directive
impl RefUnwindSafe for Directive
impl Send for Directive
impl Sync for Directive
impl Unpin for Directive
impl UnwindSafe for Directive
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef
].