ack/mach/m65oo2/as/mach4.c

50 lines
1.4 KiB
C
Raw Permalink Normal View History

2024-02-22 15:13:52 +00:00
operation
2024-02-22 19:37:12 +00:00
: OP_impl
2024-02-22 15:13:52 +00:00
{ emit1($1);}
2024-02-22 19:37:12 +00:00
| OP_branch expr
{ branch($1, $2);}
| OP_arithm SIZE '#' expr
{ encode_imm($1+0x9, $2, $4);}
| OP_arithm SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1+0x0D); encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_arithm SIZE expr ',' REG_x
2024-02-23 15:09:37 +00:00
{ emit1($1+0x1D); encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_arithm SIZE expr ',' REG_y
2024-02-23 15:09:37 +00:00
{ emit1($1+0x19); encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_arithm SIZE '(' expr ',' REG_x ')'
2024-02-23 15:09:37 +00:00
{ emit1($1+0x01); encode_addr($4, $2);}
2024-02-22 19:37:12 +00:00
| OP_arithm SIZE '(' expr ')' ',' REG_y
2024-02-23 15:09:37 +00:00
{ emit1($1+0x11); encode_addr($4, $2);}
2024-02-22 19:37:12 +00:00
| OP_jump expr
2024-02-23 15:09:37 +00:00
{ emit1($1); encode_addr($2, 0);}
2024-02-22 19:37:12 +00:00
| OP_jump '(' expr ')'
2024-02-23 15:09:37 +00:00
{ emit1($1+0x20); encode_addr($3, 0);}
2024-02-22 19:37:12 +00:00
| OP_jsr expr
2024-02-23 15:09:37 +00:00
{ emit1($1); encode_addr($2, 0);}
2024-02-22 19:37:12 +00:00
| OP_rol REG_acc
{ emit1($1+0x0A);}
| OP_rol SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1+0x0E);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_rol SIZE expr ',' REG_x
2024-02-23 15:09:37 +00:00
{ emit1($1+0x1E);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_bit SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_cpx SIZE '#' expr
2024-02-23 15:09:37 +00:00
{ encode_imm($1, $2, $4);}
2024-02-22 19:37:12 +00:00
| OP_cpx SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1+0x0C);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_inc SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1+0x0E);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_inc SIZE expr ',' REG_x
2024-02-23 15:09:37 +00:00
{ emit1($1+0x1E);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_stx SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_ldx SIZE '#' expr
2024-02-23 15:09:37 +00:00
{ encode_imm($1, $2, $4);}
2024-02-22 19:37:12 +00:00
| OP_ldx SIZE expr
2024-02-23 15:09:37 +00:00
{ emit1($1+0x0C);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
| OP_ldx SIZE expr ',' REG_x
2024-02-23 15:09:37 +00:00
{ emit1($1+0x1C);encode_addr($3, $2);}
2024-02-22 19:37:12 +00:00
;