Example Usage
var bufferList = new Arm64InstructionBufferByList();
var asm = new Arm64Assembler(bufferList);
// // Main entry point
// _start:
var labelStart = asm.CreateLabelId("_start");
asm.BindLabel(labelStart);
// mov x0, #5 // Call sum_loop(5)
asm.MOVZ(X0, 5);
// bl sum_loop // Call the function, result in x0
var labelSumLoop = asm.CreateLabelId("sum_loop");
asm.BL(labelSumLoop);
//
// // Do something with result (for now, just returning)
// ret // Return from _start (normally would return to a caller)
asm.RET();
//
//
// // Function: sum_loop(x0)
// // - Takes x0 as the loop limit
// // - Returns the sum in x0
// sum_loop:
asm.BindLabel(labelSumLoop);
// mov x1, #0 // Accumulator (sum)
asm.MOVZ(X1, 0);
// mov x2, #0 // Counter
asm.MOVZ(X2, 0);
//
// loop_start:
var labelLoopStart = asm.CreateLabelId("loop_start");
asm.BindLabel(labelLoopStart);
// add x1, x1, x2 // Add counter (x2) to sum (x1)
asm.ADD(X1, X1, X2);
// add x2, x2, #1 // Increment counter
asm.ADD(X2, X2, 1);
//
// cmp x2, x0 // Compare counter with limit
asm.CMP(X2, X0);
// blt loop_
See also
-SKYNET-Steam-Emulator
Open Source
Client emulator to play steam games on LAN without Internet connection.…
pyinstxtractor-ng
Open Source
PyInstaller Extractor Next Generation…
010editor
Free
Templates and scripts for 010 editor…
bddisasm
Open Source
bddisasm is a fast, lightweight, x86/x64 instruction decoder. The project also features a fast, bas…
AAIdrive
Open Source
Implementations of some Android Auto features as unofficial IDrive apps…
glua-steal
Open Source
Retrieves client-sided Lua files from Garry's Mod game servers…