From ef88eb173fc87bfe1b87be533e4f574209d40b1d Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 26 Feb 2019 11:05:22 +0100 Subject: Initial import Disassembler seems to be working. --- src/Machine.purs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Machine.purs (limited to 'src/Machine.purs') diff --git a/src/Machine.purs b/src/Machine.purs new file mode 100644 index 0000000..7ee4a55 --- /dev/null +++ b/src/Machine.purs @@ -0,0 +1,27 @@ +-- Machine constants +module Machine where + +import Prelude + +-- | Machine’s word size +wordsize :: Int +wordsize = 2 + +-- | Code offset in default dataspace 4 in `wordsize` +codeOffset :: Int +codeOffset = 0x40000 `div` wordsize +-- | Code section size in `wordsize` +codeSize :: Int +codeSize = (128*1024) `div` wordsize + +-- | Pagesize in `wordsize`, documentation sometimes calls this `ps` +pagesize :: Int +pagesize = 512 `div` wordsize + +-- | Max size af a single code module, `cms`, in words +codeModuleSize :: Int +codeModuleSize = 4096 + +defaultDsId :: Int +defaultDsId = 4 + -- cgit v1.2.3