Opcode

Enum Opcode 

Source
#[repr(u8)]
pub enum Opcode {
Show 50 variants Opr = 4, Jmp = 5, Jpx = 6, Jnx = 7, Aux = 8, Rsx = 9, Skx = 10, Exx = 12, Adx = 13, Dpx = 14, Skm = 15, Lde = 16, Spf = 17, Spg = 18, Lda = 20, Ldb = 21, Ldc = 22, Ldd = 23, Ste = 24, Flf = 25, Flg = 26, Sta = 28, Stb = 29, Stc = 30, Std = 31, Ite = 32, Ita = 33, Una = 34, Sed = 35, Jov = 37, Jpa = 38, Jna = 39, Exa = 44, Ins = 45, Com = 46, Tsd = 47, Cya = 48, Cyb = 49, Cab = 50, Noa = 52, Dsa = 53, Nab = 54, Add = 55, Sca = 56, Scb = 57, Sab = 58, Tly = 60, Div = 61, Mul = 62, Sub = 63,
}
Expand description

Opcode enumerates all the valid TX-2 opcodes. These values are taken from the User Handbook. Volume 3 of the Technical Manual (page 1-5-3) describes opcodes 00, 01, 02, 03, 04 (mentioning bit 2.8 of N being in state 1), 13, 23, 33, 45, 50, 51, 52, 53, 63, 73 as being undefined.

Different copies of the User Handbook differ in the description of opcodes 0o44 and 0o45.

Variants§

§

Opr = 4

Opcode 04 (which is sometimes known as OPR) is used to encode two kinds of instructions, IOS and AOP.

IOS is the I/O select instruction and is described in the TX-2 Users Handbook, section 4-3.5.

Bits 2.7 and 2.8 of the instruction work determine whether an OPR instruction is IOS or AOP (or invalid).

AOP is (apparently, documentation is a bit thin) the Arithmetic Operation instruction. This operates only on the Arithmetic unit (that is, it makes no memory reference).

See Technical Manual Vol 2 section 10-2.5.3 (AOP instructions), Technical Manual Vol 3 section 16-5.1 (OPR (04) AOP, see physical PDF page number 45). Section 16-5.1 claims that AOP is described in detail in chapter 4 of the Technical Manual.

§

Jmp = 5

§

Jpx = 6

§

Jnx = 7

§

Aux = 8

§

Rsx = 9

§

Skx = 10

§

Exx = 12

§

Adx = 13

§

Dpx = 14

§

Skm = 15

§

Lde = 16

§

Spf = 17

§

Spg = 18

§

Lda = 20

§

Ldb = 21

§

Ldc = 22

§

Ldd = 23

§

Ste = 24

§

Flf = 25

§

Flg = 26

§

Sta = 28

§

Stb = 29

§

Stc = 30

§

Std = 31

§

Ite = 32

§

Ita = 33

§

Una = 34

§

Sed = 35

§

Jov = 37

I have two copies of the User Handbook and they differ in their description of opcodes 0o44, 0o45.

In the August 1963 copy, 0o44 is missing and 0045 is JOV.

In the index of the October 1961 copy, 0o44 is JOV and 0o45 is JZA (handwritten). However, in this copy, page 3-32 (which describes JPA, JNA, JOV) gives JOV as 0o45. So I assume this is just an error in the index. This copy does not otherwise describe a JZA opcode.

§

Jpa = 38

§

Jna = 39

§

Exa = 44

§

Ins = 45

§

Com = 46

§

Tsd = 47

§

Cya = 48

§

Cyb = 49

§

Cab = 50

§

Noa = 52

§

Dsa = 53

§

Nab = 54

§

Add = 55

§

Sca = 56

§

Scb = 57

§

Sab = 58

§

Tly = 60

§

Div = 61

§

Mul = 62

§

Sub = 63

Implementations§

Source§

impl Opcode

Source

pub fn number(&self) -> u8

Source

pub fn hold_is_implicit(&self) -> bool

Trait Implementations§

Source§

impl Clone for Opcode

Source§

fn clone(&self) -> Opcode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Opcode

Source§

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

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

impl Display for Opcode

Convert an opcode to its text representation.

The primary (i.e. not supernumerary) opcode mnemonic is used, because the configuration value which would identify a supernumerary opcode is not passed to the fmt method of the Display trait.

Source§

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

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

impl Hash for Opcode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Opcode

Source§

fn eq(&self, other: &Opcode) -> 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<u8> for Opcode

Source§

type Error = DisassemblyFailure

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

fn try_from(opcode: u8) -> Result<Opcode, DisassemblyFailure>

Performs the conversion.
Source§

impl Copy for Opcode

Source§

impl Eq for Opcode

Source§

impl StructuralPartialEq for Opcode

Auto Trait Implementations§

§

impl Freeze for Opcode

§

impl RefUnwindSafe for Opcode

§

impl Send for Opcode

§

impl Sync for Opcode

§

impl Unpin for Opcode

§

impl UnwindSafe for Opcode

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.