summaryrefslogtreecommitdiff
path: root/src/Machine.purs
blob: 7ee4a55579496712dee399dd3bf3a96cecd3c9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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