source: Deliverables/D4.1/ASM.mli @ 46

Last change on this file since 46 was 46, checked in by mulligan, 9 years ago

MOV done.

File size: 2.5 KB
Line 
1open Physical;;
2
3type ('a,'b) union2 = [ `U1 of 'a | `U2 of 'b ]
4type ('a,'b,'c) union3 = [ `U1 of 'a | `U2 of 'b | `U3 of 'c ]
5type ('a,'b,'c,'d,'e,'f) union6 = [ `U1 of 'a | `U2 of 'b | `U3 of 'c | `U4 of 'd | `U5 of 'e | `U6 of 'f ]
6
7type direct = [ `DIRECT of byte ]
8type indirect = [ `INDIRECT of bit ]
9type ext_indirect = [ `EXT_INDIRECT of bit ]
10type reg = [ `REG of bit * bit * bit ]
11type acc = [ `A ]
12type b = [ `B ]
13type dptr = [ `DPTR ]
14type data = [ `DATA of byte ]
15type data16 = [ `DATA16 of word ]
16type acc_dptr = [ `A_DPTR ]
17type acc_pc = [ `A_PC ]
18type indirect_dptr = [ `IND_DPTR ]
19type ext_indirect_dptr = [ `EXT_IND_DPTR ]
20type carry = [ `C ]
21type bit = [ `BIT of byte ]
22type nbit = [ `NBIT of byte ]
23type rel = [ `REL of byte ]
24type addr11 = [ `ADDR11 of word11 ]
25type addr16 = [ `ADDR16 of word ]
26
27type instruction =
28 (* arithmetic operations *)
29   ADD of acc * [ reg | direct | indirect | data ]
30 | ADDC of acc * [ reg | direct | indirect | data ]
31 | SUBB of acc * [ reg | direct | indirect | data ]
32 | INC of [ acc | reg | direct | indirect | dptr ]
33 | DEC of [ acc | reg | direct | indirect ]
34 | MUL of acc * b
35 | DIV of acc * b
36 | DA  of acc
37
38 (* logical operations *)
39 | ANL of
40    (acc * [ reg | direct | indirect | data ],
41     direct * [ acc | data ],
42     carry * [ bit | nbit]) union3
43 | ORL of
44    (acc * [ reg | data | direct | indirect ],
45     direct * [ acc | data ],
46     carry * [ bit | nbit]) union3
47 | XRL of
48    (acc * [ data | reg | direct | indirect ],
49     direct * [ acc | data ]) union2
50 | CLR of [ acc | carry | bit ]
51 | CPL of [ acc | carry | bit ]
52 | RL of acc
53 | RLC of acc
54 | RR of acc
55 | RRC of acc
56 | SWAP of acc
57
58 (* data transfer *)
59 | MOV of 
60    (acc * [ reg | direct | indirect | data ],
61     [ reg | indirect ] * [ acc | direct | data ],
62     direct * [ acc | reg | direct | indirect | data ],
63     dptr * data16,
64     carry * bit,
65     bit * carry
66     ) union6
67 | MOVC of acc * [ acc_dptr | acc_pc ]
68 | MOVX of (acc * [ ext_indirect | ext_indirect_dptr ],
69            [ ext_indirect | ext_indirect_dptr ] * acc) union2
70 | SETB of [ carry | bit ]
71 | PUSH of direct
72 | POP of direct
73 | XCH of acc * [ reg | direct | indirect ]
74 | XCHD of acc * indirect
75
76 (* program branching *)
77 | JC of rel
78 | JNC of rel
79 | JB of bit * rel
80 | JNB of bit * rel
81 | JBC of bit * rel
82 | ACALL of addr11
83 | LCALL of addr16
84 | RET
85 | RETI
86 | AJMP of addr11
87 | LJMP of addr16
88 | SJMP of rel
89 | JMP of indirect_dptr
90 | JZ of rel
91 | JNZ of rel
92 | CJNE of (acc * [ direct | data ], [ reg | indirect ] * data) union2 * rel
93 | DJNZ of [ reg | direct ] * rel
94 | NOP
Note: See TracBrowser for help on using the repository browser.