wrench-0.0.6.3
Safe HaskellNone
LanguageHaskell2010

Wrench.Isa.F32a

Description

Synopsis

Documentation

data F32aIsa w l Source #

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 0, otherwise pushes R-1 back and jumps.

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

Instances details
DerefMnemonic (F32aIsa w) w Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

derefMnemonic :: (Text -> Maybe w) -> w -> F32aIsa w (Ref w) -> F32aIsa w w Source #

IsWord w => Machine (F32aSt w) (F32aIsa w w) w Source # 
Instance details

Defined in Wrench.Isa.F32a

Show l => Show (F32aIsa w l) Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

showsPrec :: Int -> F32aIsa w l -> ShowS #

show :: F32aIsa w l -> String #

showList :: [F32aIsa w l] -> ShowS #

ByteSize (F32aIsa w l) Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

byteSize :: F32aIsa w l -> Int Source #

CommentStart (F32aIsa w l) Source # 
Instance details

Defined in Wrench.Isa.F32a

IsWord w => MnemonicParser (F32aIsa w (Ref w)) Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

mnemonic :: Parser (F32aIsa w (Ref w)) Source #

data F32aSt w Source #

Constructors

F32aSt 

Fields

Instances

Instances details
Show w => Show (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

showsPrec :: Int -> F32aSt w -> ShowS #

show :: F32aSt w -> String #

showList :: [F32aSt w] -> ShowS #

IsWord w => InitState (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

Methods

initState :: Int -> MemOf (F32aSt w) -> StdGen -> F32aSt w Source #

IsWord w => Inspectable (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

Associated Types

type WordOf (F32aSt w) 
Instance details

Defined in Wrench.Isa.F32a

type WordOf (F32aSt w) = w
type IsaOf (F32aSt w) 
Instance details

Defined in Wrench.Isa.F32a

type IsaOf (F32aSt w) = F32aIsa w w
IsWord w => Machine (F32aSt w) (F32aIsa w w) w Source # 
Instance details

Defined in Wrench.Isa.F32a

type IsaOf (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

type IsaOf (F32aSt w) = F32aIsa w w
type MemOf (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

type MemOf (F32aSt w) = IoMem (F32aIsa w w) w
type WordOf (F32aSt w) Source # 
Instance details

Defined in Wrench.Isa.F32a

type WordOf (F32aSt w) = w

f32aMnemonics :: [Text] Source #

Every word the MnemonicParser instance accepts as an instruction.