]> Shamusworld >> Repos - rmac/blob - risca.h
0c49cf54c58b4b8bfe4f4554b1dfa2c2b18aad26
[rmac] / risca.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 #ifndef __RISCA_H__
9 #define __RISCA_H__
10
11 #include "rmac.h"
12 #include "procln.h"
13
14 #define MAXINTERNCC      26            // Maximum internal condition codes
15
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)
31 #define RI_MJMP          0x000E        // MJMP psuedo instruction 
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 extern int jpad;
53
54 // Prototypes
55 int risccg(int);
56 int d_orgrisc(void);
57
58 #endif // __RISCA_H__
59