extern valu_t rel_1,rel_2;
#endif
extern int model; /* 68000/68010 */
+extern int curr_instr;
/* addressing mode bits */
#define DTA 0x01
*/
operation
+ : { curr_instr = curr_token; }
+ _operation
+ ;
+
+_operation
: bcdx DREG ',' DREG
{ emit2($1 | $2 | $4<<9);}
| bcdx '-' '(' AREG ')' ',' '-' '(' AREG ')'
* Motorola 68000/68010 auxiliary functions
*/
+static int
+extension_offset()
+{
+ switch(curr_instr) {
+ case MOVEM:
+ case FMOVE:
+ case FMOVEM:
+ case FDYADIC:
+ case FMONADIC:
+ case FSINCOS:
+ case FSCC:
+ case FTST:
+ return 4;
+ }
+ return 2;
+}
+
ea_1(sz, bits)
{
register flag;
/* pc relative with index */
if (sz == SIZE_NON)
sz = SIZE_DEF;
- exp_2.val -= (DOTVAL + 2);
+ exp_2.val -= (DOTVAL + extension_offset());
mrg_2 = 073;
checksize(sz, 2|4);
index(rg<<12 | (sz&0200)<<4);
return;
}
if ((exp_2.typ & ~S_DOT) == DOTTYP) {
- sm = fitw(exp_2.val-(DOTVAL+2));
+ int off = extension_offset();
+ sm = fitw(exp_2.val-(DOTVAL+off));
sm = small(sm, 2);
if (sm) { /* pc relative */
- exp_2.val -= (DOTVAL+2);
+ exp_2.val -= (DOTVAL+off);
mrg_2 = 072;
}
} else {
ea72()
{
mrg_2 = 072;
- exp_2.val -= (DOTVAL + 2);
+ exp_2.val -= (DOTVAL + extension_offset());
}
ea73(ri, sz)
{
mrg_2 = 073;
- exp_2.val -= (DOTVAL + 2);
+ exp_2.val -= (DOTVAL + extension_offset());
checksize(sz, 2|4);
index(ri<<12 | (sz&0200)<<4);
}