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
impl Debug for SymbolicInstruction
Source§impl Display for SymbolicInstruction
impl Display for SymbolicInstruction
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
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
impl From<&SymbolicInstruction> for Instruction
Source§fn from(s: &SymbolicInstruction) -> Instruction
fn from(s: &SymbolicInstruction) -> Instruction
Source§impl Inst for SymbolicInstruction
impl Inst for SymbolicInstruction
Source§fn configuration(&self) -> Unsigned5Bit
fn configuration(&self) -> Unsigned5Bit
Source§fn index_address(&self) -> Unsigned6Bit
fn index_address(&self) -> Unsigned6Bit
IndexBy
trait) but index addresses are shown as positive numbers
(e.g. 77) in assembler source code.Source§fn opcode_number(&self) -> u8
fn opcode_number(&self) -> u8
Source§fn is_deferred_addressing(&self) -> bool
fn is_deferred_addressing(&self) -> bool
fn operand_address(&self) -> OperandAddress
Source§fn operand_address_and_defer_bit(&self) -> Unsigned18Bit
fn operand_address_and_defer_bit(&self) -> Unsigned18Bit
Source§impl PartialEq for SymbolicInstruction
impl PartialEq for SymbolicInstruction
Source§impl TryFrom<&Instruction> for SymbolicInstruction
impl TryFrom<&Instruction> for SymbolicInstruction
Source§type Error = DisassemblyFailure
type Error = DisassemblyFailure
Source§fn try_from(
inst: &Instruction,
) -> Result<SymbolicInstruction, DisassemblyFailure>
fn try_from( inst: &Instruction, ) -> Result<SymbolicInstruction, DisassemblyFailure>
impl Eq for SymbolicInstruction
impl StructuralPartialEq for SymbolicInstruction
Auto Trait Implementations§
impl Freeze for SymbolicInstruction
impl RefUnwindSafe for SymbolicInstruction
impl Send for SymbolicInstruction
impl Sync for SymbolicInstruction
impl Unpin for SymbolicInstruction
impl UnwindSafe for SymbolicInstruction
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
§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.