2 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
3 // EAGEN0.C - Effective Address Code Generation
4 // Generated Code for eaN (Included twice by "eagen.c")
5 // Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
6 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
7 // Source Utilised with the Kind Permission of Landon Dyer
17 w = (WORD)(aNexattr & DEFINED);
18 tdb = (WORD)(aNexattr & TDB);
21 case DREG: // "Do nothing" - they're in the opword
30 break; // This is a performance hit, though
31 case ADISP: // expr(An)
32 if(w) { // Just deposit it
34 rmark(cursect, sloc, tdb, MWORD, NULL);
35 if(v + 0x8000 >= 0x18000)
36 return(error(range_error));
38 } else { // Arrange for fixup later on
39 fixup(FU_WORD|FU_SEXT, sloc, aNexpr);
44 if(w) { // Just deposit it
45 if((aNexattr & TDB) == cursect)
47 else if((aNexattr & TDB) != ABS)
50 if(v + 0x8000 >= 0x10000)
51 return(error(range_error));
53 } else { // Arrange for fixup later on
54 fixup(FU_WORD|FU_SEXT|FU_PCREL, sloc, aNexpr);
59 w = (WORD)((aNixreg << 12) | aNixsiz); // Compute ixreg and size+scale
60 if(aNexattr & DEFINED) { // Deposit a byte...
62 return(error(abs_error)); // Can't mark bytes
64 return(error(range_error));
67 } else { // Fixup the byte later
68 fixup(FU_BYTE|FU_SEXT, sloc+1, aNexpr);
73 w = (WORD)((aNixreg << 12) | aNixsiz); // Compute ixreg and size+scale
74 if(aNexattr & DEFINED) { // Deposit a byte...
75 if((aNexattr & TDB) == cursect)
77 else if((aNexattr & TDB) != ABS)
81 return(error(range_error));
84 } else { // Fixup the byte later
85 fixup(FU_WBYTE|FU_SEXT|FU_PCREL, sloc, aNexpr);
94 return(error("illegal byte-sized relative reference"));
95 if(v + 0x100 >= 0x200)
96 return(error(range_error));
99 fixup(FU_BYTE|FU_SEXT, sloc+1, aNexpr);
107 rmark(cursect, sloc, tdb, MWORD, NULL);
108 if(v + 0x10000 >= 0x20000)
109 return(error(range_error));
112 fixup(FU_WORD|FU_SEXT, sloc, aNexpr);
119 rmark(cursect, sloc, tdb, MLONG, NULL);
122 fixup(FU_LONG, sloc, aNexpr);
127 interror(1); // IMMED size problem
133 rmark(cursect, sloc, tdb, MWORD, NULL);
134 if(v + 0x8000 >= 0x10000)
135 return(error(range_error));
138 fixup(FU_WORD|FU_SEXT, sloc, aNexpr);
145 rmark(cursect, sloc, tdb, MLONG, NULL);
148 fixup(FU_LONG, sloc, aNexpr);
158 return(error("unsupported 68020 addressing mode"));
160 interror(3); // Bad addressing mode in ea gen
166 // Undefine dirty macros