mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Using Memcpy to set/fetch opcodes to avoid issues with CPUs that don't support misalignment
This commit is contained in:
parent
1b1de99e53
commit
456c886c48
4 changed files with 966 additions and 665 deletions
|
@ -167,6 +167,22 @@ public:
|
|||
void Optimize( unsigned char *progBuffer );
|
||||
|
||||
static str GetLine( str content, int line );
|
||||
|
||||
private:
|
||||
template<typename Value>
|
||||
void EmitOpcodeValue(const Value& value, size_t size);
|
||||
|
||||
template<typename Value>
|
||||
void EmitAt(unsigned char* location, const Value& value, size_t size);
|
||||
|
||||
template<typename Value>
|
||||
void SetOpcodeValue(const Value& value);
|
||||
|
||||
template<typename Value>
|
||||
Value GetOpcodeValue(size_t size) const;
|
||||
|
||||
template<typename Value>
|
||||
Value GetOpcodeValue(size_t offset, size_t size) const;
|
||||
};
|
||||
|
||||
extern ScriptCompiler Compiler;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue