]> Shamusworld >> Repos - rmac/blob - mark.h
Added in DSP fixups to sect.c, misc. fixes for 6502 assembler.
[rmac] / mark.h
1 //
2 // RMAC - Reboot's Macro Assembler for all Atari computers
3 // MARK.H - A record of things that are defined relative to any of the sections
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 __MARK_H__
10 #define __MARK_H__
11
12 #include "rmac.h"
13
14 // A mark is of the form:
15 // .W    <to+flags>     section mark is relative to, and flags in upper byte
16 // .L    <loc>          location of mark in "from" section
17 // .W    [from]         new from section
18 // .L[L] [symbol]       symbol involved in external reference (LL for 64-bit pointers)
19 #define MCHUNK struct _mchunk
20 MCHUNK {
21    MCHUNK * mcnext;                             // Next mark chunk
22    PTR mcptr;                                   // Vector of marks
23    uint16_t mcalloc;                    // # marks allocted to mark block
24    uint16_t mcused;                             // # marks used in block
25 };
26
27 #define MWORD        0x0000             // Marked word
28 #define MLONG        0x0100             // Marked long
29 #define MQUAD        0x0400             // Marked quad
30 //This will have to be defined eventually. Might have to overhaul the mark
31 //system as 8-bits doesn't seem to be enough, at least for a bitfield (which it
32 //might not have to be, in which case it would be big enough...)
33 //#define MQUAD        0x               // Marked quad word (TODO: merge with MDOUBLE?)
34 #define MMOVEI       0x0200             // Mark RISC MOVEI instruction
35 //#define MDOUBLE      0x0400           // Marked double float
36 //#define MEXTEND      0x0800           // Marked extended float
37 //#define MSINGLE      0x0880           // Marked single float (TODO: merge with MLONG?)
38 #define MGLOBAL      0x0800             // Mark contains global
39 #define MPCREL       0x1000             // Mark is PC-relative
40 #define MCHEND       0x2000             // Indicates end of mark chunk
41 #define MSYMBOL      0x4000             // Mark includes symbol pointer
42 #define MCHFROM      0x8000             // Mark includes change-to-from
43
44 // Exported variables
45 extern MCHUNK * firstmch;
46
47 // Exported functions
48 void InitMark(void);
49 void StopMark(void);
50 uint32_t MarkRelocatable(uint16_t, uint32_t, uint16_t, uint16_t, SYM *);
51 uint32_t AllocateMark(void);
52 uint32_t MarkImage(register uint8_t * mp, uint32_t siz, uint32_t tsize, int okflag);
53 uint32_t MarkBSDImage(uint8_t *, uint32_t, uint32_t, int);
54 uint32_t CreateELFRelocationRecord(uint8_t *, uint8_t *, uint16_t section);
55
56 #endif // __MARK_H__
57