]> Shamusworld >> Repos - rmac/blob - risca.h
4706bf28c1de07aff76e9753aaef225e49b0029c
[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
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 #define RI_MJMP          0x000E        // MJMP psuedo instruction 
33
34 // Supplementry Instruction Flags
35 #define SUB32           0x2000         // (n = 32-n)
36 #define GPUONLY         0x4000         // Opcode is for the GPU Only
37 #define DSPONLY         0x8000         // Opcode is for the DSP Only
38
39 #define CHECK_COMMA                    if(*tok++ != ',') { error(comma_error); return(ERROR); }
40
41 // Opcode Specific Data
42 struct opcoderecord {
43    short state;                        // Opcode Name
44    unsigned short typ;                 // Opcode Type
45    unsigned parm;                      // Opcode Parameter
46 };
47
48 // Globals, externals etc
49 extern unsigned orgactive;
50 extern unsigned orgaddr;
51 extern unsigned orgwarning;
52 extern unsigned altbankok;
53 extern int jpad;
54
55 // Prototypes
56 int risccg(int);
57 int d_orgrisc(void);
58
59 #endif // __RISCA_H__