SymbolicInstruction

Struct SymbolicInstruction 

Source
pub struct SymbolicInstruction {
    pub held: bool,
    pub configuration: Unsigned5Bit,
    pub opcode: Opcode,
    pub index: Unsigned6Bit,
    pub operand_address: OperandAddress,
}
Expand description

A TX-2 instruction broken down into its component fields.

Fields§

§held: bool§configuration: Unsigned5Bit§opcode: Opcode§index: Unsigned6Bit§operand_address: OperandAddress

Implementations§

Trait Implementations§

Source§

impl Debug for SymbolicInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SymbolicInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Convert a SymbolicInstruction to text (Unicode) form.

We use supernumerary opcode mnemonics where one is suitable (though we keep the original configuration value). Configuration values are rendered as superscripts. Index addresses are rendered as subscripts and operand addresses as normal digits. These match the conventions used in the TX-2 User Handbook.

The User Handbook indicates that the hold bit should be represented as h (lower-case “H”) when 1 and as h with overbar when 0. We use ħ (a Unicode lower-case h with stroke) to signal that. When the defer bit takes the value which is the default for the current instruction, nothing (neither “h” nor “ħ”) is printed.

This documentation comment previously said that Sketchpad used ‘:’ for hold, but I cannot find an example of this in Jurij’s transcription, so the statement that Sketchpad used ‘:’ must have been wrong.

The representation of instructions may change over time as we discover archival material containing program listings. The idea is to generally be consistent with the materials we have available.

Instructions such as SKM should show the index address as a bit selector, but this may not yet happen in all the cases we would want it. This will change over time as we implement more of the instruction opcodes in the emulator.

Some addresses (arithmetic unit registers for example) are “well-known” but we do not currently display these in symbolic form.

Source§

impl From<&SymbolicInstruction> for Instruction

Source§

fn from(s: &SymbolicInstruction) -> Instruction

Converts to this type from the input type.
Source§

impl Inst for SymbolicInstruction

Source§

fn is_held(&self) -> bool

Obtain the value of the “hold” bit.
Source§

fn configuration(&self) -> Unsigned5Bit

Fetch the configuration field of the instruction. This is used as an index to fetch a system configuration from the F-memory. Table 7-2 in the TX-2 User Handbook explains what data exists in the F-memory in the standard configuration. Read more
Source§

fn index_address(&self) -> Unsigned6Bit

indexation is actually a signed operation (see the IndexBy trait) but index addresses are shown as positive numbers (e.g. 77) in assembler source code.
Source§

fn opcode_number(&self) -> u8

The opcode of the instruction.
Source§

fn is_deferred_addressing(&self) -> bool

The value of the defer bit from the operand address field.
Source§

fn operand_address(&self) -> OperandAddress

Source§

fn operand_address_and_defer_bit(&self) -> Unsigned18Bit

Fetches the operand address with the defer bit (if set) in bit position 17.
Source§

impl PartialEq for SymbolicInstruction

Source§

fn eq(&self, other: &SymbolicInstruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&Instruction> for SymbolicInstruction

Source§

type Error = DisassemblyFailure

The type returned in the event of a conversion error.
Source§

fn try_from( inst: &Instruction, ) -> Result<SymbolicInstruction, DisassemblyFailure>

Performs the conversion.
Source§

impl Eq for SymbolicInstruction

Source§

impl StructuralPartialEq for SymbolicInstruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.