mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-06 14:38:17 +01:00
Squashed 'externals/oaknut/' content from commit 86f2ca872
git-subtree-dir: externals/oaknut git-subtree-split: 86f2ca87222e59fb0b89b2f2a6b422a58a2e0892
This commit is contained in:
commit
621367dce8
22 changed files with 15077 additions and 0 deletions
29
README.md
Normal file
29
README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Oaknut
|
||||
|
||||
*A C++20 assembler for AArch64 (ARMv8.0)*
|
||||
|
||||
Oaknut is a header-only library that allows one to dynamically assemble code in-memory at runtime.
|
||||
|
||||
## Usage
|
||||
|
||||
Simple example:
|
||||
|
||||
```cpp
|
||||
using EmittedFunction = int (*)();
|
||||
|
||||
EmittedFunction EmitExample(oaknut::CodeGenerator& code, int value)
|
||||
{
|
||||
using namespace oaknut::util;
|
||||
|
||||
EmittedFunction result = code.ptr<EmittedFunction>();
|
||||
|
||||
code.MOVZ(W0, value);
|
||||
code.RET();
|
||||
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This project is [MIT licensed](LICENSE).
|
||||
Loading…
Add table
Add a link
Reference in a new issue