]> Shamusworld >> Repos - rmac/blob - riscasm.h
Fixed bug with -l switch.
[rmac] / riscasm.h
1 //
2 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
3 // RISCA.H - GPU/DSP Assembler
4 // Copyright (C) 199x Landon Dyer, 2011 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
7 //
8
9 #ifndef __RISCA_H__
10 #define __RISCA_H__
11
12 #include "rmac.h"
13 #include "procln.h"
14
15 #define MAXINTERNCC 26                  // Maximum internal condition codes
16
17 // RISC Instruction Types
18 #define RI_NONE     0x0000              // No Operands - NOP
19 #define RI_ONE      0x0001              // One Operand - Rd - ABS/NEG/etc
20 #define RI_TWO      0x0002              // Two Operands - Rs,Rd - Most Instructions
21 #define RI_NUM_15   0x0003              // Numeric Operand - n,Rd - n=-16..+15 - CMPQ
22 #define RI_NUM_31   0x0004              // Numeric Operand - n,Rd - n=0..31 - BCLR/BSET/BTST/MOVEQ
23 #define RI_NUM_32   0x0005              // Numeric Operand - n,Rd - n=1..32 - ADDQ/SUBQ
24 #define RI_JR       0x0006              // Jump Relative - cc,n - n=-16..+15 words, reg2=cc
25 #define RI_JUMP     0x0007              // Jump Absolute - cc,(Rs) - reg2=cc
26 #define RI_MOVEI    0x0008              // Move Immediate - n,Rn - n in second word
27 #define RI_MOVE     0x0009              // MOVE Instruction - PC,Rn / Rn,Rn
28 #define RI_LOAD     0x000A              // LOAD Instruction - Various Forms
29 #define RI_LOADN    0x000B              // LOADB/LOADP/LOADW - (Rs),Rd
30 #define RI_STORE    0x000C              // STORE Instruction - Various Forms
31 #define RI_STOREN   0x000D              // STOREB/STOREP/STOREM - Rs,(Rd)
32
33 // Supplementry Instruction Flags
34 #define SUB32       0x2000              // (n = 32-n)
35 #define GPUONLY     0x4000              // Opcode is for the GPU Only
36 #define DSPONLY     0x8000              // Opcode is for the DSP Only
37
38 #define CHECK_COMMA  if(*tok++ != ',') { error(comma_error); return(ERROR); }
39
40 // Opcode Specific Data
41 struct opcoderecord {
42    short state;                                 // Opcode Name
43    unsigned short typ;                  // Opcode Type
44    unsigned parm;                               // Opcode Parameter
45 };
46
47 // Globals, externals etc
48 extern unsigned orgactive;
49 extern unsigned orgaddr;
50 extern unsigned orgwarning;
51 extern unsigned altbankok;
52
53 // Prototypes
54 int GenerateRISCCode(int);
55
56 #endif // __RISCA_H__