summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Assembler/GekkoAssembler.h
blob: ede99532f3c675d121bb5747d3d04a054fa6b9e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <string_view>
#include <vector>

#include "Common/Assembler/AssemblerShared.h"
#include "Common/CommonTypes.h"

namespace Common::GekkoAssembler
{
struct CodeBlock
{
  CodeBlock(u32 address) : block_address(address) {}

  void PushBigEndian(u32 val);

  u32 block_address;
  std::vector<u8> instructions;
};

// Common::GekkoAssember::Assemble - Core routine for assembling Gekko/Broadway instructions
// Supports the full Gekko ISA, as well as the extended mnemonics defined by the book "PowerPC
// Microprocessor Family: The Programming Environments" The input assembly is fully parsed and
// assembled with a base address specified by the base_virtual_address
FailureOr<std::vector<CodeBlock>> Assemble(std::string_view assembly, u32 base_virtual_address);
}  // namespace Common::GekkoAssembler