]> Shamusworld >> Repos - rmac/blob - mark.h
Modified IMACRO and IREPT to store line numbers during definition - error now correct...
[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-2017 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 //This will have to be defined eventually. Might have to overhaul the mark
30 //system as 8-bits doesn't seem to be enough, at least for a bitfield (which it
31 //might not have to be, in which case it would be big enough...)
32 //#define MQUAD        0x               // Marked quad word (TODO: merge with MDOUBLE?)
33 #define MMOVEI       0x0200             // Mark RISC MOVEI instruction
34 #define MDOUBLE      0x0400             // Marked double float
35 #define MEXTEND      0x0800             // Marked extended float
36 #define MSINGLE      0x0880             // Marked single float (TODO: merge with MLONG?)
37 #define MGLOBAL      0x0800             // Mark contains global
38 #define MPCREL       0x1000             // Mark is PC-relative
39 #define MCHEND       0x2000             // Indicates end of mark chunk
40 #define MSYMBOL      0x4000             // Mark includes symbol pointer
41 #define MCHFROM      0x8000             // Mark includes change-to-from
42
43 // Exported variables
44 extern MCHUNK * firstmch;
45
46 // Exported functions
47 void InitMark(void);
48 void StopMark(void);
49 uint32_t MarkRelocatable(uint16_t, uint32_t, uint16_t, uint16_t, SYM *);
50 uint32_t AllocateMark(void);
51 uint32_t MarkImage(register uint8_t * mp, uint32_t siz, uint32_t tsize, int okflag);
52 uint32_t MarkBSDImage(uint8_t *, uint32_t, uint32_t, int);
53 uint32_t CreateELFRelocationRecord(uint8_t *, uint8_t *, uint16_t section);
54
55 #endif // __MARK_H__
56