2 // RMAC - Reboot's Macro Assembler for all Atari computers
3 // RISCA.H - GPU/DSP Assembler
4 // Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
5 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
6 // Source utilised with the kind permission of Landon Dyer
14 #define MAXINTERNCC 26 // Maximum internal condition codes
16 // RISC Instruction Types
17 #define RI_NONE 0x0000 // No Operands - NOP
18 #define RI_ONE 0x0001 // One Operand - Rd - ABS/NEG/etc
19 #define RI_TWO 0x0002 // Two Operands - Rs,Rd - Most Instructions
20 #define RI_NUM_15 0x0003 // Numeric Operand - n,Rd - n=-16..+15 - CMPQ
21 #define RI_NUM_31 0x0004 // Numeric Operand - n,Rd - n=0..31 - BCLR/BSET/BTST/MOVEQ
22 #define RI_NUM_32 0x0005 // Numeric Operand - n,Rd - n=1..32 - ADDQ/SUBQ
23 #define RI_JR 0x0006 // Jump Relative - cc,n - n=-16..+15 words, reg2=cc
24 #define RI_JUMP 0x0007 // Jump Absolute - cc,(Rs) - reg2=cc
25 #define RI_MOVEI 0x0008 // Move Immediate - n,Rn - n in second word
26 #define RI_MOVE 0x0009 // MOVE Instruction - PC,Rn / Rn,Rn
27 #define RI_LOAD 0x000A // LOAD Instruction - Various Forms
28 #define RI_LOADN 0x000B // LOADB/LOADP/LOADW - (Rs),Rd
29 #define RI_STORE 0x000C // STORE Instruction - Various Forms
30 #define RI_STOREN 0x000D // STOREB/STOREP/STOREM - Rs,(Rd)
32 // Supplementry Instruction Flags
33 #define SUB32 0x2000 // (n = 32-n)
34 #define GPUONLY 0x4000 // Opcode is for the GPU Only
35 #define DSPONLY 0x8000 // Opcode is for the DSP Only
37 #define CHECK_COMMA if(*tok++ != ',') { error(comma_error); return(ERROR); }
39 // Opcode Specific Data
41 short state; // Opcode Name
42 unsigned short typ; // Opcode Type
43 unsigned parm; // Opcode Parameter
46 // Globals, externals etc
47 extern unsigned orgactive;
48 extern unsigned orgaddr;
49 extern unsigned orgwarning;
50 extern unsigned altbankok;
51 extern uint8_t riscImmTokenSeen;
54 int GenerateRISCCode(int);