?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  
  3.   SjASMPlus Z80 Cross Compiler - modified - RELOCATE extension
  4.  
  5.   Copyright (c) 2006 Sjoerd Mastijn (original SW)
  6.   Copyright (c) 2020 Peter Ped Helcmanovsky (RELOCATE extension)
  7.  
  8.   This software is provided 'as-is', without any express or implied warranty.
  9.   In no event will the authors be held liable for any damages arising from the
  10.   use of this software.
  11.  
  12.   Permission is granted to anyone to use this software for any purpose,
  13.   including commercial applications, and to alter it and redistribute it freely,
  14.   subject to the following restrictions:
  15.  
  16.   1. The origin of this software must not be misrepresented; you must not claim
  17.          that you wrote the original software. If you use this software in a product,
  18.          an acknowledgment in the product documentation would be appreciated but is
  19.          not required.
  20.  
  21.   2. Altered source versions must be plainly marked as such, and must not be
  22.          misrepresented as being the original software.
  23.  
  24.   3. This notice may not be removed or altered from any source distribution.
  25.  
  26. */
  27.  
  28. // relocate.h
  29.  
  30. #ifndef __RELOCATE_H__
  31. #define __RELOCATE_H__
  32.  
  33. namespace Relocation {
  34.         enum EType {
  35.                 OFF = 0, REGULAR = 1, HIGH = 2
  36.                 // also used as offset adjustment and bool test (so explicit values 0,1,2 are important)
  37.         };
  38.  
  39.         extern aint alternative_offset; // offset to add to label value when evaluating alternatives
  40.  
  41.         extern EType type;                              // type of relocation block when inside
  42.         extern bool areLabelsOffset;    // when labels should evaluate to alternative values
  43.  
  44.         // when one of previous expression results was affected by alternative values
  45.         extern bool isResultAffected;   // cumulative for all expression evaluation calls since last clear
  46.  
  47.         // when isResultAffected && can be relocated by simple +offset (REGULAR -> +offset, HIGH -> +(offset>>8))
  48.         extern EType deltaType;                 // valid value only for last expression evaluated
  49.  
  50.         //convenience method to add particular spot in incoming machine code + clear the flag
  51.         void resolveRelocationAffected(const aint opcodeRelOffset, EType minType = REGULAR);
  52.         bool checkAndWarn(bool doError = false);
  53.  
  54.         // directives implementation
  55.         void dirRELOCATE_START();
  56.         void dirRELOCATE_END();
  57.         void dirRELOCATE_TABLE();
  58.  
  59.         void InitPass();
  60. }
  61.  
  62. #endif
  63.  
  64. //eof relocate.h
  65.