Created
October 26, 2018 17:36
-
-
Save lincore81/c7999e827ec1cda2e31f9814b6e3b7cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Asm2 where | |
type Reg = Char | |
data Registers = Registers | |
{ a :: Int | |
, b :: Int | |
, c :: Int | |
, d :: Int | |
, ip :: Int | |
, sp :: Int | |
} deriving (Show, Eq, Ord) | |
data Addr | |
= Absolute Int | |
| Relative Int | |
| Immediate Int | |
| Register Reg | |
deriving (Show, Eq, Ord) | |
data Instruction | |
= Load Reg Addr -- put value in Addr in Reg | |
| Store Reg Addr -- store reg in addr | |
| Add Reg Reg | |
| Sub Reg Reg | |
| Mul Reg Reg | |
| Div Reg Reg | |
| Jiz Addr | |
deriving (Show, Eq, Ord) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment