Last change
on this file since 83 was
83,
checked in by mulligan, 10 years ago
|
Lots of work done on tidying up code.
|
File size:
1.8 KB
|
Line | |
---|
1 | open "Bit.ml";; |
---|
2 | open "Nibble.ml";; |
---|
3 | open "Byte.ml";; |
---|
4 | open "Byte7.ml";; |
---|
5 | open "Word.ml";; |
---|
6 | |
---|
7 | module type 8051_SERIES = |
---|
8 | sig |
---|
9 | type bit |
---|
10 | type nibble |
---|
11 | type byte |
---|
12 | type byte7 |
---|
13 | type word |
---|
14 | |
---|
15 | type sfr |
---|
16 | |
---|
17 | type code_memory |
---|
18 | type low_internal_ram |
---|
19 | type high_internal_ram |
---|
20 | type external_ram |
---|
21 | |
---|
22 | type processor_status |
---|
23 | type program_counter |
---|
24 | |
---|
25 | type asm_instruction |
---|
26 | type program = asm_instruction list |
---|
27 | type bit_instruction = byte |
---|
28 | |
---|
29 | val power_up: processor_status |
---|
30 | end;; |
---|
31 | |
---|
32 | module 8051_Series (Bit: BIT) |
---|
33 | (Nibble: NIBBLE |
---|
34 | with type bit = Bit.bit) |
---|
35 | (Byte: BYTE |
---|
36 | with type bit = Bit.bit |
---|
37 | and type nibble = Nibble.nibble) |
---|
38 | (Byte7: BYTE7 |
---|
39 | with type bit = Bit.bit |
---|
40 | and type nibble = Nibble.nibble) |
---|
41 | (Word: WORD |
---|
42 | with type bit = Bit.bit |
---|
43 | and type nibble = Nibble.nibble |
---|
44 | and type byte = Byte.byte) |
---|
45 | (SpecialFunctionRegister: SFR |
---|
46 | with type bit = Bit.bit |
---|
47 | and type byte = Byte.byte): 8051_SERIES = |
---|
48 | struct |
---|
49 | type bit = Bit.bit |
---|
50 | type nibble = Nibble.nibble |
---|
51 | type byte = Byte.byte |
---|
52 | type byte7 = Byte.byte7 |
---|
53 | type word = Word.word |
---|
54 | |
---|
55 | type sfr = SpecialFunctionRegister.sfr |
---|
56 | |
---|
57 | type code_memory = word Map.Make (struct type t = byte7 let compare = Pervasives.compare end) |
---|
58 | type low_internal_ram = Map.Make (struct type t = byte7 let compare = Pervasives.compare end) |
---|
59 | type high_internal_ram = Map.Make (struct type t = byte7 let compare = Pervasives.compare end) |
---|
60 | type external_ram = Map.Make (struct type t = byte7 let compare = Pervasives.compare end) |
---|
61 | |
---|
62 | type processor_status = { |
---|
63 | program_counter: word; |
---|
64 | sfr: sfr; |
---|
65 | |
---|
66 | } |
---|
67 | end;; |
---|
Note: See
TracBrowser
for help on using the repository browser.