| 1 | // Copyright 2023 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <string_view> |
| 7 | #include <vector> |
| 8 | |
| 9 | #include "Common/Assembler/AssemblerShared.h" |
| 10 | #include "Common/CommonTypes.h" |
| 11 | |
| 12 | namespace Common::GekkoAssembler |
| 13 | { |
| 14 | struct CodeBlock |
| 15 | { |
| 16 | CodeBlock(u32 address) : block_address(address) {} |
| 17 | |
| 18 | void PushBigEndian(u32 val); |
| 19 | |
| 20 | u32 block_address; |
| 21 | std::vector<u8> instructions; |
| 22 | }; |
| 23 | |
| 24 | // Common::GekkoAssember::Assemble - Core routine for assembling Gekko/Broadway instructions |
| 25 | // Supports the full Gekko ISA, as well as the extended mnemonics defined by the book "PowerPC |
| 26 | // Microprocessor Family: The Programming Environments" The input assembly is fully parsed and |
| 27 | // assembled with a base address specified by the base_virtual_address |
| 28 | FailureOr<std::vector<CodeBlock>> Assemble(std::string_view assembly, u32 base_virtual_address); |
| 29 | } // namespace Common::GekkoAssembler |