| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Wrench.Isa.F32a
Description
Synopsis
- data F32aIsa w l
- data F32aSt w = F32aSt {
- p :: Int
- a :: w
- b :: w
- ram :: IoMem (F32aIsa w w) w
- ir :: [(Int, F32aIsa w w)]
- dataStack :: [w]
- returnStack :: [w]
- dataStackMax :: !Int
- returnStackMax :: !Int
- stopped :: Bool
- extendedArithmeticMode :: Bool
- carryFlag :: Bool
- internalError :: Maybe Text
- f32aMnemonics :: [Text]
Documentation
Constructors
| Return | ; ( -- ) Return: pops the return stack into P. |
| Call l | <address: i32> ( -- ) Call, written as a bare label: pushes the address of the next instruction onto the return stack and jumps. |
| Lit l | lit <value: i32> ( -- value: i32 ) Push a literal. A bare number is the same instruction. |
| Next l | next <address: i32> ( -- ) Loop: pops R; falls through when it was |
| Jump l | <address: i32> ; ( -- ) Jump, written as a label followed by |
| If l | if <address: i32> ( flag: i32 -- ) Pops T: continues with the next instruction word if it was non-zero, jumps if it was zero. |
| MinusIf l | -if <address: i32> ( value: i32 -- ) Minus-if. Pops T: continues with the next instruction word if it was negative (T[31] set), jumps if it was non-negative. |
| AStore | a! ( value: i32 -- ) A-Store. Stores T into register A, popping the data stack. |
| BStore | b! ( value: i32 -- ) B-Store. Stores T into register B, popping the data stack. |
| FetchP l | @p <address: i32> ( -- value: i32 ) Pushes the data stack, reads [P] into T, and increments P. |
| FetchPlus | @+ ( -- value: i32 ) Fetch-plus. Pushes the data stack, reads [A] into T, and increments A. |
| FetchB | @b ( -- value: i32 ) Fetch-B. Pushes the data stack and reads [B] into T. |
| Fetch | @ ( -- value: i32 ) Fetch. Pushes the data stack and reads [A] into T. |
| StoreP l | !p <address: i32> ( value: i32 -- ) Store-P. Writes T into [P], pops the data stack, and increments P. |
| StoreB | !b ( value: i32 -- ) Store-B. Writes T into [B] and pops the data stack. |
| StorePlus | !+ ( value: i32 -- ) Store-plus. Writes T into [A], pops the data stack, and increments A. |
| Store | ! ( value: i32 -- ) Writes T into [A] and pops the data stack. |
| MulStep | +* ( s: i32, t: i32 -- s: i32, t: i32 ) Multiply step. Leaves S alone, replaces T, and shifts A: one iteration of a shift-and-add multiply. |
| DivStep | +/ ( remainder: i32, quotient: i32 -- remainder: i32, quotient: i32 ) Divide step: A holds the dividend, [B] the divisor, T the quotient so far and S the remainder (details: example/step-by-step-div.py). |
| LShift | 2* ( value: i32 -- shifted: i32 ) Left shift. |
| RShift | 2/ ( value: i32 -- shifted: i32 ) Right shift (signed). |
| Inv | inv ( value: i32 -- inverted: i32 ) Invert all bits (was |
| Add | + ( s: i32, t: i32 -- sum: i32 ) Add, or add with carry in extended arithmetic mode. |
| Eam | eam ( flag: i32 -- ) Set arithmetic mode: pops T, extended iff it was non-zero. |
| And | and ( s: i32, t: i32 -- bits: i32 ) |
| Xor | xor ( s: i32, t: i32 -- bits: i32 ) Exclusive Or. Replaces T with the Boolean XOR of S and T. Pops the data stack. |
| Drop | drop ( value: i32 -- ) Drop. Pops the data stack. |
| Dup | dup ( value: i32 -- value: i32, value: i32 ) Dup. Duplicates T on the data stack. |
| RIntoT | r> ( -- value: i32 ) Moves R into T, popping the return stack and pushing the data stack. |
| TIntoR | >r ( value: i32 -- ) Moves T into R, pushing the return stack and popping the data stack. |
| Over | over ( s: i32, t: i32 -- s: i32, t: i32, s: i32 ) Copies S over the top of the data stack. |
| AFetch | a ( -- value: i32 ) Fetches the contents of register A into T, pushing the data stack. |
| Halt | halt ( -- ) |
Instances
| DerefMnemonic (F32aIsa w) w Source # | |
Defined in Wrench.Isa.F32a | |
| IsWord w => Machine (F32aSt w) (F32aIsa w w) w Source # | |
| Show l => Show (F32aIsa w l) Source # | |
| ByteSize (F32aIsa w l) Source # | |
| CommentStart (F32aIsa w l) Source # | |
Defined in Wrench.Isa.F32a Methods | |
| IsWord w => MnemonicParser (F32aIsa w (Ref w)) Source # | |
Constructors
| F32aSt | |
Fields
| |
Instances
| Show w => Show (F32aSt w) Source # | |||||||||
| IsWord w => InitState (F32aSt w) Source # | |||||||||
| IsWord w => Inspectable (F32aSt w) Source # | |||||||||
Defined in Wrench.Isa.F32a Associated Types
| |||||||||
| IsWord w => Machine (F32aSt w) (F32aIsa w w) w Source # | |||||||||
| type IsaOf (F32aSt w) Source # | |||||||||
Defined in Wrench.Isa.F32a | |||||||||
| type MemOf (F32aSt w) Source # | |||||||||
Defined in Wrench.Isa.F32a | |||||||||
| type WordOf (F32aSt w) Source # | |||||||||
Defined in Wrench.Isa.F32a | |||||||||
f32aMnemonics :: [Text] Source #
Every word the MnemonicParser instance accepts as an instruction.