#include <module.h>
Public Methods | |
uint8_t | ReadByte () |
uint16_t | ReadWord () |
uint32_t | ReadDword () |
void | UnReadByte () |
vma_t | Tell () |
Private Methods | |
DataReader (const Section *sec, unsigned char *ptr) | |
Private Attributes | |
friend | ObjectModule |
const Section * | sec |
unsigned char * | ptr |
Definition at line 61 of file module.h.
|
Definition at line 196 of file module.cpp.
|
|
Definition at line 201 of file module.cpp. References _PRG_ASSERT, range< vma_t >::begin, ObjectModule::Section::data, ObjectModule::Section::data_end, range< vma_t >::end, ObjectModule::Section::next, ptr, and sec. Referenced by InstructionDecoder::get_checkc(), CodeParser::GetBitStat(), CodeParser::GetStringStats(), CodeParser::Parse(), ObjectModule::ReadByte(), ReadWord(), CodeParser::WriteBegin(), CodeParser::WriteCode(), and CodeParser::WriteString().
00202 { 00203 _PRG_ASSERT(sec); 00204 _PRG_ASSERT(ptr >= sec->data && ptr <= sec->data_end); 00205 00206 // test cell valid 00207 if (ptr < sec->data_end) 00208 return *ptr++; 00209 00210 // next section continue this ?? 00211 if (sec->next && sec->end == sec->next->begin) 00212 { 00213 /* !!! is posible a empty section ??? */ 00214 sec = sec->next; 00215 ptr = sec->data; 00216 return *ptr++; 00217 } 00218 00219 throw OutOfAddress(sec->end); 00220 } |
|
Definition at line 229 of file module.cpp. References ReadWord(). Referenced by CodeParser::ExecuteComplexReferenceMemory(), CodeParser::GetPointerArrayStats(), InstructionDecoder::getv_rel(), CodeParser::Parse(), ObjectModule::ReadDword(), InstructionDecoder::ReadVar(), and CodeParser::WriteCode().
|
|
Definition at line 222 of file module.cpp. References ReadByte(). Referenced by InstructionDecoder::getv_rel(), ReadDword(), InstructionDecoder::ReadVar(), ObjectModule::ReadWord(), and CodeParser::WriteCode().
|
|
Definition at line 236 of file module.cpp. References range< vma_t >::begin, ObjectModule::Section::data, ptr, sec, and vma_t. Referenced by CodeParser::ExecuteComplexReferenceMemory(), InstructionDecoder::get_checkc(), CodeParser::GetBitStat(), CodeParser::GetPointerArrayStats(), CodeParser::GetStringStats(), and InstructionDecoder::getv_rel().
|
|
Definition at line 241 of file module.cpp. References _PRG_ASSERT, range< vma_t >::begin, ObjectModule::Section::data, ptr, and sec.
00242 { 00243 _PRG_ASSERT(sec); 00244 _PRG_ASSERT(ptr >= sec->data && ptr <= sec->data_end); 00245 00246 // test cell valid 00247 if (ptr >= sec->data) 00248 { 00249 --ptr; 00250 return; 00251 } 00252 00253 // !!! finish, go to other section 00254 throw OutOfAddress(sec->begin); 00255 } |
|
|
|
Definition at line 64 of file module.h. Referenced by ReadByte(), Tell(), and UnReadByte(). |
|
Definition at line 63 of file module.h. Referenced by ReadByte(), Tell(), and UnReadByte(). |