X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=sect.h;h=14dc65f86b046be347c32592a408f288ef10267f;hp=83bc7b5a5736706cdbcd2f849e5e6b27ef1fbed3;hb=4205233c8397c581b4d27ab36ab81ec896ef3dd0;hpb=30a208654896284b50e7b362e97d3e63ec717b96 diff --git a/sect.h b/sect.h index 83bc7b5..14dc65f 100644 --- a/sect.h +++ b/sect.h @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for all Atari computers // SECT.H - Code Generation, Fixups and Section Management -// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2020 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source utilized with the kind permission of Landon Dyer // @@ -54,7 +54,9 @@ #define D_ZEROFILL(n) {chcheck(n); memset(chptr, 0, n); chptr+=n; sloc+=n; \ ch_size+=n; if (orgactive) orgaddr+=n;} -#define NSECTS 16 // Max. number of sections +//OK, this is bad, mmkay? The constants defined in rmac.h are used as indices into an array which means that this was never meant to be defined this way--at least if it was, it was a compromise that has come home to bite us all in the ass. !!! FIX !!! +//#define NSECTS 16 // Max. number of sections +#define NSECTS 256 // Max. number of sections // Tunable (storage) definitions #define CH_THRESHOLD 32 // Minimum amount of space in code chunk @@ -77,12 +79,12 @@ #define FU_6BRA 0x0007 // Fixup 6502-format branch offset #define FU_BYTEH 0x0008 // Fixup 6502 high byte of immediate word #define FU_BYTEL 0x0009 // Fixup 6502 low byte of immediate word -#define FU_QUAD 0x000A // Fixup quad-word (8 bytes) -#define FU_56001 0x000B // Generic fixup code for all 56001 modes -#define FU_56001_B 0x000C // Generic fixup code for all 56001 modes (ggn: I have no shame) +#define FU_QUAD 0x000A // Fixup quad-word (8 bytes, typically OP) +#define FU_56001 0x000B // Fixup code for all 56001 modes #define FU_SEXT 0x0010 // Ok to sign extend #define FU_PCREL 0x0020 // Subtract PC first +#define FU_PCRELX 0x1000000 // 030 variant #define FU_EXPR 0x0040 // Expression (not symbol) follows #define FU_GLOBAL 0x0080 // Mark global symbol @@ -111,24 +113,19 @@ #define FU_OBJDATA 0x20000 // Fixup OL data addr (bits 43-63, drop last 3) // DSP56001 fixups -// TODO: Sadly we don't have any spare bits left inside a 16-bit word -// so we use the 2nd nibble as control code and -// stick $B or $C in the lower nibble - then it's picked up as -// FU_56001 by the fixup routine and then a second switch -// selects fixup mode. Since we now have 32 bits, we can fix this! -// [N.B.: This isn't true anymore, we now have 32 bits! :-P] -#define FU_DSPIMM5 0x090B // Fixup 5-bit immediate -#define FU_DSPADR12 0x0A0B // Fixup 12-bit address -#define FU_DSPADR24 0x0B0B // Fixup 24-bit address -#define FU_DSPADR16 0x0C0B // Fixup 24-bit address -#define FU_DSPIMM12 0x0D0B // Fixup 12-bit immediate -#define FU_DSPIMM24 0x0E0B // Fixup 24-bit immediate -#define FU_DSPIMM8 0x0F0B // Fixup 8-bit immediate -#define FU_DSPADR06 0x090C // Fixup 6-bit address -#define FU_DSPPP06 0x0A0C // Fixup 6 bit pp address -#define FU_DSPIMMFL8 0x0B0C // Fixup 8-bit immediate float -#define FU_DSPIMMFL16 0x0C0C // Fixup 16-bit immediate float -#define FU_DSPIMMFL24 0x0D0C // Fixup 24-bit immediate float +#define FUMASKDSP 0xF00000 // Mask for DSP56001 fuckups^Wfixups +#define FU_DSPIMM5 0x100000 // Fixup 5-bit immediate +#define FU_DSPADR12 0x200000 // Fixup 12-bit address +#define FU_DSPADR24 0x300000 // Fixup 24-bit address +#define FU_DSPADR16 0x400000 // Fixup 16-bit address +#define FU_DSPIMM12 0x500000 // Fixup 12-bit immediate +#define FU_DSPIMM24 0x600000 // Fixup 24-bit immediate +#define FU_DSPIMM8 0x700000 // Fixup 8-bit immediate +#define FU_DSPADR06 0x800000 // Fixup 6-bit address +#define FU_DSPPP06 0x900000 // Fixup 6 bit pp address +#define FU_DSPIMMFL8 0xA00000 // Fixup 8-bit immediate float +#define FU_DSPIMMFL16 0xB00000 // Fixup 16-bit immediate float +#define FU_DSPIMMFL24 0xC00000 // Fixup 24-bit immediate float // Chunks are used to hold generated code and fixup records