Ignore:
Timestamp:
Sep 21, 2010, 1:51:59 PM (9 years ago)
Author:
mulligan
Message:

Move to polymorphic variants everywhere (scary...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/ASM.mli

    r92 r97  
    2828type instruction =
    2929 (* arithmetic operations *)
    30    ADD of acc * [ reg | direct | indirect | data ]
    31  | ADDC of acc * [ reg | direct | indirect | data ]
    32  | SUBB of acc * [ reg | direct | indirect | data ]
    33  | INC of [ acc | reg | direct | indirect | dptr ]
    34  | DEC of [ acc | reg | direct | indirect ]
    35  | MUL of acc * b
    36  | DIV of acc * b
    37  | DA  of acc
     30 [ `ADD of acc * [ reg | direct | indirect | data ]
     31 | `ADDC of acc * [ reg | direct | indirect | data ]
     32 | `SUBB of acc * [ reg | direct | indirect | data ]
     33 | `INC of [ acc | reg | direct | indirect | dptr ]
     34 | `DEC of [ acc | reg | direct | indirect ]
     35 | `MUL of acc * b
     36 | `DIV of acc * b
     37 | `DA  of acc
    3838
    3939 (* logical operations *)
    40  | ANL of
     40 | `ANL of
    4141    (acc * [ reg | direct | indirect | data ],
    4242     direct * [ acc | data ],
    4343     carry * [ bit | nbit]) union3
    44  | ORL of
     44 | `ORL of
    4545    (acc * [ reg | data | direct | indirect ],
    4646     direct * [ acc | data ],
    4747     carry * [ bit | nbit]) union3
    48  | XRL of
     48 | `XRL of
    4949    (acc * [ data | reg | direct | indirect ],
    5050     direct * [ acc | data ]) union2
    51  | CLR of [ acc | carry | bit ]
    52  | CPL of [ acc | carry | bit ]
    53  | RL of acc
    54  | RLC of acc
    55  | RR of acc
    56  | RRC of acc
    57  | SWAP of acc
     51 | `CLR of [ acc | carry | bit ]
     52 | `CPL of [ acc | carry | bit ]
     53 | `RL of acc
     54 | `RLC of acc
     55 | `RR of acc
     56 | `RRC of acc
     57 | `SWAP of acc
    5858
    5959 (* data transfer *)
    60  | MOV of
     60 | `MOV of
    6161    (acc * [ reg | direct | indirect | data ],
    6262     [ reg | indirect ] * [ acc | direct | data ],
     
    6666     bit * carry
    6767     ) union6
    68  | MOVC of acc * [ acc_dptr | acc_pc ]
    69  | MOVX of (acc * [ ext_indirect | ext_indirect_dptr ],
     68 | `MOVC of acc * [ acc_dptr | acc_pc ]
     69 | `MOVX of (acc * [ ext_indirect | ext_indirect_dptr ],
    7070            [ ext_indirect | ext_indirect_dptr ] * acc) union2
    71  | SETB of [ carry | bit ]
    72  | PUSH of direct
    73  | POP of direct
    74  | XCH of acc * [ reg | direct | indirect ]
    75  | XCHD of acc * indirect
     71 | `SETB of [ carry | bit ]
     72 | `PUSH of direct
     73 | `POP of direct
     74 | `XCH of acc * [ reg | direct | indirect ]
     75 | `XCHD of acc * indirect
    7676
    7777 (* program branching *)
    78  | JC of rel
    79  | JNC of rel
    80  | JB of bit * rel
    81  | JNB of bit * rel
    82  | JBC of bit * rel
    83  | ACALL of addr11
    84  | LCALL of addr16
    85  | RET
    86  | RETI
    87  | AJMP of addr11
    88  | LJMP of addr16
    89  | SJMP of rel
    90  | JMP of indirect_dptr
    91  | JZ of rel
    92  | JNZ of rel
    93  | CJNE of (acc * [ direct | data ], [ reg | indirect ] * data) union2 * rel
    94  | DJNZ of [ reg | direct ] * rel
    95  | NOP
     78 | `JC of rel
     79 | `JNC of rel
     80 | `JB of bit * rel
     81 | `JNB of bit * rel
     82 | `JBC of bit * rel
     83 | `ACALL of addr11
     84 | `LCALL of addr16
     85 | `RET
     86 | `RETI
     87 | `AJMP of addr11
     88 | `LJMP of addr16
     89 | `SJMP of rel
     90 | `JMP of indirect_dptr
     91 | `JZ of rel
     92 | `JNZ of rel
     93 | `CJNE of (acc * [ direct | data ], [ reg | indirect ] * data) union2 * rel
     94 | `DJNZ of [ reg | direct ] * rel
     95 | `NOP ]
     96
     97type labelled_instruction =
     98 [ instruction
     99 | `Label of string
     100 | `Cost of string ]
Note: See TracChangeset for help on using the changeset viewer.