source: src/joint/Joint.ma @ 1174

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

changes made on claudio's request: changed order of nesting in the joint-ertl statements to make the semantics easier to write. big changes required...

File size: 2.2 KB
Line 
1include "ASM/String.ma".
2include "ASM/I8051.ma".
3include "common/CostLabel.ma".
4include "common/Graphs.ma".
5include "common/AST.ma".
6include "common/Registers.ma".
7
8record params: Type[1] ≝
9 { acc_a_reg: Type[0]
10 ; acc_b_reg: Type[0]
11 ; dpl_reg: Type[0]
12 ; dph_reg: Type[0]
13 ; pair_reg: Type[0]
14 ; generic_reg: Type[0]
15 }.
16
17inductive joint_instruction (p:params) (globals: list ident): Type[0] ≝
18  | joint_instr_comment: String → joint_instruction p globals
19  | joint_instr_cost_label: costlabel → joint_instruction p globals
20  | joint_instr_int: generic_reg p → Byte → joint_instruction p globals
21  | joint_instr_move: pair_reg p → joint_instruction p globals
22  | joint_instr_pop: acc_a_reg p → joint_instruction p globals
23  | joint_instr_push: acc_a_reg p → joint_instruction p globals
24  | joint_instr_address: ∀i: ident. (member i (eq_identifier ?) globals) → dpl_reg p → dph_reg p → joint_instruction p globals
25  | joint_instr_opaccs: OpAccs → acc_a_reg p → acc_b_reg p → joint_instruction p globals
26  | joint_instr_op1: Op1 → acc_a_reg p → joint_instruction p globals
27  | joint_instr_op2: Op2 → acc_a_reg p → generic_reg p → joint_instruction p globals
28  | joint_instr_clear_carry: joint_instruction p globals
29  | joint_instr_set_carry: joint_instruction p globals
30  | joint_instr_load: acc_a_reg p → dpl_reg p → dph_reg p → joint_instruction p globals
31  | joint_instr_store: dpl_reg p → dph_reg p → acc_a_reg p → joint_instruction p globals
32  | joint_instr_call_id: ident → nat → joint_instruction p globals
33  | joint_instr_cond: acc_a_reg p → label → joint_instruction p globals.
34
35inductive joint_statement (next: Type[0]) (extend: Type[0]) (p:params) (globals: list ident): Type[0] ≝
36  | joint_st_sequential: joint_instruction p globals → next → joint_statement next extend p globals
37  | joint_st_goto: label → joint_statement next extend p globals
38  | joint_st_return: joint_statement next extend p globals
39  | joint_st_extension: extend → joint_statement next extend p globals.
40
41(* Used in LTL and LIN *) 
42inductive registers_move: Type[0] ≝
43 | from_acc: Register → registers_move
44 | to_acc: Register → registers_move.
Note: See TracBrowser for help on using the repository browser.