]> Shamusworld >> Repos - rmac/blob - riscasm.h
Added missing d_ds handling, add kludge for 56K fixups.
[rmac] / riscasm.h
1 //
2 // RMAC - Reboot's Macro Assembler for all Atari computers
3 // RISCA.H - GPU/DSP Assembler
4 // Copyright (C) 199x Landon Dyer, 2011-2019 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 __RISCASM_H__
10 #define __RISCASM_H__
11
12 #include "rmac.h"
13
14 // RISC Instruction Types
15 #define RI_NONE     0x0000              // No Operands - NOP
16 #define RI_ONE      0x0001              // One Operand - Rd - ABS/NEG/etc
17 #define RI_TWO      0x0002              // Two Operands - Rs,Rd - Most Instructions
18 #define RI_NUM_15   0x0003              // Numeric Operand - n,Rd - n=-16..+15 - CMPQ
19 #define RI_NUM_31   0x0004              // Numeric Operand - n,Rd - n=0..31 - BCLR/BSET/BTST/MOVEQ
20 #define RI_NUM_32   0x0005              // Numeric Operand - n,Rd - n=1..32 - ADDQ/SUBQ
21 #define RI_JR       0x0006              // Jump Relative - cc,n - n=-16..+15 words, reg2=cc
22 #define RI_JUMP     0x0007              // Jump Absolute - cc,(Rs) - reg2=cc
23 #define RI_MOVEI    0x0008              // Move Immediate - n,Rn - n in second word
24 #define RI_MOVE     0x0009              // MOVE Instruction - PC,Rn / Rn,Rn
25 #define RI_LOAD     0x000A              // LOAD Instruction - Various Forms
26 #define RI_LOADN    0x000B              // LOADB/LOADP/LOADW - (Rs),Rd
27 #define RI_STORE    0x000C              // STORE Instruction - Various Forms
28 #define RI_STOREN   0x000D              // STOREB/STOREP/STOREM - Rs,(Rd)
29
30 // Supplementry Instruction Flags
31 #define SUB32       0x2000              // (n = 32-n)
32 #define GPUONLY     0x4000              // Opcode is for the GPU Only
33 #define DSPONLY     0x8000              // Opcode is for the DSP Only
34
35 #define CHECK_COMMA  if (*tok++ != ',') { return error(comma_error); }
36
37 // Globals, externals etc
38 extern unsigned orgactive;
39 extern unsigned orgaddr;
40 extern unsigned orgwarning;
41 extern unsigned altbankok;
42 extern uint8_t riscImmTokenSeen;
43
44 // Prototypes
45 int GenerateRISCCode(int);
46
47 #endif // __RISCASM_H__