RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Apple::PEFFormat::RelocOpcode Class Reference

Represents a single 16-bit or 32-bit opcode that encodes relocations. More...

#include <pefexe.h>

Public Types

enum  opcode_type {
  SmInvalid = -1 , BySectDWithSkip = 0x0000 , BySectC = 0x4000 , BySectD = 0x4200 ,
  TVector12 = 0x4400 , TVector8 = 0x4600 , VTable8 = 0x4800 , ImportRun = 0x4A00 ,
  SmByImport = 0x6000 , SmSetSectC = 0x6200 , SmSetSectD = 0x6400 , SmBySection = 0x6600 ,
  IncrPosition = 0x8000 , SmRepeat = 0x9000 , SetPosition = 0xA000 , LgByImport = 0xA400 ,
  LgRepeat = 0xB000 , LgBySection = 0xB400 , LgSetSectC = 0xB440 , LgSetSectD = 0xB480
}
 

Public Member Functions

 RelocOpcode (opcode_type opcode=SmInvalid)
 
 RelocOpcode (opcode_type opcode, uint32_t value, uint32_t repeat)
 
void ReadFile (Linker::Reader &rd)
 Reads and initializes a single relocation opcode record.
 
uint32_t GetWord () const
 Returns the bit sequence that this opcode is stored as in the file.
 
offset_t CodeSize () const
 Returns the number of bytes required to encode this opcode.
 
void WriteFile (Linker::Writer &wr)
 Outputs a single relocation opcode to the file.
 
void GenerateRelocations (RelocationProcessor &processor) const
 Executes the opcode to possibly produce some relocation information and/or alter the state of the pseudo-microprocessor.
 
void Dump (Dumper::Dumper &dump, const PEFFormat &pef_format, uint32_t opcode_index, int display_options=0) const
 

Public Attributes

uint32_t offset = 0
 Offset of opcode within file (only used for dumping)
 
opcode_type opcode = SmInvalid
 Opcode type.
 
uint32_t value = 0
 A value parameter.
 
uint32_t repeat = 0
 A repetition parameter.
 

Detailed Description

Represents a single 16-bit or 32-bit opcode that encodes relocations.

Member Function Documentation

◆ GetWord()

uint32_t PEFFormat::RelocOpcode::GetWord ( ) const

Returns the bit sequence that this opcode is stored as in the file.

For 16-bit instructions, the value is stored as a zero extended value in the least significant bits, for 32-bit instructions, it takes up the entire word.

Member Data Documentation

◆ repeat

uint32_t Apple::PEFFormat::RelocOpcode::repeat = 0

A repetition parameter.

Depending on the type of the operation, this may encode a run_length (BySectDWithSkip, BySecton, TVector, VTable8, ImportRun) or a repetition count (Repeat)

◆ value

uint32_t Apple::PEFFormat::RelocOpcode::value = 0

A value parameter.

Depending on the type of the operation, this may encode a byte skip value (BySectDWithSkip), an offset value (IncrPosition, SetPosition), a section or symbol index (ByImport, SetSect, BySection) or the size of the block to repeat in 16-bit halfwords (Repeat)


The documentation for this class was generated from the following files: